/**
 * INTERLUX — WooCommerce base
 *
 * Structural, foundation-level styling only: enough that shop, product, cart
 * and checkout inherit the new type, colour and spacing instead of falling
 * back to unstyled browser defaults.
 *
 * This is NOT the shop/product/cart redesign — those are later steps, and no
 * WooCommerce template is overridden by this theme. Everything here targets
 * WooCommerce's own native markup.
 */

/* -------------------------------------------------------------------------
 * Shell
 * ---------------------------------------------------------------------- */

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

.woocommerce-breadcrumb {
	margin-bottom: var(--ilx-space-md);
	color: var(--ilx-color-muted);
	font-size: var(--ilx-text-xs);
	letter-spacing: var(--ilx-tracking-nav);
	text-transform: uppercase;
}

.woocommerce-breadcrumb a {
	color: var(--ilx-color-muted);
	text-decoration: none;
}

.woocommerce-breadcrumb a:hover {
	color: var(--ilx-color-accent-strong);
}

.woocommerce-products-header__title,
.product_title {
	margin-bottom: var(--ilx-space-sm);
}

.term-description,
.woocommerce-products-header .term-description {
	max-width: var(--ilx-container-narrow);
	color: var(--ilx-color-muted);
}

/* -------------------------------------------------------------------------
 * Result count / ordering
 * ---------------------------------------------------------------------- */

.woocommerce-result-count,
.woocommerce-ordering {
	margin-bottom: var(--ilx-space-md);
	color: var(--ilx-color-muted);
	font-size: var(--ilx-text-small);
}

.woocommerce-ordering select {
	width: auto;
	min-width: 14rem;
}

/* -------------------------------------------------------------------------
 * Product grid
 *
 * WooCommerce emits `ul.products` with `li.product`. A plain responsive grid
 * for now; the designed product card is a later step.
 * ---------------------------------------------------------------------- */

.woocommerce ul.products,
.woocommerce-page ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: var(--ilx-space-lg) var(--ilx-space-md);
	margin: 0 0 var(--ilx-space-xl);
	padding: 0;
	list-style: none;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	margin: 0;
	text-align: left;
}

.woocommerce ul.products li.product a {
	text-decoration: none;
}

/* Door and hardware photography is cut-out, tall and low-resolution (most
 * originals are ~200px wide). A fixed-ratio frame keeps the grid even while the
 * image sits at its natural size inside it, so nothing is upscaled into blur. */
.woocommerce ul.products li.product .ilx-loop-media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 3 / 4;
	margin-bottom: var(--ilx-space-xs);
	padding: var(--ilx-space-sm);
	border-radius: var(--ilx-radius-sm);
	background-color: var(--ilx-color-surface);
	overflow: hidden;
}

.woocommerce ul.products li.product .ilx-loop-media img,
.woocommerce-page ul.products li.product .ilx-loop-media img {
	width: auto;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
	object-fit: contain;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	margin-bottom: var(--ilx-space-3xs);
	font-size: var(--ilx-text-body);
	font-weight: var(--ilx-weight-medium);
	letter-spacing: 0;
}

.woocommerce ul.products li.product .price {
	display: block;
	color: var(--ilx-color-ink);
	font-size: var(--ilx-text-price);
	font-weight: var(--ilx-weight-medium);
}

.woocommerce ul.products li.product .button {
	margin-top: var(--ilx-space-2xs);
}

/* -------------------------------------------------------------------------
 * Price
 * ---------------------------------------------------------------------- */

.price {
	color: var(--ilx-color-ink);
}

.price del {
	margin-right: var(--ilx-space-3xs);
	color: var(--ilx-color-muted);
	font-weight: var(--ilx-weight-regular);
	text-decoration: line-through;
}

.price ins {
	color: var(--ilx-color-sale);
	text-decoration: none;
}

/* Sale badge — the one place the signal red is allowed. */
.woocommerce span.onsale {
	display: inline-block;
	padding: 0.25rem 0.6rem;
	border-radius: var(--ilx-radius-sm);
	background-color: var(--ilx-color-sale);
	color: #fff;
	font-size: var(--ilx-text-xs);
	font-weight: var(--ilx-weight-semibold);
	letter-spacing: var(--ilx-tracking-label);
	line-height: 1;
	text-transform: uppercase;
}

/* -------------------------------------------------------------------------
 * Single product
 * ---------------------------------------------------------------------- */

/*
 * `minmax(0, 1fr)` is load-bearing. A grid track defaults to `min-width: auto`,
 * so the configurator's table — which has a wide min-content size — stretched
 * the single column past the container and pushed the whole page sideways at
 * narrow widths.
 */
.single-product div.product {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--ilx-space-lg) var(--ilx-space-xl);
	margin-bottom: var(--ilx-section-gap-tight);
}

.single-product div.product > * {
	min-width: 0;
}

