/**
 * Store — Commerce
 *
 * Shop, collection and product detail. Conditionally enqueued on WooCommerce
 * templates only. Every value resolves to a token from tokens.css.
 *
 * Sources: shop.dc.html · collection.dc.html · product.dc.html
 */

/* ==========================================================================
 * FILTER BAR — chips, count, sort
 * Source: shop.dc.html / collection.dc.html
 * ========================================================================== */

/*
 * At mobile the design draws a hairline under EACH of the bar's two rows; at
 * desktop the bar is one row with a single hairline under the whole thing. The
 * borders are therefore carried by the rows at mobile and by the bar at desktop,
 * so each row measures exactly as drawn.
 */
.scstore-filter-bar__tools {
	border-block-end: var(--scstore-border-hairline);
}

/*
 * Mobile: the chip row scrolls horizontally and bleeds to the page edges, so
 * the negative margin cancels the container padding and the padding puts it
 * back inside the row itself.
 */
.scstore-filter-bar__chips {
	display: flex;
	gap: 9px;
	overflow-x: auto;
	/*
	 * The hairline belongs to the CHIP ROW, not to the tools row below it. Same
	 * line on screen either way, but putting it on the wrong element made the
	 * two rows a pixel off from the design when each is measured on its own.
	 */
	border-block-end: var(--scstore-border-hairline);
	padding-block-end: 18px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.scstore-filter-bar__chips::-webkit-scrollbar {
	display: none;
}

.scstore-chip {
	flex: 0 0 auto;
	padding: 9px 16px;
	border: 1px solid var(--scstore-color-border-strong);
	border-radius: var(--scstore-radius-pill);
	background-color: transparent;
	color: var(--scstore-color-ink);
	font-size: var(--scstore-text-11-5);
	font-weight: var(--scstore-weight-semibold);
	letter-spacing: var(--scstore-ls-08);
	text-transform: uppercase;
	transition:
		background-color var(--scstore-duration-fast) ease,
		border-color var(--scstore-duration-fast) ease,
		color var(--scstore-duration-fast) ease;
}

.scstore-chip:hover {
	border-color: var(--scstore-color-ink);
}

.scstore-chip.is-current {
	background-color: var(--scstore-color-ink);
	border-color: var(--scstore-color-ink);
	color: var(--scstore-color-text-on-dark);
}

.scstore-filter-bar__tools {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-block: 14px;
	font-size: var(--scstore-text-12);
}

.scstore-filter-bar__count {
	color: var(--scstore-color-text-muted);
}

/*
 * The design draws SORT as a label with a chevron. A native <select> is layered
 * over it at zero opacity so the control is the real form element — keyboard
 * operable, screen-reader announced, and functional without JavaScript — while
 * the visible text is the design's.
 */
.scstore-sort {
	position: relative;
	display: flex;
	align-items: center;
}

.scstore-sort__label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: var(--scstore-weight-semibold);
	letter-spacing: var(--scstore-ls-05);
	text-transform: uppercase;
	pointer-events: none;
}

.scstore-sort__select {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	min-block-size: 44px;
	opacity: 0;
	cursor: pointer;
	appearance: none;
	border: 0;
	padding: 0;
}

.scstore-sort__select:focus-visible + .scstore-sort__label,
.scstore-sort:focus-within .scstore-sort__label {
	outline: 2px solid var(--scstore-color-burgundy);
	outline-offset: 3px;
}

.scstore-sort__submit {
	margin-inline-start: var(--scstore-space-8);
	text-decoration: underline;
}

