/**
 * TrueForm — responsive layer (phones, tablets, desktops).
 * Loaded after Astra; complements Additional CSS from apply-theme.sh.
 */

/* ─── Header: site identity ─────────────────────────────────────── */
/*
 * Astra HFB wraps the logo in .site-logo-img; the text title lives in .ast-site-title-wrap
 * (not a sibling of .custom-logo-link), so .custom-logo-link ~ .site-title never matched.
 */
.site-branding.ast-site-identity .site-logo-img + .ast-site-title-wrap {
	display: none !important;
}

/* ─── Fluid media (Elementor + content) ───────────────────────── */
.site-content img,
.site-content video,
.site-content svg:not(:root),
.elementor img,
.elementor video,
.elementor-widget-container iframe {
	max-width: 100%;
	height: auto;
}

/* Neutralize Astra shell tint so homepage sections don't read as blue */
body,
#page,
#content.site-content,
.site-content,
#primary,
#main,
.ast-container,
.ast-container-fluid {
	background-color: #ffffff !important;
	background-image: none !important;
}

/* Hero: white like category cards; strip gradients from Additional CSS / cache */
.compound-hero {
	background-color: #ffffff !important;
	background-image: none !important;
}
.compound-hero::before,
.compound-hero::after {
	display: none !important;
}

/* Bottom CTA: same white surface as hero / category cards */
.compound-cta-section {
	background-color: #ffffff !important;
	background-image: none !important;
}
.compound-cta-section::before {
	display: none !important;
}

/* Subtle rounding on white homepage surfaces */
.compound-hero,
.compound-categories-section,
.compound-pillars-section,
.compound-cta-section,
.compound-cat-card,
.compound-pillars-grid,
.compound-pillar {
	border-radius: 12px !important;
}

.compound-hero,
.compound-pillars-section,
.compound-cta-section {
	overflow: hidden !important;
}

/* Homepage cleanup: remove old supplier note and smooth trust-pillars cards */
.compound-categories-section > .compound-subline {
	display: none !important;
}

.compound-pillars-grid {
	gap: 16px !important;
	background: transparent !important;
	box-shadow: none !important;
	align-items: stretch;
}