/* Let the configurator scroll inside itself rather than widen the page. */
.wcff-fields-group {
	max-width: 100%;
	overflow-x: auto;
}

@media (min-width: 1024px) {
	.single-product div.product {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: start;
	}

	.single-product div.product .woocommerce-product-gallery {
		grid-row: span 2;
	}

	.single-product div.product .woocommerce-tabs,
	.single-product div.product .related,
	.single-product div.product .up-sells {
		grid-column: 1 / -1;
	}
}

.woocommerce-product-gallery {
	background-color: var(--ilx-color-surface);
}

.woocommerce-product-gallery__image img {
	margin-inline: auto;
}

.woocommerce-product-details__short-description {
	color: var(--ilx-color-text);
}

.summary .price {
	display: block;
	margin-bottom: var(--ilx-space-sm);
	font-size: var(--ilx-text-h3);
	font-weight: var(--ilx-weight-light);
}

.product_meta {
	margin-top: var(--ilx-space-md);
	padding-top: var(--ilx-space-sm);
	border-top: var(--ilx-border-width) solid var(--ilx-color-line);
	color: var(--ilx-color-muted);
	font-size: var(--ilx-text-xs);
	letter-spacing: var(--ilx-tracking-nav);
	text-transform: uppercase;
}

/* Quantity + add to cart */
.quantity input.qty {
	width: 5rem;
	text-align: center;
}

form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--ilx-space-2xs);
	margin-bottom: var(--ilx-space-md);
}

form.cart.variations_form,
form.cart.grouped_form {
	display: block;
}

table.variations {
	margin-bottom: var(--ilx-space-sm);
}

table.variations th,
table.variations td {
	border-bottom: 0;
	padding-inline: 0;
}

/* Tabs */
.woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ilx-space-md);
	margin: 0 0 var(--ilx-space-md);
	padding: 0 0 var(--ilx-space-2xs);
	border-bottom: var(--ilx-border-width) solid var(--ilx-color-line);
	list-style: none;
}

.woocommerce-tabs ul.tabs li {
	margin: 0;
}

.woocommerce-tabs ul.tabs a {
	color: var(--ilx-color-muted);
	font-size: var(--ilx-text-xs);
	font-weight: var(--ilx-weight-semibold);
	letter-spacing: var(--ilx-tracking-label);
	text-decoration: none;
	text-transform: uppercase;
}

.woocommerce-tabs ul.tabs li.active a {
	color: var(--ilx-color-ink);
}

.related > h2,
.up-sells > h2,
.cross-sells > h2 {
	margin-bottom: var(--ilx-space-md);
	font-size: var(--ilx-text-h3);
}

/* -------------------------------------------------------------------------
 * Custom product fields (WC Fields Factory) — spacing only.
 *
 * The configurator's own markup and pricing logic are untouched; this just
 * keeps it from colliding with the add-to-cart form. Its real styling is a
 * later step.
 * ---------------------------------------------------------------------- */

.wcff-fields-group {
	width: 100%;
	margin-bottom: var(--ilx-space-md);
}

.wcff-fields-group table {
	font-size: var(--ilx-text-body);
}

.wcff-fields-group td,
.wcff-fields-group th {
	border-bottom: 0;
}

/* -------------------------------------------------------------------------
 * Cart, checkout, account
 * ---------------------------------------------------------------------- */

.woocommerce-cart-form table.shop_table,
.woocommerce-checkout-review-order table.shop_table,
.woocommerce-orders-table {
	border: var(--ilx-border-width) solid var(--ilx-color-line);
}

.woocommerce-cart-form table.shop_table th,
.woocommerce-checkout-review-order table.shop_table th {
	font-size: var(--ilx-text-xs);
	letter-spacing: var(--ilx-tracking-label);
	text-transform: uppercase;
}

.cart_totals h2,
.woocommerce-checkout h3,
.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3 {
	font-size: var(--ilx-text-h3);
}

.woocommerce-checkout .col2-set {
	display: grid;
	gap: var(--ilx-space-lg);
}

@media (min-width: 768px) {
	.woocommerce-checkout .col2-set {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.woocommerce form .form-row {
	margin-bottom: var(--ilx-space-sm);
}

#order_review,
.cart_totals {
	padding: var(--ilx-space-md);
	border: var(--ilx-border-width) solid var(--ilx-color-line);
	border-radius: var(--ilx-radius-md);
	background-color: var(--ilx-color-surface);
}

/* -------------------------------------------------------------------------
 * Messages
 * ---------------------------------------------------------------------- */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notice {
	margin: 0 0 var(--ilx-space-md);
	padding: var(--ilx-space-sm) var(--ilx-space-md);
	border-left: 2px solid var(--ilx-color-accent);
	border-radius: var(--ilx-radius-sm);
	background-color: var(--ilx-color-surface-alt);
	font-size: var(--ilx-text-small);
	list-style: none;
}

.woocommerce-message {
	border-left-color: var(--ilx-color-success);
	background-color: var(--ilx-color-success-soft);
}

.woocommerce-error {
	border-left-color: var(--ilx-color-sale);
	background-color: var(--ilx-color-sale-soft);
}

.woocommerce-message .button,
.woocommerce-info .button {
	margin-left: var(--ilx-space-sm);
}

/* Pagination */
.woocommerce-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ilx-space-2xs);
	margin: var(--ilx-space-xl) 0 0;
	padding: 0;
	list-style: none;
}