@media (min-width: 1024px) {
	.scstore-filter-bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 20px;
		flex-wrap: wrap;
		padding-block-end: 22px;
		border-block-end: var(--scstore-border-hairline);
	}

	.scstore-filter-bar__tools {
		border-block-end: 0;
	}

	.scstore-filter-bar__chips {
		gap: 10px;
		flex-wrap: wrap;
		overflow: visible;
		border-block-end: 0;
		padding-block-end: 0;
	}

	.scstore-chip {
		padding: 10px 20px;
		font-size: var(--scstore-text-12);
		letter-spacing: var(--scstore-ls-10);
	}

	.scstore-filter-bar__tools {
		gap: 22px;
		justify-content: flex-end;
		padding-block: 0;
	}

	.scstore-filter-bar__count {
		font-size: var(--scstore-text-13);
	}

	.scstore-sort__label {
		gap: var(--scstore-space-8);
		font-size: var(--scstore-text-12-5);
		letter-spacing: var(--scstore-ls-06);
	}
}

/* ==========================================================================
 * ARCHIVE LAYOUT — shop and collection
 * ========================================================================== */

.scstore-archive__head {
	max-inline-size: var(--scstore-container);
	margin-inline: auto;
	padding-block-start: 36px;
	padding-inline: 20px;
}

.scstore-archive__bar {
	max-inline-size: var(--scstore-container);
	margin-inline: auto;
	margin-block-start: 24px;
	padding-inline: 20px;
}

.scstore-archive__body {
	max-inline-size: var(--scstore-container);
	margin-inline: auto;
	padding-block-start: 22px;
	padding-inline: 20px;
}

/* The collection hero is full-bleed, so its breadcrumb sits below it. */
.scstore-archive--collection .scstore-archive__head {
	padding-block-start: 16px;
}

@media (min-width: 1024px) {
	.scstore-archive__head {
		padding-block-start: 56px;
		padding-inline: var(--scstore-gutter);
	}

	.scstore-archive__bar {
		margin-block-start: 44px;
		padding-inline: var(--scstore-gutter);
	}

	.scstore-archive__body {
		padding-block-start: 40px;
		padding-inline: var(--scstore-gutter);
	}

	.scstore-archive--collection .scstore-archive__head {
		padding-block-start: 40px;
	}
}

/* ==========================================================================
 * SHOP HEADER
 * ========================================================================== */

/*
 * No top margin at mobile: the design has no breadcrumb there, so the head's
 * own 36px padding is the entire offset. A margin here as well doubled it.
 */
.scstore-shop-header {
	margin-block-start: 0;
}

/*
 * The eyebrow's bottom margin is section-specific throughout the designs.
 * Shop uses 12px at mobile and 16px at desktop; the shared rule carries the
 * collections values, so both are restated here.
 */
.scstore-shop-header .scstore-section-eyebrow {
	margin-block-end: var(--scstore-space-12);
}

.scstore-shop-header__title {
	font-size: 46px;
	font-weight: var(--scstore-weight-semibold);
	line-height: var(--scstore-lh-90);
}

/*
 * The Arabic sits UNDER the heading, at the start of the line.
 *
 * `.scstore-kufi` sets `direction: rtl` so Arabic shapes correctly. On a BLOCK
 * element that also moves the text to the right edge of the full-width box —
 * which is what the artboard does, leaving "كل القطع" stranded against the far
 * right of the page with the heading on the left. Making the element shrink to
 * its own text keeps the RTL run intact and puts it where the design's own
 * spacing (10px under the heading) plainly intends it.
 *
 * A deliberate departure from the artboard, at the client's request.
 * See docs/DESIGN-DISCREPANCIES.md.
 */
.scstore-shop-header__title-ar {
	display: inline-block;
	margin-block-start: var(--scstore-space-8);
	font-size: var(--scstore-text-24);
	color: var(--scstore-color-burgundy);
}

.scstore-shop-header__intro {
	margin-block-start: var(--scstore-space-12);
	font-size: var(--scstore-text-13-5);
	color: var(--scstore-color-text-muted);
}

.scstore-shop-header__intro--desktop {
	display: none;
}