.compound-pillar {
	border: 1px solid #e4e7ef;
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
	border-radius: 12px !important;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.compound-pillar-title {
	line-height: 1.45;
}

.compound-pillar-body {
	line-height: 1.7;
}

/* Store notice: neutral strip (avoid bright blue #EFF6FF from older Additional CSS) */
p.demo_store,
.woocommerce-store-notice {
	background-color: #f8f9fc !important;
	background-image: none !important;
	border-bottom-color: #e4e7ef !important;
}

/* ─── Hero & homepage sections ──────────────────────────────── */
@media (max-width: 921px) {
	.compound-hero {
		min-height: min(88vh, 720px);
		padding: clamp(72px, 14vw, 120px) clamp(16px, 4vw, 24px);
	}

	.compound-eyebrow {
		letter-spacing: 0.18em !important;
		margin-bottom: 20px !important;
	}

	.compound-headline {
		margin-bottom: 24px !important;
	}

	.compound-subline {
		margin-bottom: 36px !important;
	}

	.compound-categories-section,
	.compound-pillars-section,
	.compound-cta-section {
		padding-left: clamp(16px, 4vw, 40px);
		padding-right: clamp(16px, 4vw, 40px);
	}

	.compound-categories-section {
		padding-top: 64px;
		padding-bottom: 64px;
	}

	.compound-pillars-section {
		padding-top: 64px;
		padding-bottom: 64px;
	}

	.compound-cta-section {
		padding-top: 80px;
		padding-bottom: 80px;
	}

	.compound-pillar {
		padding: 36px clamp(20px, 4vw, 40px);
	}

	.compound-pillars-grid {
		gap: 12px !important;
	}

	.compound-research-banner {
		padding: 22px clamp(16px, 4vw, 40px);
	}

	.ast-main-header-wrap {
		padding-left: clamp(12px, 3vw, 24px);
		padding-right: clamp(12px, 3vw, 24px);
	}
}

@media (max-width: 544px) {
	.compound-hero {
		min-height: auto;
		padding-top: max(88px, env(safe-area-inset-top, 0px));
		padding-bottom: 56px;
	}

	.compound-hero-actions {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		max-width: 360px;
		margin-left: auto;
		margin-right: auto;
		gap: 12px;
	}

	.compound-btn-primary,
	.compound-btn-secondary {
		display: flex !important;
		align-items: center;
		justify-content: center;
		min-height: 48px;
		width: 100%;
		text-align: center;
		padding-left: 20px;
		padding-right: 20px;
		box-sizing: border-box;
	}

	.compound-cat-card {
		padding: 28px 20px;
	}

	.compound-page-content {
		margin-top: 32px;
		margin-bottom: 40px;
		padding-left: clamp(14px, 4vw, 24px);
		padding-right: clamp(14px, 4vw, 24px);
	}

	.woocommerce-order-received .woocommerce-order {
		padding: 20px clamp(14px, 4vw, 24px);
	}

	.woocommerce-tabs .panel {
		padding: 20px clamp(14px, 4vw, 24px) !important;
	}

	.woocommerce-tabs ul.tabs li a {
		padding: 12px 14px !important;
		font-size: 0.68rem !important;
	}
}

/* ─── WooCommerce: horizontal scroll on small carts ─────────── */
@media (max-width: 600px) {
	.woocommerce table.shop_table_responsive,
	.woocommerce-page table.shop_table_responsive {
		display: block;
		width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
}

/* ─── Shop: single column on very narrow phones ─────────────── */
@media (max-width: 420px) {
	.woocommerce ul.products[class*="columns-"] {
		margin-left: 0;
		margin-right: 0;
	}

	.woocommerce-page ul.products li.product {
		width: 100% !important;
		max-width: 100%;
		float: none;
	}
}

/* ─── Respect reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	body {
		animation: none !important;
	}

	.compound-btn-primary:hover,
	.compound-btn-secondary:hover,
	.compound-footer-policy-panel a:hover,
	.woocommerce ul.products li.product:hover {
		transform: none !important;
	}
}

/* Local vs supplier/out-of-stock badges */
.woocommerce div.product .stock.in-stock.compound-stock-local {
	color: #16a34a !important;
	background: rgba(22, 163, 74, 0.08);
	border-color: rgba(22, 163, 74, 0.2);
}

.woocommerce div.product .stock.in-stock.compound-stock-supplier {
	color: #2563eb !important;
	background: rgba(37, 99, 235, 0.1);
	border-color: rgba(37, 99, 235, 0.2);
}

.woocommerce ul.products li.product.compound-product-stock-supplier .woocommerce-loop-product__title::before {
	background: #2563eb;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.woocommerce div.product .stock.out-of-stock.compound-stock-out {
	color: #dc2626 !important;
	background: rgba(220, 38, 38, 0.08);
	border-color: rgba(220, 38, 38, 0.2);
}

.woocommerce ul.products li.product.compound-product-stock-out .woocommerce-loop-product__title::before {
	background: #dc2626;
	box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* Shop product search */
.compound-shop-search-wrap {
	max-width: 1100px;
	margin: 20px auto 28px;
	padding: 0 12px;
}

.compound-shop-search-wrap .woocommerce-product-search {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.compound-shop-search-wrap .search-field {
	flex: 1 1 260px;
	min-height: 46px;
	border: 1px solid #d7dde9;
	border-radius: 10px;
	padding: 10px 14px;
	background: #fff;
}

.compound-shop-search-wrap button[type='submit'] {
	min-height: 46px;
	border-radius: 10px;
	padding: 10px 18px;
}

/* Shop card polish: prevent hover overlay collisions */
.woocommerce ul.products li.product .ast-loop-product__link::after,
.woocommerce ul.products li.product .woocommerce-loop-product__link::after {
	content: none !important;
}

.woocommerce ul.products li.product:hover .ast-loop-product__link img,
.woocommerce ul.products li.product:hover .woocommerce-loop-product__link img {
	transform: none !important;
}

.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover {
	transform: translateY(-2px);
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
.woocommerce ul.products li.product .astra-shop-summary-wrap,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .price {
	position: relative;
}

/* ─── Shop grid: single summary column + stock-dot alignment (Strategy B) ─── */
.woocommerce ul.products li.product {
	--compound-shop-dot-size: 6px;
	--compound-shop-dot-gap: 8px;
	--compound-shop-text-gutter: calc(var(--compound-shop-dot-size) + var(--compound-shop-dot-gap));
}

.woocommerce ul.products li.product .astra-shop-summary-wrap {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	padding: 12px 20px 0;
	gap: 8px;
}

.woocommerce ul.products li.product .astra-shop-summary-wrap .ast-woo-product-category,
.woocommerce ul.products li.product .astra-shop-summary-wrap .woocommerce-loop-product__title,
.woocommerce ul.products li.product .astra-shop-summary-wrap .price {
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0;
	margin-right: 0;
}

.woocommerce ul.products li.product .astra-shop-summary-wrap .ast-woo-product-category,
.woocommerce ul.products li.product .astra-shop-summary-wrap .price {
	padding-left: var(--compound-shop-text-gutter) !important;
}

.woocommerce ul.products li.product .astra-shop-summary-wrap .woocommerce-loop-product__title {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	display: flex;
	align-items: flex-start;
	gap: var(--compound-shop-dot-gap);
	line-height: 1.35;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title::before {
	flex-shrink: 0;
	margin-right: 0 !important;
	margin-bottom: 0 !important;
	vertical-align: unset !important;
	align-self: flex-start;
	margin-top: 0.28em;
}

.woocommerce ul.products li.product .astra-shop-summary-wrap .ast-woo-product-category {
	letter-spacing: 0.07em;
	font-size: 0.72rem !important;
	line-height: 1.35;
	color: #64748b !important;
}

.woocommerce ul.products li.product .astra-shop-summary-wrap .price {
	font-size: 1.05rem !important;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.25;
}

/* Title rows with no painted stock dot: keep eyebrow + price flush with card inset */
.woocommerce ul.products li.product:not(.instock):not(.compound-product-stock-supplier):not(.compound-product-stock-out)
	.astra-shop-summary-wrap .ast-woo-product-category,
.woocommerce ul.products li.product:not(.instock):not(.compound-product-stock-supplier):not(.compound-product-stock-out)
	.astra-shop-summary-wrap .price {
	padding-left: 0 !important;
}

/*
 * Astra nests .ast-on-card-button inside .astra-shop-summary-wrap, so Customizer
 * rules targeting li.product > a.button never matched; add the same rhythm here.
 */
.woocommerce ul.products li.product .ast-on-card-button {
	position: static !important;
	display: block;
	clear: both;
	margin: 0 0 18px !important;
	width: 100% !important;
	max-width: 100%;
	left: auto !important;
	right: auto !important;
	bottom: auto !important;
	box-sizing: border-box;
	text-align: center;
}

/* Fallback if Astra forces absolute on-card CTA in some card states. */
.woocommerce ul.products li.product .astra-shop-summary-wrap .ast-on-card-button {
	left: 0 !important;
	right: 0 !important;
	width: auto !important;
	max-width: none;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/*
 * Hard fallback: target the real Woo loop CTA anchor classes too, in case the
 * active theme state does not include .ast-on-card-button on the clickable node.
 */
.woocommerce ul.products li.product .astra-shop-summary-wrap a.button.add_to_cart_button,
.woocommerce ul.products li.product .astra-shop-summary-wrap a.button.product_type_simple,
.woocommerce ul.products li.product .astra-shop-summary-wrap a.button.product_type_variable,
.woocommerce ul.products li.product .astra-shop-summary-wrap a.added_to_cart.wc-forward {
	position: static !important;
	display: block !important;
	clear: both;
	left: auto !important;
	right: auto !important;
	width: 100% !important;
	max-width: 100%;
	margin: 0 0 18px !important;
	box-sizing: border-box !important;
}

/*
 * Astra shows Add to cart twice on archive cards: a thumbnail hover/toolbar control
 * (bag icon) plus the bottom .ast-on-card-button. Keep the bottom CTA only.
 */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap a.add_to_cart_button,
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap button.add_to_cart_button,
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .add_to_cart_button {
	display: none !important;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .show-on-hover a.add_to_cart_button,
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .show-on-hover button.add_to_cart_button {
	display: none !important;
}

/* ─── Footer policy shortcut buttons (narrow screens) ─────────── */
@media (max-width: 782px) {
	.compound-footer-policy-panel {
		justify-content: center;
	}

	.compound-footer-policy-panel a {
		flex: 1 1 calc(50% - 8px);
		min-width: 140px;
	}
}

@media (max-width: 480px) {
	.compound-footer-policy-panel {
		flex-direction: column;
		align-items: stretch;
	}

	.compound-footer-policy-panel a {
		flex: 1 1 auto;
		width: 100%;
		min-width: 0;
	}
}
