/**
 * FR Shopify Headless — minimal structural CSS.
 *
 * Namespaced under .fr-shopify* only. No global resets, no unscoped element
 * selectors. Themes override via these custom properties and classes.
 */

.fr-shopify,
.fr-shopify-cart-drawer,
.fr-shopify-cart-backdrop {
	--fr-shopify-gap: 1rem;
	--fr-shopify-drawer-width: 400px;
	--fr-shopify-bg: #ffffff;
	--fr-shopify-fg: #111111;
	--fr-shopify-muted: #666666;
	--fr-shopify-border: #e2e2e2;
	--fr-shopify-accent: #111111;
	--fr-shopify-accent-fg: #ffffff;
	--fr-shopify-z: 99999;
	/* Fonts inherit from the theme by default; per-site overrides set these. */
	--fr-shopify-font-heading: inherit;
	--fr-shopify-font-label: inherit;
	box-sizing: border-box;
}

.fr-shopify *,
.fr-shopify-cart-drawer * {
	box-sizing: border-box;
}

/* ------------------------------ Collection ------------------------------ */

.fr-shopify-collection__grid {
	display: grid;
	/* Yeezy-style grid: 3 per row on desktop. */
	grid-template-columns: repeat(3, 1fr);
	gap: var(--fr-shopify-gap);
}

@media (max-width: 900px) {
	.fr-shopify-collection__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.fr-shopify-collection__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.fr-shopify-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
}

.fr-shopify-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--fr-shopify-border);
}

.fr-shopify-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	/* Subtle zoom on hover, Yeezy-style. */
	transition: transform 0.5s ease;
}

.fr-shopify-card:hover .fr-shopify-card__img,
.fr-shopify-card:focus-visible .fr-shopify-card__img {
	transform: scale(1.06);
}

.fr-shopify-card__title {
	margin: 0.5rem 0 0.25rem;
	font-size: 0.9rem;
	font-family: var(--fr-shopify-font-heading);
}

.fr-shopify-card__price {
	color: var(--fr-shopify-muted);
	font-size: 0.85rem;
	font-family: var(--fr-shopify-font-label);
}

.fr-shopify-card__badge {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	padding: 0.15rem 0.5rem;
	font-size: 0.75rem;
	background: var(--fr-shopify-accent);
	color: var(--fr-shopify-accent-fg);
}

.fr-shopify-collection__more {
	margin-top: var(--fr-shopify-gap);
	text-align: center;
}

/* -------------------------------- Product ------------------------------- */

/* Minimal, centered, Yeezy-style single product. */
.fr-shopify-product {
	max-width: 900px;
	margin: 0 auto;
	text-align: center;
}

.fr-shopify-product__gallery {
	position: relative;
	max-width: 640px;
	margin: 0 auto;
}

.fr-shopify-product__zoom-trigger {
	display: block;
	width: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}

.fr-shopify-product__main-image {
	width: 100%;
	height: auto;
	display: block;
}

/* Side arrows appear only when the gallery has multiple images. */
.fr-shopify-product__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 2.75rem;
	height: 2.75rem;
	border: 0;
	background: none;
	color: var(--fr-shopify-fg);
	font-size: 2.25rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.65;
	transition: opacity 0.2s ease;
}

.fr-shopify-product__nav:hover {
	opacity: 1;
}

.fr-shopify-product__nav--prev {
	left: -0.5rem;
}

.fr-shopify-product__nav--next {
	right: -0.5rem;
}

.fr-shopify-product__title {
	margin: 1.25rem 0 0.5rem;
	font-family: var(--fr-shopify-font-heading);
}

.fr-shopify-product__price {
	font-size: 1.15rem;
	margin: 0 0 1.25rem;
	font-family: var(--fr-shopify-font-label);
}

.fr-shopify-product__compare {
	color: var(--fr-shopify-muted);
	text-decoration: line-through;
	margin-left: 0.5rem;
	font-size: 0.95rem;
}

.fr-shopify-product__options {
	margin: 0 auto var(--fr-shopify-gap);
	max-width: 320px;
}