@media (min-width: 1024px) {
	.scstore-shop-header {
		margin-block-start: 34px;
	}

	.scstore-shop-header .scstore-section-eyebrow {
		margin-block-end: var(--scstore-space-16);
	}

	.scstore-shop-header__title {
		font-size: var(--scstore-text-64);
		line-height: var(--scstore-lh-92);
		letter-spacing: var(--scstore-ls-tight);
	}

	.scstore-shop-header__title-ar {
		margin-block-start: 10px;
		font-size: var(--scstore-text-30);
	}

	.scstore-shop-header__intro {
		margin-block-start: 14px;
		max-inline-size: 460px;
		font-size: var(--scstore-text-15);
	}

	.scstore-shop-header__intro--desktop {
		display: block;
	}

	.scstore-shop-header__intro--mobile {
		display: none;
	}
}

/* ==========================================================================
 * PRODUCT GRID
 * Shop: 2-up mobile / 4-up desktop. Collection: 2-up mobile / 3-up desktop
 * with a taller 4/5 card. Both use the SAME card component.
 * ========================================================================== */

.scstore-product-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 12px;
}

@media (min-width: 768px) and (max-width: 1023px) {
	.scstore-product-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.scstore-product-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 22px 20px;
	}

	.scstore-archive--collection .scstore-product-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 26px 22px;
	}
}

/* Collection cards are 4/5 and zoom on hover instead of swapping image. */
.scstore-archive--collection .scstore-product-card__frame {
	aspect-ratio: var(--scstore-ratio-collection);
}

@media (min-width: 1024px) {
	.scstore-archive--collection .scstore-product-card__image {
		transition: transform var(--scstore-duration-zoom) var(--scstore-ease);
	}

	.scstore-archive--collection .scstore-product-card:hover .scstore-product-card__image--primary {
		opacity: 1;
		transform: scale(1.05);
	}

	.scstore-archive--collection .scstore-product-card__name-ar {
		font-size: var(--scstore-text-21);
	}
}

/*
 * The shop and collection grids use SLIGHTLY smaller card type than the
 * homepage row at mobile — an explicit design variant, not drift.
 * See docs/DESIGN-DISCREPANCIES.md §28.
 */
.scstore-product-grid .scstore-product-card__info {
	padding-block-start: 11px;
}

.scstore-product-grid .scstore-product-card__name-ar {
	font-size: var(--scstore-text-16);
}

.scstore-product-grid .scstore-product-card__name-en {
	font-size: var(--scstore-text-11-5);
}

.scstore-product-grid .scstore-product-card__prices {
	gap: 7px;
	margin-block-start: 5px;
}

.scstore-product-grid .scstore-product-card__price {
	font-size: var(--scstore-text-12-5);
}

.scstore-product-grid .scstore-product-card__was {
	font-size: var(--scstore-text-11-5);
}

@media (min-width: 1024px) {
	.scstore-product-grid .scstore-product-card__info {
		padding-block-start: var(--scstore-space-16);
	}

	.scstore-product-grid .scstore-product-card__name-ar {
		font-size: var(--scstore-text-20);
	}

	.scstore-product-grid .scstore-product-card__name-en {
		font-size: var(--scstore-text-13-5);
	}

	.scstore-product-grid .scstore-product-card__prices {
		gap: 10px;
		margin-block-start: 9px;
	}

	.scstore-product-grid .scstore-product-card__price {
		font-size: var(--scstore-text-14-5);
	}

	.scstore-product-grid .scstore-product-card__was {
		font-size: var(--scstore-text-13-5);
	}
}

/* ==========================================================================
 * LOAD MORE
 * ========================================================================== */

.scstore-load-more {
	padding-block: 36px 0;
	text-align: center;
}

.scstore-load-more__btn {
	padding-block: 14px;
	padding-inline: 40px;
	font-size: var(--scstore-text-12);
}

@media (min-width: 1024px) {
	.scstore-load-more {
		padding-block: 64px 8px;
	}

	.scstore-load-more__btn {
		padding-block: var(--scstore-space-16);
		padding-inline: 48px;
		font-size: var(--scstore-text-12-5);
	}
}

/* ==========================================================================
 * EMPTY STATE
 * Not drawn in any design — built from the established language.
 * ========================================================================== */

.scstore-empty {
	padding-block: 64px 32px;
	text-align: center;
}