.woocommerce-pagination .page-numbers {
	display: inline-block;
	padding: var(--ilx-space-3xs) var(--ilx-space-2xs);
	text-decoration: none;
}

.woocommerce-pagination .current {
	color: var(--ilx-color-accent-strong);
	font-weight: var(--ilx-weight-semibold);
}

/* -------------------------------------------------------------------------
 * Overriding WooCommerce's own stylesheet
 *
 * WooCommerce ships rules like `.woocommerce a.button` and
 * `.woocommerce ul.products li.product { float: left; width: 22.05% }` which
 * outrank plain element selectors. These blocks exist purely to win that
 * specificity contest so the theme's buttons and grid actually apply; the
 * values themselves are the same tokens used everywhere else.
 * ---------------------------------------------------------------------- */

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	float: none;
	width: auto;
	margin: 0;
	clear: none;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
	content: none;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--ilx-space-2xs);
	padding: 0.9rem 1.75rem;
	border: var(--ilx-border-width) solid var(--ilx-color-ink);
	border-radius: var(--ilx-radius-sm);
	background-color: var(--ilx-color-ink);
	color: var(--ilx-color-on-dark);
	font-size: var(--ilx-button-size);
	font-weight: var(--ilx-weight-medium);
	letter-spacing: var(--ilx-tracking-label);
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color var(--ilx-transition), border-color var(--ilx-transition),
		color var(--ilx-transition);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce #respond input#submit:hover {
	border-color: var(--ilx-color-accent-strong);
	background-color: var(--ilx-color-accent-strong);
	color: var(--ilx-color-on-dark);
}

.woocommerce a.button.loading::after,
.woocommerce button.button.loading::after {
	margin-left: 0.35rem;
}

/* Loop "add to cart" is a secondary action next to the product itself. */
.woocommerce ul.products li.product a.button {
	padding: 0.65rem 1.15rem;
	border-color: var(--ilx-color-line-strong);
	background-color: transparent;
	color: var(--ilx-color-ink);
	font-size: var(--ilx-text-xs);
}

.woocommerce ul.products li.product a.button:hover {
	border-color: var(--ilx-color-ink);
	background-color: var(--ilx-color-ink);
	color: var(--ilx-color-on-dark);
}

.woocommerce ul.products li.product a.added_to_cart {
	display: inline-block;
	margin-top: var(--ilx-space-3xs);
	color: var(--ilx-color-accent-strong);
	font-size: var(--ilx-text-xs);
	letter-spacing: var(--ilx-tracking-nav);
	text-transform: uppercase;
}

/* The sale flash renders on the same hook as the thumbnail, so it lands inside
 * the media frame; pin it to the frame's corner as a small chip. */
.woocommerce ul.products li.product {
	position: relative;
}

.woocommerce ul.products li.product .ilx-loop-media .onsale,
.woocommerce ul.products li.product .onsale,
.woocommerce span.onsale {
	position: absolute;
	top: var(--ilx-space-2xs);
	left: var(--ilx-space-2xs);
	right: auto;
	bottom: auto;
	z-index: 2;
	margin: 0;
	min-height: 0;
	min-width: 0;
	width: auto;
	padding: 0.3rem 0.55rem;
	border-radius: var(--ilx-radius-sm);
	background-color: var(--ilx-color-sale);
	color: #fff;
	font-size: 0.625rem;
	font-weight: var(--ilx-weight-semibold);
	letter-spacing: var(--ilx-tracking-label);
	line-height: 1;
	text-transform: uppercase;
}

.woocommerce div.product span.onsale {
	position: static;
	display: inline-block;
	margin-bottom: var(--ilx-space-2xs);
}

/* Forms */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce .select2-container .select2-selection--single {
	width: 100%;
	height: auto;
	min-height: 2.9rem;
	padding: 0.7rem 0.85rem;
	border: var(--ilx-border-width) solid var(--ilx-color-line-strong);
	border-radius: var(--ilx-radius-sm);
	background-color: var(--ilx-color-surface);
	color: var(--ilx-color-text);
	line-height: 1.4;
}

.woocommerce .select2-container .select2-selection--single .select2-selection__rendered {
	padding: 0;
	line-height: 1.5;
}

