/**
 * shop.css — Della Boutique
 *
 * WooCommerce's own stylesheets are switched off entirely (see
 * della_woo_styles() in inc/enqueue.php), so this file is the complete
 * catalogue design: the product card, the product grid, the shop archive
 * header, sorting, pagination, notices and the select2 dropdowns.
 *
 * Loaded on every page while WooCommerce is active, because product cards
 * appear on the homepage and the 404 page too.
 */

/* =========================================================================
   1. Product grid
   ========================================================================= */

ul.products,
.della-products {
	display: grid;
	grid-template-columns: repeat(var(--della-cols-mobile), minmax(0, 1fr));
	gap: calc(var(--della-gap) * 1.4) var(--della-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	/* Every card in a row is as tall as the tallest one; the card then pins its
	   own price and button to that shared baseline. Stated explicitly because
	   the carousel variant re-declares this container as a flex row. */
	align-items: stretch;
}

@media (min-width: 768px) {
	ul.products,
	.della-products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 992px) {
	ul.products,
	.della-products {
		grid-template-columns: repeat(var(--della-cols-desktop), minmax(0, 1fr));
	}

	/* Explicit per-section column counts from the homepage builder. */
	.della-products.della-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.della-products.della-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.della-products.della-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.della-products.della-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.della-products.della-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* =========================================================================
   2. The product card
   ========================================================================= */

ul.products li.product,
.della-products li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	/* Fill the row's tallest card — in the grid AND in the flex carousel — so
	   there is spare space for the auto margin below to hand to the price. A
	   block-size of 100% would resolve against an indefinite height and quietly
	   undo this. */
	align-self: stretch;
	min-inline-size: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	/* Centred text is what separates an editorial grid from a marketplace. */
	text-align: center;
}

/*
 * WooCommerce wraps the card in its own anchor. The theme puts a second, more
 * precisely scoped anchor around the image, so the outer one must not paint a
 * box of its own.
 */
.woocommerce-loop-product__link,
.woocommerce-LoopProduct-link {
	display: contents;
	color: inherit;
}

/* --- Media -------------------------------------------------------------- */

/*
 * The hairline frames the photograph, not the whole card.
 *
 * Almost every garment here is shot on white, so without a frame the image
 * bleeds into the page and the row loses its rhythm. Boxing the entire card
 * instead would put a rule between the price and the next card's photograph and
 * read as an admin table; ruling only the media keeps the typography sitting
 * free on the page, which is the editorial look the brand wants.
 */
.della-card__media {
	position: relative;
	overflow: hidden;
	background: var(--della-surface);
	border: var(--della-line-hair);
	border-radius: var(--della-radius);
	/* An explicit ratio: the grid never reflows as images decode. */
	aspect-ratio: var(--della-product-aspect);
	margin-block-end: 14px;
	transition: border-color var(--della-dur) var(--della-ease);
}

li.product:hover .della-card__media,
li.product:focus-within .della-card__media {
	border-color: rgba(var(--della-border-rgb), 0.9);
}

.della-card__link {
	display: block;
	block-size: 100%;
	position: relative;
}

.della-card__img,
.della-card__media img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	object-position: center top;
}

/*
 * The slow zoom. A long, gently over-shooting curve makes the photograph feel
 * like it is breathing rather than snapping.
 */
.della-card__media.has-zoom .della-card__img {
	transition: transform calc(var(--della-dur-slow) * 2) cubic-bezier(0, 0, 0.44, 1.18);
}

li.product:hover .della-card__media.has-zoom .della-card__img {
	transform: scale(1.04);
}

/* The second photograph cross-fades over the first. */
.della-card__img--hover {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity var(--della-dur-slow) var(--della-ease);
	z-index: 1;
}

li.product:hover .della-card__media.has-hover .della-card__img--hover,
li.product:focus-within .della-card__media.has-hover .della-card__img--hover {
	opacity: 1;
}

/* --- Hover actions ------------------------------------------------------ */