.scstore-empty__title {
	font-size: var(--scstore-text-34);
	font-style: italic;
}

.scstore-empty__text {
	margin-block: var(--scstore-space-12) var(--scstore-space-24);
	color: var(--scstore-color-text-muted);
}

/* The archive ends with a gap before the newsletter band. */
.scstore-archive {
	padding-block-end: 48px;
}

@media (min-width: 1024px) {
	.scstore-archive {
		padding-block-end: 96px;
	}
}

/* ==========================================================================
 * COLLECTION HERO
 * Source: collection.dc.html. Desktop centres the content over a HORIZONTAL
 * gradient; mobile anchors it to the foot under a VERTICAL one.
 * ========================================================================== */

.scstore-collection-hero {
	position: relative;
	block-size: 420px;
	overflow: hidden;
	background-color: var(--scstore-color-ink);
	color: var(--scstore-color-text-on-dark);
}

/*
 * The photograph is knocked back so the type stays legible — 70% on mobile,
 * 72% on desktop, exactly as drawn.
 */
.scstore-collection-hero__media,
.scstore-collection-hero__media img {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	opacity: 0.7;
}

.scstore-collection-hero__scrim {
	position: absolute;
	inset: 0;
	background-image: linear-gradient(
		180deg,
		rgba(var(--scstore-overlay-deep-rgb), 0.15),
		rgba(var(--scstore-overlay-deep-rgb), 0.72)
	);
}

.scstore-collection-hero__body {
	position: absolute;
	inset-inline: 0;
	inset-block-end: 0;
	padding: 0 var(--scstore-gutter-mobile-section) 36px;
}

.scstore-collection-hero__eyebrow {
	margin-block-end: 10px;
	font-size: var(--scstore-text-10);
	letter-spacing: var(--scstore-ls-28);
	text-transform: uppercase;
	color: var(--scstore-color-beige-newsletter);
}

.scstore-collection-hero__heading {
	font-weight: var(--scstore-weight-semibold);
}

.scstore-collection-hero__name-ar {
	display: block;
	font-size: var(--scstore-text-52);
	font-weight: var(--scstore-weight-semibold);
	line-height: var(--scstore-lh-100);
}

.scstore-collection-hero__title {
	display: block;
	margin-block-start: 2px;
	font-size: var(--scstore-text-30);
	font-style: italic;
	font-weight: var(--scstore-weight-medium);
	line-height: normal;
}

.scstore-collection-hero__text {
	margin-block-start: var(--scstore-space-12);
	font-size: var(--scstore-text-13-5);
	line-height: var(--scstore-lh-160);
	color: var(--scstore-color-text-hero);
}

.scstore-collection-hero__text--desktop {
	display: none;
}

@media (min-width: 1024px) {
	.scstore-collection-hero {
		block-size: 520px;
	}

	.scstore-collection-hero__media,
	.scstore-collection-hero__media img {
		opacity: 0.72;
	}

	.scstore-collection-hero__scrim {
		background-image: linear-gradient(
			90deg,
			rgba(var(--scstore-overlay-deep-rgb), 0.7),
			rgba(var(--scstore-overlay-deep-rgb), 0.15)
		);
	}

	.scstore-collection-hero__body {
		inset: 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
		max-inline-size: 640px;
		padding: 0 88px;
	}

	.scstore-collection-hero__eyebrow {
		margin-block-end: var(--scstore-space-16);
		font-size: var(--scstore-text-12);
		letter-spacing: var(--scstore-ls-32);
	}

	.scstore-collection-hero__name-ar {
		font-size: 72px;
	}

	.scstore-collection-hero__title {
		margin-block-start: var(--scstore-space-4);
		font-size: 46px;
	}

	.scstore-collection-hero__text {
		margin-block-start: 18px;
		max-inline-size: 460px;
		font-size: var(--scstore-text-16);
		line-height: var(--scstore-lh-170);
	}

	.scstore-collection-hero__text--desktop {
		display: block;
	}

	.scstore-collection-hero__text--mobile {
		display: none;
	}
}