.fr-shopify-product__options select {
	width: 100%;
}

.fr-shopify-product__add {
	display: inline-block;
	min-width: 240px;
	padding: 0.85rem 2rem;
	background: var(--fr-shopify-accent);
	color: var(--fr-shopify-accent-fg);
	border: 0;
	cursor: pointer;
	font-size: 1rem;
	font-family: var(--fr-shopify-font-label);
	letter-spacing: 0.02em;
}

.fr-shopify-product__add[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.fr-shopify-product__unavailable {
	color: var(--fr-shopify-muted);
}

.fr-shopify-product__description {
	margin: 2rem auto 0;
	max-width: 640px;
	text-align: left;
	color: var(--fr-shopify-fg);
}

/* ------------------------------ Cart button ----------------------------- */

.fr-shopify-cart-button__count {
	display: inline-block;
	min-width: 1.4em;
	padding: 0 0.35em;
	text-align: center;
	border-radius: 999px;
	background: var(--fr-shopify-accent, #111);
	color: var(--fr-shopify-accent-fg, #fff);
	font-size: 0.75em;
	line-height: 1.4em;
}

/* ------------------------------ Cart drawer ----------------------------- */

.fr-shopify-cart-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	z-index: calc(var(--fr-shopify-z) - 1);
}

.fr-shopify-cart-backdrop.is-open {
	opacity: 1;
	visibility: visible;
}

.fr-shopify-cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: min(var(--fr-shopify-drawer-width), 100%);
	background: var(--fr-shopify-bg);
	color: var(--fr-shopify-fg);
	transform: translateX(100%);
	transition: transform 0.25s ease;
	z-index: var(--fr-shopify-z);
	display: flex;
	flex-direction: column;
	box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.fr-shopify-cart-drawer.is-open {
	transform: translateX(0);
}

.fr-shopify-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--fr-shopify-gap);
	border-bottom: 1px solid var(--fr-shopify-border);
}

.fr-shopify-cart-drawer__title {
	margin: 0;
	font-size: 1.1rem;
}

.fr-shopify-cart-drawer__close {
	background: none;
	border: 0;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: inherit;
}

.fr-shopify-cart-drawer__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: var(--fr-shopify-gap);
}

.fr-shopify-cart__lines {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fr-shopify-cart__line {
	display: flex;
	gap: 0.75rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--fr-shopify-border);
}

.fr-shopify-cart__img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	flex: 0 0 auto;
}

.fr-shopify-cart__info {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	flex: 1 1 auto;
}

.fr-shopify-cart__qty {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.35rem;
}

.fr-shopify-cart__qty-btn,
.fr-shopify-cart__remove {
	min-width: 1.8rem;
	min-height: 1.8rem;
	border: 1px solid var(--fr-shopify-border);
	background: var(--fr-shopify-bg);
	color: inherit;
	cursor: pointer;
	line-height: 1;
}

.fr-shopify-cart__remove {
	margin-left: auto;
	border: 0;
}

.fr-shopify-cart-drawer__footer {
	padding: var(--fr-shopify-gap);
	border-top: 1px solid var(--fr-shopify-border);
}

.fr-shopify-cart__subtotal-row {
	display: flex;
	justify-content: space-between;
	margin-bottom: 0.5rem;
	font-weight: 600;
}

.fr-shopify-cart__checkout {
	display: block;
	width: 100%;
	padding: 0.85rem 1rem;
	background: var(--fr-shopify-accent);
	color: var(--fr-shopify-accent-fg);
	border: 0;
	cursor: pointer;
	text-align: center;
	font-size: 1rem;
}

.fr-shopify-cart__error {
	color: #b00020;
	margin-bottom: 0.5rem;
}

.fr-shopify-cart__empty {
	color: var(--fr-shopify-muted);
	text-align: center;
	padding: 2rem 0;
}

.fr-shopify-cart-drawer.is-loading .fr-shopify-cart-drawer__body {
	opacity: 0.5;
	pointer-events: none;
}