.della-card__actions {
	position: absolute;
	inset-block-start: 10px;
	inset-inline-end: 10px;
	z-index: 4;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.della-card__actions:empty {
	display: none;
}

.della-card__action {
	display: grid;
	place-items: center;
	inline-size: 40px;
	block-size: 40px;
	border-radius: 50%; /* A genuine circle: shape, not the themed corner radius. */
	background: var(--della-bg);
	color: var(--della-heading);
	box-shadow: 0 2px 10px rgba(var(--della-text-rgb), 0.12);
	opacity: 0;
	/*
	 * Each button starts from a DIFFERENT offset and runs for a DIFFERENT
	 * length of time. The desync is the whole trick — buttons that arrive
	 * together read as a menu, buttons that arrive apart read as considered.
	 */
	transform: translateY(30px);
	transition: opacity var(--della-dur) var(--della-ease),
		transform var(--della-dur) var(--della-ease-out),
		background-color var(--della-dur-fast) var(--della-ease),
		color var(--della-dur-fast) var(--della-ease);
}

.della-card__action:nth-child(2) {
	transform: translateY(5px);
	transition-duration: calc(var(--della-dur) * 1.25);
}

.della-card__action:nth-child(3) {
	transform: translateY(15px);
	transition-duration: calc(var(--della-dur) * 1.4);
}

li.product:hover .della-card__action,
li.product:focus-within .della-card__action {
	opacity: 1;
	transform: translateY(0);
}

.della-card__action:hover,
.della-card__action.is-active {
	background: var(--della-accent);
	color: var(--della-accent-contrast);
}

.della-card__action.is-active .della-icon {
	fill: currentColor;
}

/* Touch devices have no hover; show the controls permanently. */
@media (hover: none) {
	.della-card__action {
		opacity: 1;
		transform: none;
	}
}

/* --- Quick add ---------------------------------------------------------- */

.della-quickadd {
	position: absolute;
	inset-inline: 0;
	inset-block-end: 0;
	z-index: 4;
	background: rgba(255, 255, 255, 0.96);
	padding: 12px 10px 13px;
	text-align: center;
	transform: translateY(100%);
	opacity: 0;
	transition: transform var(--della-dur) var(--della-ease-out),
		opacity var(--della-dur) var(--della-ease);
}

li.product:hover .della-quickadd,
li.product:focus-within .della-quickadd {
	transform: translateY(0);
	opacity: 1;
}

.della-quickadd__label {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: var(--della-tracking-wide);
	color: var(--della-muted);
	margin-block-end: 8px;
}

.della-quickadd__sizes {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 5px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.della-quickadd__size {
	min-inline-size: 30px;
	block-size: 28px;
	padding-inline: 7px;
	border: 1px solid var(--della-border);
	border-radius: var(--della-radius-sm);
	background: var(--della-bg);
	font-size: var(--della-fs-xs);
	font-weight: 600;
	color: var(--della-heading);
	transition: background-color var(--della-dur-fast) var(--della-ease),
		border-color var(--della-dur-fast) var(--della-ease),
		color var(--della-dur-fast) var(--della-ease);
}

.della-quickadd__size:hover {
	background: var(--della-accent);
	border-color: var(--della-accent);
	color: var(--della-accent-contrast);
}

.della-quickadd__size.is-disabled,
.della-quickadd__size[disabled] {
	color: var(--della-muted);
	cursor: not-allowed;
	position: relative;
	overflow: hidden;
	opacity: 0.6;
}

.della-quickadd__size.is-disabled::after,
.della-quickadd__size[disabled]::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top left,
		transparent calc(50% - 0.5px),
		var(--della-muted) calc(50% - 0.5px),
		var(--della-muted) calc(50% + 0.5px),
		transparent calc(50% + 0.5px)
	);
}

/* Mobile has no hover state and little room; the quick-add strip is noise. */
@media (max-width: 767px) {
	.della-quickadd {
		display: none;
	}
}

/* --- Card text ---------------------------------------------------------- */

/*
 * Card alignment across a row.
 *
 * Two things used to push the button around: titles that wrap to one line in
 * one card and two in the next, and a colour-swatch row that only some products
 * have. So the title reserves two lines up front, and the price takes the
 * leftover space as a top margin — which parks the price, and everything after
 * it, on a shared baseline no matter what sits above. The button's own margin
 * stays fixed, so its top edge lands at the identical y in every card.
 */