/* ==========================================================================
 * PRODUCT — LAYOUT
 * Source: product.dc.html. Five bands of different widths: 1280 for the
 * gallery/summary grid, 1300 for the story, 900 for the accordions, 1240 for
 * reviews and related.
 * ========================================================================== */

.scstore-product__crumbs {
	max-inline-size: 1280px;
	margin-inline: auto;
	padding-inline: 20px;
}

.scstore-product__main {
	max-inline-size: 1280px;
	margin-inline: auto;
}

@media (min-width: 1024px) {
	.scstore-product__crumbs {
		padding-block-start: var(--scstore-space-32);
		padding-inline: var(--scstore-gutter);
	}

	.scstore-product__main {
		display: grid;
		grid-template-columns: 1.15fr 0.85fr;
		gap: 56px;
		align-items: start;
		padding-block-start: 28px;
		padding-inline: var(--scstore-gutter);
	}
}

/* ==========================================================================
 * PRODUCT GALLERY
 * ========================================================================== */

.scstore-gallery__rail {
	display: none;
}

.scstore-gallery__stage {
	position: relative;
	background-color: var(--scstore-color-surface-alt);
}

/*
 * Mobile: a scroll-snap track. One slide fills the viewport width and the
 * browser handles the swipe — no carousel library.
 */
.scstore-gallery__track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.scstore-gallery__track::-webkit-scrollbar {
	display: none;
}

.scstore-gallery__slide {
	flex: 0 0 100%;
	scroll-snap-align: center;
	aspect-ratio: var(--scstore-ratio-product);
	overflow: hidden;
	background-color: var(--scstore-color-surface-alt);
}