.woocommerce .select2-container .select2-selection--single .select2-selection__arrow {
	top: 50%;
	right: 0.5rem;
	transform: translateY(-50%);
}

/* Messages: WooCommerce's own styling is heavier than the theme's. */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error,
.woocommerce-page .woocommerce-message,
.woocommerce-page .woocommerce-info,
.woocommerce-page .woocommerce-error {
	padding: var(--ilx-space-sm) var(--ilx-space-md);
	border-top: 0;
	border-right: 0;
	border-bottom: 0;
	border-left: 2px solid var(--ilx-color-accent);
	background-color: var(--ilx-color-surface-alt);
	color: var(--ilx-color-text);
	font-size: var(--ilx-text-small);
}

.woocommerce .woocommerce-message::before,
.woocommerce .woocommerce-info::before,
.woocommerce .woocommerce-error::before {
	content: none;
}

.woocommerce .woocommerce-message {
	border-left-color: var(--ilx-color-success);
	background-color: var(--ilx-color-success-soft);
}

.woocommerce .woocommerce-error {
	border-left-color: var(--ilx-color-sale);
	background-color: var(--ilx-color-sale-soft);
}

/* Ordering / result count sit on one line above the grid. */
.woocommerce .woocommerce-result-count {
	float: none;
	margin: 0;
}

.woocommerce .woocommerce-ordering {
	float: none;
	margin: 0;
}

.woocommerce .ilx-shop-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--ilx-space-2xs) var(--ilx-space-md);
	margin-bottom: var(--ilx-space-lg);
	padding-bottom: var(--ilx-space-sm);
	border-bottom: var(--ilx-border-width) solid var(--ilx-color-line);
}

/* Pagination */
.woocommerce nav.woocommerce-pagination ul {
	border: 0;
	gap: var(--ilx-space-3xs);
}

.woocommerce nav.woocommerce-pagination ul li {
	border: 0;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
	padding: 0.4rem 0.7rem;
	border: var(--ilx-border-width) solid transparent;
	border-radius: var(--ilx-radius-sm);
	color: var(--ilx-color-muted);
	font-size: var(--ilx-text-small);
}

.woocommerce nav.woocommerce-pagination ul li a:hover {
	background-color: var(--ilx-color-surface-alt);
	color: var(--ilx-color-ink);
}

.woocommerce nav.woocommerce-pagination ul li span.current {
	border-color: var(--ilx-color-ink);
	background: transparent;
	color: var(--ilx-color-ink);
	font-weight: var(--ilx-weight-semibold);
}

/* -------------------------------------------------------------------------
 * Category description
 *
 * Clamped by default so the catalogue is not pushed off-screen. The full text
 * stays in the DOM; only its height is limited. Without JavaScript the clamp is
 * never applied, so nothing is hidden from a reader or a crawler.
 * ---------------------------------------------------------------------- */

.ilx-archive-intro {
	max-width: var(--ilx-container-narrow);
	margin-bottom: var(--ilx-space-md);
	color: var(--ilx-color-muted);
	font-size: var(--ilx-text-small);
	line-height: var(--ilx-leading-relaxed);
}

.ilx-archive-intro .term-description > *:first-child {
	margin-top: 0;
}

.ilx-archive-intro.is-collapsible {
	position: relative;
}

.ilx-archive-intro.is-collapsed .term-description {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ilx-archive-intro__toggle {
	margin-top: var(--ilx-space-2xs);
	padding: 0;
	border: 0;
	border-bottom: 1px solid var(--ilx-color-line-strong);
	border-radius: 0;
	background: transparent;
	color: var(--ilx-color-ink);
	font-size: var(--ilx-text-xs);
	font-weight: var(--ilx-weight-semibold);
	letter-spacing: var(--ilx-tracking-label);
	text-transform: uppercase;
	cursor: pointer;
}

.ilx-archive-intro__toggle:hover {
	border-bottom-color: var(--ilx-color-accent);
	background: transparent;
	color: var(--ilx-color-accent-strong);
}

/* -------------------------------------------------------------------------
 * Legacy content safety
 *
 * Product descriptions still hold WPBakery markup, and some contain tables laid
 * out for a much wider column. A table wider than its parent expands the page,
 * not itself — on a phone that dragged the whole document sideways. Confine the
 * scrolling to the content block so the page stays put.
 * ---------------------------------------------------------------------- */

.woocommerce-Tabs-panel,
.woocommerce-product-details__short-description,
.ilx-entry-content .wpb_wrapper,
.wpb_text_column .wpb_wrapper {
	max-width: 100%;
	overflow-x: auto;
	overscroll-behavior-x: contain;
}

.woocommerce-Tabs-panel table,
.wpb_wrapper table {
	min-width: 0;
}

.wpb_wrapper img {
	height: auto;
}
