/* ============================================================
   PRODUCTS PAGE
   Extracted from the main style.css to cut unused CSS weight on
   every OTHER page - this file now loads ONLY on its own template,
   enqueued conditionally in functions.php. See that file's comment
   for the full explanation (PageSpeed Insights 'Reduce unused CSS'
   finding).
   ============================================================ */

/* ============================================================
   PRODUCTS PAGE
   ============================================================ */
.products-page { background: var(--white); }

/* Page width tokens for products */
.products-page { --products-max: 1440px; --products-pad: 40px; }
.products-page .container { max-width: var(--products-max); padding-inline: var(--products-pad); }

/* Intro band */
.products-hero { position: relative; background: linear-gradient(180deg, #EFF5F0 0%, #E7F0E9 100%); padding: 52px 0 0; text-align: center; overflow: visible; z-index: 4; }
.ph-wheat { position: absolute; bottom: 0px; width: 90px; height: auto; opacity: 0.3; z-index: 0; }
.ph-wheat-left  { left: 4%; }
.ph-wheat-right { right: 4%; transform: scaleX(-1); }
.products-hero .container { position: relative; z-index: 1; padding-bottom: 0px; }
.products-hero-btns { display: flex; gap: 16px; justify-content: center; margin-top: 32px; }
.ph-eyebrow { font-size: 18px; font-weight: 400; letter-spacing: 1.5px; color: var(--gold); margin-bottom: 12px; }
.ph-title { font-family: var(--font-heading); font-size: clamp(30px, 3.4vw, 35px); font-weight: 700; color: var(--text-dark); margin-bottom: 14px; }
.ph-title .text-green { color: var(--green-mid); }
.ph-desc { font-size: 18px; font-weight: 300; color: var(--text-body); max-width: 900px; margin: 0 auto; line-height: 1.7; }

/* Overlapping info cards */
.ph-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: -28px; transform: translateY(50%); position: relative; z-index: 20; }
.ph-card { display: flex; gap: 16px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 16px; padding: 24px; box-shadow: 0 14px 40px -16px rgba(12,40,24,0.22); text-align: left; transition: var(--transition); }
.ph-card:hover { box-shadow: 0 22px 54px -16px rgba(12,40,24,0.30); transform: translateY(-3px); }
.ph-card-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--green-pale); color: var(--green-mid); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ph-card-icon svg { width: auto; height: auto; }
.ph-card-tag { font-size: 15px; font-weight: 400; color: var(--green-mid); display: block; margin-bottom: 6px; }
.ph-card-body h3 { font-size: 20px; font-weight: 400; color: var(--text-dark); margin-bottom: 8px; }
.ph-card-body p { font-size: 15px; color: #69786D; line-height: 1.6; margin-bottom: 24px; }
.ph-card-body .btn-primary{ display: inline-flex; align-items: center; gap: 8px; background: var(--green-mid); color: #fff; border-radius: 50px; padding: 8px 18px; font-size: 16px; font-weight: 400; transition: var(--transition); }
.ph-card-body .btn-primary .btn-arrow{background: transparent}

/* Listing area */
.products-listing { position: relative; z-index: 1; padding: 160px 0 80px; background: var(--white); }
.products-layout { display: grid; grid-template-columns: 320px 1fr; gap: 36px; align-items: start; }

/* Sidebar */
/* min-width:0 on both grid items - without it, a track can still be forced wider
   than its column by content inside (the wrapping category/tag pills here), which
   is what was pushing the whole layout past the viewport into horizontal scroll
   once this collapsed to a single 1fr column on mobile. */
.products-sidebar {
	position: sticky;
	top: calc(var(--header-h) + 24px);
	min-width: 0;
	/* If the category list + promo card together are taller than the space
	   left below the sticky offset, the box scrolls internally instead of
	   pushing its top content off-screen and out of reach. */
	max-height: calc(100vh - var(--header-h) - 48px);
	overflow-y: auto;
	scrollbar-width: thin;
}
.products-main { min-width: 0; }
.ps-heading { font-size: 17px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--gray-500); margin-bottom: 16px; }
.ps-cats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.ps-cat { font-size: 15px; padding: 8px 16px; border-radius: 50px; border: 1px solid var(--gray-200); background: var(--white); color: var(--text-dark); transition: var(--transition); }
.ps-cat:hover, .ps-cat.is-active { background: var(--green-mid); border-color: var(--green-mid); color: #fff; }
.ps-promo { position: relative; overflow: hidden; background: var(--green-dark); background-image: url('images/product-sidebar-card-bg.svg'); background-position: top right; background-repeat: no-repeat; background-size: 120px; border-radius: 22px; padding: 28px 26px; color: #fff; }
.ps-promo-blob { position: absolute; top: -50px; right: -50px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,0.08); pointer-events: none; }
.ps-promo > * { position: relative; z-index: 1; }
.ps-promo-label { font-size: 11px; font-weight: 300; letter-spacing: 1.5px; text-transform: uppercase; color: #C7DD49; }
.ps-promo h4 { font-size: 23px; font-weight: 400; margin: 14px 0 12px; line-height: 1.2; color: #fff; }
.ps-promo p { font-size: 13.5px; color: #CFE0D2; line-height: 1.6; margin-bottom: 22px; }
.ps-promo-btn { display: inline-flex; align-items: center; gap: 14px; background: #EDF6EE; color: #184E2E; border-radius: 50px; padding: 7px 7px 7px 22px; font-size: 16px; font-weight: 400; transition: var(--transition); }
.ps-promo-btn:hover { background: var(--green-pale); }
.ps-promo-btn-arrow { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green-mid); color: #fff; flex-shrink: 0; }
.ps-promo-btn-arrow svg { width: 16px; height: 16px; }
.ps-promo-btn:hover .ps-promo-btn-arrow { background: var(--green); }

/* Toolbar */
.products-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.products-count { font-size: 22px; color: var(--green-mid); }
.products-count strong { color: var(--green-mid); font-weight: 700; }
.products-sort select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	font-size: 15px;
	font-weight: 500;
	padding: 9px 38px 9px 18px;
	border: 1px solid var(--gray-200);
	border-radius: 50px;
	background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238A8A8A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
	color: var(--text-dark);
	cursor: pointer;
	transition: var(--transition);
}
.products-sort select:hover  { border-color: var(--green-mid); }
.products-sort select:focus  { outline: none; border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(28,138,89,0.15); }

/* Product rows */
.product-rows { display: flex; flex-direction: column; gap: 22px; }
.product-row { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: stretch; background: var(--white); border: 1px solid var(--gray-200); border-radius: 18px; padding: 14px; box-shadow: 0 10px 34px -18px rgba(12,40,24,0.20); transition: var(--transition); overflow: hidden; }
.product-row:hover { box-shadow: 0 20px 48px -18px rgba(12,40,24,0.30); transform: translateY(-3px); }
/* min-width:0 overrides grid items' default min-width:auto - without it, a grid
   track can still be forced wider than its column by a long unwrapped line inside
   (e.g. a spec value or button), which is what was pushing the whole page into
   horizontal scroll on mobile once this collapsed to a single 1fr column. */
.product-row-img { position: relative; overflow: hidden; background: #EAF3EC; border-radius: 14px; display: flex; align-items: center; justify-content: center; padding: 20px; height: 100%; min-width: 0; }
.product-row-img img { height: 100%; width: 100%; object-fit: contain; }
.product-row-info { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.product-info-footer { padding-top: 12px; border-top: 1px solid #EBEBEB; }
.product-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.product-badge { display: inline-block; font-size: 11px; font-weight: 600; color: var(--green-mid); background: var(--white); border: 1px solid var(--green-mid); border-radius: 50px; padding: 4px 14px; }
.product-name { font-family: var(--font-heading); font-size: 24px; font-weight: 700; line-height:1.2; color: var(--text-dark); margin-bottom: 4px; }
.product-sub { font-size: 15.5px; font-weight:300; color: var(--gray-500); margin-bottom: 1px; }
.product-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; padding-top: 22px; margin-bottom: 12px; }
.product-spec { display: flex; gap: 10px; margin-bottom: 20px ; }
.product-spec-full { grid-column: 1 / -1; }
.spec-icon { width: 38px; height: 38px; border-radius: 8px; background: var(--green-pale); color: var(--green-mid); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.spec-icon svg { width: 18px; height: 18px; }
.product-spec strong { display: block; font-size: 16px; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; }
.product-spec span { font-size: 15px; font-weight:300; color: #152A1C; line-height: 1.3;  }
.product-skus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.skus-label { font-size: 16px; color: #69786D; margin-right: 4px; }
.sku-pill { font-size: 13px; font-weight: 700; color: #3A4A3F; background: var(--white); border: 1px solid #E0EAE1; border-radius: 9px; padding: 10px 12px; }
.products-empty { text-align: center; font-size: 17px; color: var(--gray-500); padding: 60px 0; }
.sku-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 16px; color: var(--green-mid); background: #EEF6EF; border-radius: 9px; padding: 10px 12px; }
.sku-tag svg { width: 14px; height: 14px; }
.product-cta { margin-top: 2px; background: var(--green-mid); border-radius: 12px; padding: 12px 20px; display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 400; color: var(--white); transition: var(--transition); }
.product-cta .cta-check { width: 16px; height: 16px; }

/* Pagination */
.products-pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 40px; }
.products-pagination[hidden] { display: none; }
.pg-nums { display: flex; align-items: center; gap: 8px; }
.pg-link, .pg-num { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; color: var(--text-body); padding: 8px 14px; border-radius: 8px; border: 1px solid var(--gray-200); }
.pg-link svg { width: 16px; height: 16px; }
.pg-num { width: 38px; height: 38px; justify-content: center; padding: 0; }
.pg-num.is-active { background: var(--green-mid); border-color: var(--green-mid); color: #fff; }
.pg-link:hover, .pg-num:hover:not(.is-active) { border-color: var(--green-mid); color: var(--green-mid); }
.pg-link.is-disabled { opacity: 0.4; pointer-events: none; }

@media (max-width: 1024px) {
	.products-layout { grid-template-columns: 1fr; }
	.products-sidebar { position: static; }
	.ps-cats { margin-bottom: 0; flex-wrap: wrap; }
	.ps-promo { display: none; }
}
@media (max-width: 768px) {
	.products-page { --products-pad: 20px; }
	.ph-cards { grid-template-columns: 1fr; transform: translateY(36px); }
	.products-listing { padding: 90px 0 64px; }
	.product-row { grid-template-columns: 1fr; }
	.product-row-img { height: auto; aspect-ratio: auto; max-width: 310px; }
	.product-specs { grid-template-columns: 1fr; }
	.ph-wheat { width: 56px; opacity: 0.5; }
	.ph-card { flex-direction: column; }
}