.scstore-gallery__image {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.scstore-gallery__badge {
	position: absolute;
	inset-block-start: 14px;
	inset-inline-start: 14px;
	z-index: var(--scstore-z-raised);
	padding: 4px 10px;
	border-radius: var(--scstore-radius-xs);
	color: #fff;
	font-size: var(--scstore-text-9-5);
	font-weight: var(--scstore-weight-semibold);
	letter-spacing: var(--scstore-ls-10);
	text-transform: uppercase;
}

.scstore-gallery__wish {
	position: absolute;
	inset-block-start: var(--scstore-space-12);
	inset-inline-end: var(--scstore-space-12);
	z-index: var(--scstore-z-raised);
	display: flex;
	align-items: center;
	justify-content: center;
	inline-size: 34px;
	block-size: 34px;
	border-radius: var(--scstore-radius-round);
	background-color: var(--scstore-color-scrim-light);
}

.scstore-gallery__dots {
	position: absolute;
	inset-inline: 0;
	inset-block-end: 14px;
	display: flex;
	gap: 6px;
	justify-content: center;
}

.scstore-gallery__dot {
	inline-size: 4px;
	block-size: 4px;
	border-radius: 2px;
	background-color: rgba(var(--scstore-overlay-rgb), 0.35);
	transition:
		inline-size var(--scstore-duration-normal) ease,
		background-color var(--scstore-duration-normal) ease;
}

.scstore-gallery__dot.is-current {
	inline-size: 20px;
	background-color: var(--scstore-color-ink);
}

@media (min-width: 1024px) {
	.scstore-gallery {
		display: grid;
		/* Single-image products have no thumbnail rail, so the stage must fill the
		 * whole column. The 84px rail column is added only when there are multiple
		 * images (see .has-multiple) — otherwise the lone stage would land in the
		 * 84px column and the image would shrink to a thumbnail. */
		grid-template-columns: 1fr;
		gap: var(--scstore-space-16);
		align-items: start;
	}

	.scstore-gallery.has-multiple {
		grid-template-columns: 84px 1fr;
	}

	.scstore-gallery__rail {
		display: flex;
		flex-direction: column;
		gap: var(--scstore-space-12);
	}

	.scstore-gallery__thumb {
		aspect-ratio: var(--scstore-ratio-product);
		overflow: hidden;
		background-color: var(--scstore-color-surface-alt);
		border: var(--scstore-border-width-input) solid transparent;
		opacity: 0.72;
		transition:
			opacity var(--scstore-duration-fast) ease,
			border-color var(--scstore-duration-fast) ease;
	}

	.scstore-gallery__thumb:hover {
		opacity: 1;
	}

	.scstore-gallery__thumb.is-current {
		opacity: 1;
		border-color: var(--scstore-color-ink);
	}

	.scstore-gallery__thumb-image {
		inline-size: 100%;
		block-size: 100%;
		object-fit: cover;
	}

	/* Desktop shows one image; the rail is the control. */
	.scstore-gallery__track {
		overflow: hidden;
	}

	.scstore-gallery__badge {
		inset-block-start: var(--scstore-space-16);
		inset-inline-start: var(--scstore-space-16);
		padding: 5px 11px;
		font-size: var(--scstore-text-10-5);
	}

	.scstore-gallery__wish,
	.scstore-gallery__dots {
		display: none;
	}
}

/* ==========================================================================
 * PRODUCT SUMMARY
 * ========================================================================== */

.scstore-product__summary {
	padding: var(--scstore-space-24) 20px 0;
}

.scstore-product__eyebrow {
	margin-block-end: 10px;
	font-size: var(--scstore-text-10);
	letter-spacing: var(--scstore-ls-26);
	text-transform: uppercase;
	color: var(--scstore-color-beige-mid);
}

.scstore-product__name-ar {
	font-size: var(--scstore-text-36);
	font-weight: var(--scstore-weight-semibold);
	line-height: var(--scstore-lh-100);
}

.scstore-product__title {
	margin-block-start: 6px;
	font-size: var(--scstore-text-17);
	font-weight: var(--scstore-weight-semibold);
}

.scstore-product__meta {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-block-start: var(--scstore-space-12);
}

.scstore-product__price {
	font-size: var(--scstore-text-20);
	font-weight: var(--scstore-weight-semibold);
}

.scstore-product__price del {
	margin-inline-end: 6px;
	font-weight: var(--scstore-weight-regular);
	color: var(--scstore-color-beige-mid);
}

.scstore-product__price ins {
	text-decoration: none;
}

.scstore-product__rating {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: var(--scstore-text-11-5);
	color: var(--scstore-color-burgundy);
}

.scstore-product__rating-count {
	color: var(--scstore-color-text-muted);
}

.scstore-product__excerpt {
	margin-block-start: var(--scstore-space-16);
	font-size: var(--scstore-text-14);
	line-height: var(--scstore-lh-165);
	color: var(--scstore-color-text-copy);
}

/* Breakpoint copy variants — both are in the document, CSS picks one. */
.scstore-product__excerpt--desktop {
	display: none;
}

@media (min-width: 1024px) {
	.scstore-product__summary {
		padding: 6px 0 0;
	}

	.scstore-product__eyebrow {
		margin-block-end: var(--scstore-space-12);
		font-size: var(--scstore-text-11-5);
		letter-spacing: var(--scstore-ls-28);
	}

	.scstore-product__name-ar {
		font-size: var(--scstore-text-44);
	}

	.scstore-product__title {
		margin-block-start: var(--scstore-space-8);
		font-size: var(--scstore-text-20);
		letter-spacing: var(--scstore-ls-01);
	}

	.scstore-product__meta {
		gap: var(--scstore-space-12);
		margin-block-start: var(--scstore-space-16);
	}

	.scstore-product__price {
		font-size: var(--scstore-text-22);
	}

	.scstore-product__rating {
		font-size: var(--scstore-text-12-5);
		letter-spacing: var(--scstore-ls-10);
	}

	.scstore-product__excerpt {
		margin-block-start: 22px;
		max-inline-size: 440px;
		font-size: var(--scstore-text-15-5);
		line-height: var(--scstore-lh-170);
	}

	.scstore-product__excerpt--desktop {
		display: block;
	}

	.scstore-product__excerpt--mobile {
		display: none;
	}
}