.fr-shopify-discount {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.fr-shopify-discount__input {
	flex: 1 1 auto;
	padding: 0.5rem;
	border: 1px solid var(--fr-shopify-border);
}

/* ------------------------------ Lightbox ------------------------------ */

.fr-shopify-lightbox {
	position: fixed;
	inset: 0;
	z-index: calc(var(--fr-shopify-z, 99999) + 10);
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	padding: 3rem;
}

.fr-shopify-lightbox.is-open {
	display: flex;
}

.fr-shopify-lightbox__img {
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	cursor: zoom-out;
}

.fr-shopify-lightbox__close {
	position: absolute;
	top: 1rem;
	right: 1.25rem;
	width: 2.5rem;
	height: 2.5rem;
	border: 0;
	background: none;
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

.fr-shopify-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 3rem;
	height: 3rem;
	border: 0;
	background: none;
	color: #fff;
	font-size: 2.75rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
	display: none;
}

.fr-shopify-lightbox.has-multiple .fr-shopify-lightbox__nav {
	display: block;
}

.fr-shopify-lightbox__nav:hover {
	opacity: 1;
}

.fr-shopify-lightbox__nav--prev {
	left: 1rem;
}

.fr-shopify-lightbox__nav--next {
	right: 1rem;
}

/* ---------------------- Commerce-page chrome ---------------------- */

/*
 * On commerce pages (shop + product), hide the theme's global header and
 * footer template parts, plus the site title and primary navigation. These
 * are replaced by the minimal top bar and copyright footer below. Scoped to
 * the body class so the rest of the site is untouched.
 */
.fr-shopify-commerce-page header.wp-block-template-part,
.fr-shopify-commerce-page footer.wp-block-template-part,
.fr-shopify-commerce-page .wp-site-blocks > header,
.fr-shopify-commerce-page .wp-site-blocks > footer,
.fr-shopify-commerce-page .wp-block-site-title,
.fr-shopify-commerce-page .wp-block-navigation {
	display: none !important;
}

/*
 * Hide the shop page's WordPress page/post title ('SHOP') rendered in the
 * body by the theme, so only the product grid shows below the top bar.
 */
.fr-shopify-commerce-page .wp-block-post-title,
.fr-shopify-commerce-page .wp-block-query-title,
.fr-shopify-commerce-page .entry-title {
	display: none !important;
}

/*
 * Widen the collection out of the theme's constrained content width to 90%
 * of the viewport, centered. Overrides block-theme content-size constraints.
 */
.fr-shopify-commerce-page .fr-shopify-collection {
	width: 90vw;
	max-width: 90vw;
	margin-left: calc( 50% - 45vw );
	margin-right: calc( 50% - 45vw );
}

/* Mobile: near-full width with a small 5px gutter on each side. */
@media (max-width: 600px) {
	.fr-shopify-commerce-page .fr-shopify-collection {
		width: auto;
		max-width: none;
		margin-left: 5px;
		margin-right: 5px;
	}
}

.fr-shopify-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem clamp(1rem, 4vw, 2.5rem);
	border-bottom: 1px solid var(--fr-shopify-border, #e2e2e2);
	background: var(--fr-shopify-bg, #ffffff);
	color: var(--fr-shopify-fg, #111111);
	font-family: var(--fr-shopify-font-label, inherit);
	font-size: 0.8125rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.fr-shopify-topbar__back,
.fr-shopify-topbar__brand {
	color: inherit;
	text-decoration: none;
}

.fr-shopify-topbar__back:hover,
.fr-shopify-topbar__brand:hover {
	opacity: 0.6;
}

.fr-shopify-topbar__brand {
	font-family: var(--fr-shopify-font-heading, inherit);
	font-weight: 500;
}

/*
 * Minimal copyright footer that replaces the theme footer on commerce pages.
 */
.fr-shopify-footer {
	padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
	border-top: 1px solid var(--fr-shopify-border, #e2e2e2);
	background: var(--fr-shopify-bg, #ffffff);
	color: var(--fr-shopify-fg, #111111);
	font-family: var(--fr-shopify-font-label, inherit);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: center;
	opacity: 0.7;
}