.della-card__title {
	font-family: var(--della-font-body);
	font-size: var(--della-fs-base);
	font-weight: 700;
	line-height: 1.4;
	/* Exactly two lines at the current line-height. */
	min-block-size: 2.8em;
	text-transform: capitalize;
	letter-spacing: 0;
	color: var(--della-heading);
	margin: 0 0 6px;
}

.della-card__title a {
	color: inherit;
}

.della-card__title a:hover {
	color: var(--della-accent-alt);
}

ul.products li.product .price,
.della-products li.product .price {
	display: block;
	font-family: var(--della-font-body);
	font-size: var(--della-fs-md);
	font-weight: 400;
	line-height: 1.5;
	color: var(--della-muted);
	/* `auto` absorbs the height difference between a card that has a swatch row
	   and one that does not, so the price and the button below it align. */
	margin: auto 0 0;
}

ul.products li.product .price del,
.della-products li.product .price del {
	color: rgba(var(--della-text-rgb), 0.4);
	font-weight: 400;
	margin-inline-end: 6px;
	text-decoration-thickness: 1px;
}

ul.products li.product .price ins,
.della-products li.product .price ins {
	background: none;
	text-decoration: none;
	color: var(--della-sale);
	font-weight: 500;
}

ul.products li.product .star-rating,
.della-products li.product .star-rating {
	margin: 6px auto 2px;
}

/* Add-to-bag button sits at the bottom of every card, aligned across the row. */
ul.products li.product > .della-btn,
.della-products li.product > .della-btn {
	margin-block-start: 12px;
	align-self: center;
	inline-size: 100%;
	max-inline-size: 220px;
}

/*
 * A card with no price (a "call for price" piece) has nothing above it holding
 * the auto margin, so the button takes the job itself and still lands on the
 * row's baseline.
 */
ul.products li.product:not(:has(.price)) > .della-btn,
.della-products li.product:not(:has(.price)) > .della-btn {
	margin-block-start: auto;
}

@media (max-width: 767px) {
	ul.products li.product > .della-btn,
	.della-products li.product > .della-btn {
		/* 44px is the touch minimum; this used to sit two pixels under it. */
		min-block-size: 44px;
		padding-inline: 14px;
		font-size: var(--della-fs-xs);
	}
}

/*
 * WooCommerce's own star rating, restyled.
 *
 * WooCommerce draws these with a private icon font where the letter "s" maps to
 * a star glyph. That @font-face is declared in `woocommerce-general`, which this
 * theme removes wholesale via the woocommerce_enqueue_styles filter — so the
 * markup rendered as literal "sssss". Using the real ★ character removes the
 * dependency entirely: it exists in every system font stack, so the rating
 * cannot break again if the stylesheet situation changes.
 */
.star-rating {
	position: relative;
	display: inline-block;
	inline-size: 5.6em;
	block-size: 1.2em;
	overflow: hidden;
	font-size: 0.78em;
	line-height: 1.2;
	font-family: var(--della-font-body);
	letter-spacing: 0.06em;
	color: var(--della-accent-alt);
	white-space: nowrap;
}

.star-rating::before {
	content: "\2605\2605\2605\2605\2605";
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	letter-spacing: inherit;
	color: var(--della-border);
}

.star-rating span {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	overflow: hidden;
	padding-block-start: 1.5em;
	block-size: 0;
}

.star-rating span::before {
	/* Same ★ as the empty row; the span's width is what fills them in. */
	content: "\2605\2605\2605\2605\2605";
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	letter-spacing: inherit;
	white-space: nowrap;
}

/* =========================================================================
   3. Shop archive chrome
   ========================================================================= */

/*
 * della_woo_wrapper_start() opens <main> directly, with no inner container
 * element, so <main> itself has to be the measure on shop screens.
 */
.della-main--shop {
	inline-size: 100%;
	max-inline-size: var(--della-container);
	margin-inline: auto;
	padding-inline: var(--della-gutter);
	padding-block-end: var(--della-section-gap);
}

@media (min-width: 768px) {
	.della-main--shop {
		padding-inline: calc(var(--della-gutter) * 2);
	}
}

