/**
 * Luxico live compatibility repair.
 * Narrow overrides only; no design-system duplication.
 */

/* The block layout utility has greater specificity than the theme's desktop
   media rule, which leaves the mobile action bar visible on wide screens. */
@media (min-width: 900px) {
	body .luxico-mobile-bar,
	body .wp-block-group.luxico-mobile-bar {
		display: none !important;
	}
}

@media (max-width: 899px) {
	body .luxico-mobile-bar,
	body .wp-block-group.luxico-mobile-bar {
		display: flex !important;
	}
}

/* The deployed layout-hotfix switches the archive to auto-fill but does not
   clear the theme's 5/7-column editorial spans. It also stretches the tiny
   logo inside photography-pending placeholders to the full product width. */
.woocommerce ul.products,
.woocommerce-page ul.products,
ul.products {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) !important;
	gap: clamp(16px, 2.5vw, 28px) !important;
}

@media (min-width: 520px) {
	.woocommerce ul.products,
	.woocommerce-page ul.products,
	ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (min-width: 900px) {
	.woocommerce ul.products,
	.woocommerce-page ul.products,
	ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}

.woocommerce ul.products > li.product,
.woocommerce-page ul.products > li.product,
ul.products > li.product {
	grid-column: auto !important;
	min-width: 0 !important;
	width: auto !important;
	max-width: 100% !important;
	overflow: hidden;
}

ul.products li.product .luxico-card__media,
ul.products li.product .luxico-card__body,
ul.products li.product .luxico-placeholder {
	min-width: 0;
}

.woocommerce ul.products li.product .luxico-placeholder img,
.woocommerce-page ul.products li.product .luxico-placeholder img,
ul.products li.product .luxico-placeholder img,
.woocommerce ul.products li.product .luxico-placeholder__logo,
.woocommerce-page ul.products li.product .luxico-placeholder__logo,
ul.products li.product .luxico-placeholder__logo {
	width: clamp(44px, 18%, 76px) !important;
	height: auto !important;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	max-width: 76px !important;
}

/* Let wide dynamic page blocks use the catalogue width instead of being
   trapped inside the 720px reading column. */
.luxico-page-content:has(> .luxico-latest-drop),
.luxico-page-content:has(> .luxico-rooms) {
	width: min(calc(100% - var(--luxico-gutter) - var(--luxico-gutter)), var(--luxico-max)) !important;
	max-width: var(--luxico-max) !important;
}

.luxico-page-content > .luxico-latest-drop,
.luxico-page-content > .luxico-rooms {
	width: 100% !important;
	max-width: none !important;
}

/* Keep the gallery and purchase summary together in the first desktop row.
   The evidence sections then span the page below instead of occupying the
   second grid column beside the product title. */
@media (min-width: 960px) {
	.luxico-product .product {
		grid-template-columns: minmax(0, 54fr) minmax(360px, 46fr) !important;
		align-items: start;
	}

	.luxico-product .product > .woocommerce-product-gallery {
		grid-column: 1;
		grid-row: 1;
	}

	.luxico-product .product > .summary,
	.luxico-product .product > .entry-summary {
		grid-column: 2;
		grid-row: 1;
	}

	.luxico-product .product > .luxico-product-sections,
	.luxico-product .product > .related,
	.luxico-product .product > .luxico-alternatives,
	.luxico-product .product > .up-sells {
		grid-column: 1 / -1 !important;
	}

	.luxico-product .luxico-gallery__stage {
		height: clamp(480px, 62vh, 640px);
		aspect-ratio: auto;
	}
}

/* Cart and checkout need a stable wide shell even when WooCommerce supplies a
   specialist block template. */
.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout {
	width: min(calc(100% - var(--luxico-gutter) - var(--luxico-gutter)), var(--luxico-max));
	max-width: var(--luxico-max) !important;
	margin-inline: auto !important;
}