.woocommerce-products-header {
	text-align: center;
	max-inline-size: 720px;
	margin-inline: auto;
	padding-block: clamp(30px, 5vw, 60px) clamp(20px, 3vw, 34px);
}

.woocommerce-products-header__title,
.woocommerce-products-header .page-title {
	position: relative;
	font-size: clamp(var(--della-fs-xl), 4.4vw, var(--della-fs-2xl));
	padding-block-end: 18px;
}

.woocommerce-products-header__title::after {
	content: "";
	position: absolute;
	inset-block-end: 0;
	inset-inline: 0;
	margin-inline: auto; /* Centres without translateX, so RTL needs no override. */
	inline-size: 30px;
	block-size: 2px;
	background: var(--della-accent-alt);
}

.term-description,
.woocommerce-products-header .term-description {
	margin-block-start: 16px;
	color: var(--della-muted);
	font-size: var(--della-fs-base);
	line-height: 1.75;
}

/* The sorting bar. */
.woocommerce-notices-wrapper + .woocommerce-result-count,
.woocommerce-result-count {
	margin: 0;
	font-size: var(--della-fs-sm);
	color: var(--della-muted);
}

.woocommerce-ordering {
	margin: 0;
}

.woocommerce-ordering select {
	min-block-size: 42px;
	padding-block: 9px;
	font-size: var(--della-fs-sm);
	inline-size: auto;
	min-inline-size: 200px;
}

/*
 * WooCommerce prints the result count and the ordering form as siblings, with
 * no wrapper of its own, immediately before ul.products. The toolbar row is
 * therefore assembled with a float rather than flex — and `float: inline-end`
 * is the logical form, so it mirrors in Arabic on its own.
 */
.woocommerce-result-count {
	display: block;
	margin-block-end: 12px;
	padding-block-start: 8px;
}

@media (min-width: 600px) {
	.woocommerce-result-count {
		display: inline-block;
		margin-block-end: 0;
	}

	form.woocommerce-ordering {
		float: inline-end;
	}
}

ul.products {
	clear: both;
	padding-block-start: 26px;
	border-block-start: var(--della-line-soft);
	margin-block-start: 18px;
}

/* A carousel row is laid out by components.css; it must not keep grid gaps. */
.della-products--carousel {
	scroll-padding-inline-start: var(--della-gutter);
}

/* The homepage and 404 rows are not archives; no rule, no extra padding. */
.della-products {
	border-block-start: 0;
	margin-block-start: 0;
	padding-block-start: 0;
}

/* Load-more / infinite-scroll footer (built by app.js). */
.della-loadmore {
	display: grid;
	justify-items: center;
	gap: 12px;
	padding-block: 44px 0;
}

.della-loadmore__btn {
	min-inline-size: 220px;
}

.della-loadmore__btn[disabled] {
	pointer-events: none;
}

.della-loadmore__status {
	font-size: var(--della-fs-sm);
	color: var(--della-muted);
	text-align: center;
	min-block-size: 1em;
}

.della-loadmore__status:empty {
	min-block-size: 0;
}

.della-loadmore__sentinel {
	inline-size: 100%;
	block-size: 1px;
}

/* Cards appended by the load-more request. */
ul.products.is-loading {
	opacity: 0.55;
	pointer-events: none;
	transition: opacity var(--della-dur) var(--della-ease);
}

/* Category tiles rendered inside an archive loop by WooCommerce. */
ul.products li.product-category {
	text-align: center;
}

ul.products li.product-category img {
	inline-size: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	background: var(--della-surface);
	margin-block-end: 14px;
}

ul.products li.product-category h2 {
	font-family: var(--della-font-body);
	font-size: var(--della-fs-base);
	font-weight: 700;
	text-transform: capitalize;
}

ul.products li.product-category .count {
	display: block;
	font-size: var(--della-fs-xs);
	color: var(--della-muted);
	margin-block-start: 4px;
}

/* =========================================================================
   4. Notices
   ========================================================================= */

.woocommerce-notices-wrapper:empty {
	display: none;
}

/*
 * The notice skin — background, accent bar, inline padding, the error list —
 * now lives with the .della-prompt component in components.css, which lists
 * .woocommerce-message / -error / -info as its aliases. One definition serves
 * the theme's own prompts and WooCommerce's notices alike.
 */

/* WooCommerce's generic .button, wherever a template prints one. */
.woocommerce .button,
a.button,
button.button,
input.button,
.wc-block-components-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-block-size: 44px;
	padding: 11px 24px;
	border: 1px solid var(--della-accent);
	border-radius: var(--della-radius);
	background: var(--della-accent);
	color: var(--della-accent-contrast);
	font-family: var(--della-font-body);
	font-size: var(--della-fs-btn);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: var(--della-tracking);
	text-transform: var(--della-button-transform);
	text-align: center;
	cursor: pointer;
	transition: background-color var(--della-dur) var(--della-ease),
		border-color var(--della-dur) var(--della-ease),
		color var(--della-dur) var(--della-ease);
}

.woocommerce .button:hover,
a.button:hover,
button.button:hover,
input.button:hover {
	background: var(--della-accent-hover);
	border-color: var(--della-accent-hover);
	color: var(--della-accent-contrast);
}

a.button.alt,
button.button.alt {
	background: var(--della-accent);
	border-color: var(--della-accent);
}

.button[disabled],
.button.disabled {
	background: var(--della-surface);
	border-color: var(--della-border);
	color: var(--della-muted);
	cursor: not-allowed;
}

/* Stock lines. */
.stock {
	font-size: var(--della-fs-sm);
	font-weight: 500;
	margin-block: 10px;
}

.stock.in-stock {
	color: var(--della-new);
}

.stock.low-stock {
	color: var(--della-sale);
}

.stock.out-of-stock {
	color: var(--della-soldout);
}

/* =========================================================================
   5. select2 / selectWoo
   These still load on cart and checkout, and ship with their own default
   theme. Restyled here so the country pickers match everything else.
   ========================================================================= */

.select2-container {
	inline-size: 100% !important; /* select2 writes an inline pixel width on init. */
}

.select2-container .select2-selection--single {
	block-size: 46px;
	border: var(--della-line);
	border-radius: var(--della-radius);
	background: var(--della-bg);
	outline: 0;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: 44px;
	padding-inline: 14px 34px;
	color: var(--della-text);
	font-size: var(--della-fs-base);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
	block-size: 44px;
	inset-inline-end: 10px;
	inset-inline-start: auto;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
	border-color: var(--della-muted) transparent transparent;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
	border-color: transparent transparent var(--della-muted);
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
	color: var(--della-muted);
}

.select2-container--open .select2-selection--single,
.select2-container--focus .select2-selection--single {
	border-color: var(--della-accent);
	box-shadow: 0 0 0 1px var(--della-accent);
}

.select2-dropdown {
	border: 1px solid var(--della-accent);
	border-radius: var(--della-radius);
	background: var(--della-bg);
	box-shadow: var(--della-shadow-pop);
	overflow: hidden;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
	border: var(--della-line);
	border-radius: var(--della-radius);
	min-block-size: 40px;
	padding: 8px 12px;
}

.select2-container--default .select2-results__option {
	padding: 9px 14px;
	font-size: var(--della-fs-sm);
	color: var(--della-text);
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
	background: var(--della-surface);
	color: var(--della-heading);
}

.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option[data-selected="true"] {
	background: var(--della-accent);
	color: var(--della-accent-contrast);
}

.select2-results__options {
	max-block-size: 260px;
}

/* =========================================================================
   6. Screen-reader / misc WooCommerce leftovers
   ========================================================================= */

.woocommerce-store-notice {
	display: block;
	background: var(--della-bar-bg);
	color: var(--della-bar-text);
	text-align: center;
	padding: 12px 20px;
	font-size: var(--della-fs-sm);
	margin: 0;
}

.woocommerce-Price-amount bdi {
	white-space: nowrap;
}

/*
 * WooCommerce's CSS is off, so the currency symbol has no styling of its own.
 * Setting it a shade smaller keeps the number the thing the eye lands on.
 */
.woocommerce-Price-currencySymbol {
	font-size: 0.85em;
	margin-inline-end: 0.06em;
	vertical-align: baseline;
}

.clear {
	clear: both;
}
