/**
 * Wine catalog — product page, tier pills & vintage dropdown.
 *
 * PLACEHOLDER STYLING. The final tier-pill treatment, the vintage-dropdown
 * states, and the two-controls-in-one-header layout are pending design sign-off
 * (see DESIGN.md §1–§2). These rules are intentionally neutral and easy to
 * restyle once the product-page header comp is approved — structure first.
 */

/* =========================================================================
 * GLOBAL: smooth scroll (Lenis) + brand gold scrollbar
 * Approach A from SMOOTH-SCROLL-SETUP.md — Lenis eases the real window scroll
 * and we restyle the native scrollbar gold (no separate scrollbar library).
 * Loaded site-wide because wine.css is enqueued on every page.
 * ====================================================================== */
html { scrollbar-width: thin; scrollbar-color: #ae8e4d transparent; } /* Firefox */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ae8e4d; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #c2a35e; }
/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---- Brand tokens ---- */
:root {
	--wine-gold: #ae8e4d;
	--wine-navy: #0c2739;
	--wine-cream: #f4efe6;
	--wine-ink: #1f2226;
}

/* ---- Layout primitives ---- */
.wine-single .container { max-width: 1180px; margin: 0 auto; padding: 0 32px; }

/* ---- Hero ---- */
.wine-hero {
	position: relative;
	background: var(--wine-cream);
	padding: 96px 0 88px;
	overflow: hidden;
}
/* Full-bleed scene hero: the wine's image is the background, text overlaid. */
.wine-hero--bg {
	background-size: cover;
	background-position: center right;
	background-repeat: no-repeat;
	min-height: 66vh;
	display: flex;
	align-items: center;
	padding: 64px 0;
}
/* Cream wash on the left so the overlaid copy stays legible over any crop. */
.wine-hero--bg::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, var(--wine-cream) 0%, rgba(244,239,230,0.85) 28%, rgba(244,239,230,0.35) 48%, rgba(244,239,230,0) 64%);
	pointer-events: none;
}
.wine-hero--bg .container { width: 100%; }
.wine-hero-badge {
	position: absolute;
	top: 40px;
	left: 40px;
	width: 92px;
	z-index: 2;
	border-bottom: none;
}
.wine-hero-badge img { display: block; width: 100%; height: auto; }
.wine-hero-detail { position: relative; z-index: 1; max-width: 440px; }

/* ---- Hero typography ---- */
.wine-eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	text-transform: uppercase;
	letter-spacing: 0.22em;
	font-size: 12px;
	font-weight: 600;
	color: var(--wine-ink);
	margin: 0 0 14px;
}
.wine-eyebrow::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--wine-gold);
	flex: none;
}
.wine-eyebrow-tier::before { content: "·"; margin: 0 8px; }
.wine-title {
	font-family: 'Lora', Georgia, serif;
	font-size: clamp(40px, 5vw, 64px);
	line-height: 1.05;
	color: var(--wine-navy);
	margin: 0 0 22px;
}
.wine-hero-lead { font-size: 16px; line-height: 1.7; color: var(--wine-ink); }
.wine-hero-lead p { margin: 0 0 14px; }
.wine-hero-lead p:last-child { margin-bottom: 0; }

/* Generic intro (wines hub head + landing fallback) */
.wine-intro { font-size: 16px; line-height: 1.7; }

/* ---- Hero selectors: Reserve (tier) picker + Vintage selector ---- */
.wine-selectors {
	display: flex;
	flex-wrap: wrap;
	gap: 28px 40px;
	margin-top: 36px;
}
.wine-selector { display: flex; flex-direction: column; gap: 8px; }
.wine-selector-label {
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-size: 11px;
	font-weight: 600;
	color: var(--wine-gold);
}

/* Tier pills — opaque pill group so labels stay readable over the bottle image */
.wine-tier-pills {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	border: 1px solid rgba(174,142,77,0.4);
	border-radius: 999px;
	background: rgba(255,255,255,0.92);
	box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.wine-pill {
	display: inline-block;
	padding: 8px 20px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wine-navy);
	border-bottom: none;
	transition: background 0.15s ease, color 0.15s ease;
}
/* Force a readable hover state — the theme's global `a:hover{color:white}`
   would otherwise wash the pill text out against the light hover background. */
.wine-pill:hover,
.wine-pill:focus { background: rgba(174,142,77,0.18); color: var(--wine-navy); }
.wine-pill.is-active,
.wine-pill.is-active:hover,
.wine-pill.is-active:focus { background: var(--wine-gold); color: #fff; }

/* Vintage dropdown */
.wine-vintage-select { position: relative; display: inline-flex; align-items: center; }
.wine-vintage-dropdown {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding: 9px 40px 9px 16px;
	/* Match the tier tabs: same (sans) font, weight, size, uppercase tracking. */
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wine-navy);
	border: 1px solid rgba(174,142,77,0.5);
	border-radius: 999px;
	background: rgba(255,255,255,0.92);
	box-shadow: 0 6px 20px rgba(0,0,0,0.08);
	cursor: pointer;
}
.wine-vintage-select::after {
	content: "";
	position: absolute;
	right: 16px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--wine-gold);
	border-bottom: 2px solid var(--wine-gold);
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

/* ---- About / Our Wines ---- */
.wine-about { padding: 84px 0 96px; background: #fff; }
.wine-about-head { margin-bottom: 48px; }
.wine-section-eyebrow {
	display: flex;
	align-items: center;
	gap: 14px;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	font-size: 12px;
	font-weight: 600;
	color: var(--wine-gold);
	margin: 0 0 14px;
}
.wine-section-num { position: relative; padding-right: 14px; }
.wine-section-num::after {
	content: "";
	position: absolute;
	right: -2px;
	top: 50%;
	width: 28px;
	height: 1px;
	background: var(--wine-gold);
}
.wine-about-title {
	font-family: 'Lora', Georgia, serif;
	font-size: clamp(28px, 3.4vw, 44px);
	line-height: 1.1;
	color: var(--wine-navy);
	margin: 0;
}

.wine-about-layout {
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: 56px;
	align-items: start;
}
.wine-about-features {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 40px 36px;
}
.wine-feature-icon {
	display: inline-flex;
	font-size: 26px;
	color: var(--wine-gold);
	margin-bottom: 14px;
}
.wine-feature-label {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 12px;
	font-weight: 700;
	color: var(--wine-navy);
	margin: 0 0 10px;
}
.wine-feature-body { font-size: 14px; line-height: 1.7; color: var(--wine-ink); }
.wine-feature-body p { margin: 0 0 8px; }
.wine-feature-body p:last-child { margin-bottom: 0; }

/* Analysis as a compact label/value list */
.wine-analysis-list { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 1.6; }
.wine-analysis-list li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 5px 0;
	border-bottom: 1px solid rgba(0,0,0,0.07);
}
.wine-analysis-list li:last-child { border-bottom: none; }
.wine-analysis-k { color: var(--wine-ink); }
.wine-analysis-v { color: var(--wine-navy); font-weight: 600; white-space: nowrap; }

/* Douro location map */
.wine-about-map { position: relative; }
.wine-about-map img { width: 100%; height: auto; opacity: 0.85; }
.wine-about-map-pin {
	position: absolute;
	top: 38%;
	right: 26%;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 10px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--wine-navy);
}
.wine-about-map-pin .icon { color: var(--wine-gold); font-size: 14px; }

/* Spec-sheet download link */
.wine-spec-sheet { margin: 48px 0 0; }
.wine-spec-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	font-size: 12px;
	font-weight: 600;
	color: var(--wine-navy);
	text-decoration: none;
	border-bottom: 1px solid var(--wine-gold);
	padding-bottom: 6px;
	transition: color 0.15s ease;
}
.wine-spec-link:hover { color: var(--wine-gold); }
.wine-spec-link .icon { font-size: 15px; color: var(--wine-gold); }

/* ---- Section headings reused by Other Wines ---- */
.wine-about-heading { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 700; margin: 0 0 10px; }

/* ---- Other wines (cross-sell to the other varietals) ---- */
.wine-other { background: var(--wine-cream); }
.wine-other-head { margin-bottom: 40px; }
.wine-other-head .flag { display: inline-flex; align-items: center; gap: 10px; justify-content: center; margin: 0 0 10px; }
.wine-other-head h2 { font-family: 'Lora', Georgia, serif; font-size: clamp(28px, 3.4vw, 44px); color: var(--wine-navy); margin: 0; }
.wine-other-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 48px;
}
.wine-other-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	width: 260px;
	max-width: 100%;
}
.wine-other-col .btn-line-img { display: block; border-bottom: none; }
.wine-other-col .product { max-height: 320px; width: auto; filter: drop-shadow(0 16px 28px rgba(0,0,0,0.14)); }

/* =========================================================================
 * Main-nav submenu dropdown (DESIGN §2.3)
 * Styles the submenu built by hand in Appearance → Menus — the nav is NOT
 * injected by the theme. Scoped with :not(.menu-item-gtranslate) so the
 * existing GTranslate "EN" language widget is left entirely alone.
 *
 * .wine-dd is the parent <li>; defined once here to keep the selectors short.
 * ====================================================================== */
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) { position: relative; }

/* A down-arrow caret to the right of a dropdown parent (e.g. "Wines").
 * Uses ::before (absolute) so the theme's ::after underline animation on
 * .nav-menu li a is untouched. currentColor = the white nav text. */
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > a {
	position: relative;
	padding-right: 18px;
}
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > a::before {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	margin-top: -2px;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	pointer-events: none;
}
/* Flip the caret up when the dropdown is open (hover / focus / mobile tap). */
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate):hover > a::before,
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate):focus-within > a::before,
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate).focus > a::before,
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate).is-open > a::before {
	border-top: 0;
	border-bottom: 5px solid currentColor;
}

/* Desktop: sub-menu is fully hidden with display:none (so it can never "peek"
 * below the bar) and shown on hover / keyboard focus / .focus (touch). */
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	margin: 0;
	padding: 8px 0;
	list-style: none;
	background: #0E2A47;
	box-shadow: 0 12px 28px rgba(0,0,0,0.18);
	z-index: 200;
}
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate):hover > .sub-menu,
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate):focus-within > .sub-menu,
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate).focus > .sub-menu,
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate).is-open > .sub-menu {
	display: block;
}
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > .sub-menu li { margin: 0; }
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > .sub-menu a {
	display: block;
	padding: 9px 20px;
	color: #fff;
	white-space: nowrap;
	text-decoration: none;
	border-bottom: none;
	letter-spacing: 0.04em;
}
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > .sub-menu a:hover,
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > .sub-menu a:focus { background: rgba(255,255,255,0.10); }

/* Kill the theme's animated white underline (.nav-menu li a::after) inside the
 * dropdown — child items use the background highlight above instead, so there
 * are no stray underline slivers bleeding out of the panel. */
.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > .sub-menu li a::after {
	display: none;
}

/* Mobile (matches the theme's overlay-menu breakpoint of 1024px — the gold
 * full-screen .nav-menu.down flex column). The submenu must drop the desktop
 * navy panel and instead flow inline + centered beneath the parent, like every
 * other item, expanding on tap. */
@media (max-width: 1024px) {
	/* The theme makes every .main-navigation li a flex ROW (justify-content:
	 * center), which puts the submenu beside the label. Flip the dropdown parent
	 * to a COLUMN so "Wines" stacks above its varietals in the overlay menu. */
	.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) {
		flex-direction: column;
		align-items: center;
	}
	.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > .sub-menu {
		position: static;
		min-width: 0;
		padding: 0;
		margin: 4px 0 8px;
		background: transparent;
		box-shadow: none;
		text-align: center;
	}
	.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > .sub-menu a {
		text-align: center;
		padding: 4px 0;
		font-size: 30px;            /* a step down from the 45px top level */
		text-transform: capitalize; /* match the theme's mobile item styling */
	}
	.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > .sub-menu a:hover,
	.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > .sub-menu a:focus {
		background: transparent;    /* no highlight bar in the overlay menu */
	}
	/* Caret sits inline next to the centered parent label on mobile. */
	.main-navigation .menu-item-has-children:not(.menu-item-gtranslate) > a {
		display: inline-block;
		padding-right: 22px;
	}

	/* Language picker (GTranslate): same flex-row issue — stack the EN/PT box
	 * beneath the "EN" label and centre it, instead of floating to its right.
	 * Theme it to blend into the gold overlay (drop the light box + dark text). */
	.main-navigation .menu-item-gtranslate {
		flex-direction: column;
		align-items: center;
	}
	.main-navigation .menu-item-gtranslate .dropdown-menu.sub-menu {
		position: static;
		margin: 8px auto 0;
		padding: 0;
		border: none;
		background: transparent;
		align-items: center;
	}
	.main-navigation .menu-item-gtranslate .dropdown-menu.sub-menu li a {
		color: #fff;
		font-family: var(--primary-font);
		font-size: 30px;
		text-transform: capitalize;
	}
}

/* =========================================================================
 * Wines hub (4-up grid)
 * ====================================================================== */
.wines-hub { padding: 56px 0 72px; }
.wines-hub .container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.wines-hub-head { text-align: center; margin-bottom: 40px; }
.wines-hub-head .wine-intro { max-width: 640px; margin: 16px auto 0; }
.wines-hub-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 28px;
}
/* Re-balance when fewer varietals exist. */
.wines-hub-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.wines-hub-grid[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.wines-hub-tile {
	display: block;
	text-align: center;
	text-decoration: none;
	color: inherit;
	border-bottom: none;
	padding: 24px 12px;
	transition: transform 0.18s ease;
}
.wines-hub-tile:hover { transform: translateY(-4px); }
.wines-hub-tile-bottle { min-height: 280px; display: flex; align-items: flex-end; justify-content: center; }
.wines-hub-tile-bottle img { max-height: 300px; width: auto; }
.wines-hub-tile-name {
	display: block;
	margin-top: 16px;
	font-family: 'Lora', Georgia, serif;
	font-size: 20px;
	letter-spacing: 0.02em;
}

@media (max-width: 880px) {
	.wines-hub-grid,
	.wines-hub-grid[data-count="3"],
	.wines-hub-grid[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
	.wines-hub-grid,
	.wines-hub-grid[data-count="3"],
	.wines-hub-grid[data-count="2"] { grid-template-columns: 1fr; }
}

/* ---- Product page responsive ---- */
@media (max-width: 980px) {
	.wine-about-layout { grid-template-columns: 1fr; gap: 40px; }
	.wine-about-map { max-width: 360px; }
}
@media (max-width: 880px) {
	/* Full-screen bottle + background hero on mobile; the gold nav drops below the
	   fold instead of overlapping the copy. (.fma-image-100 is already 100vh; we
	   just lift the .max-ht-90 cap so the section fills the screen.) */
	.wine-fma-hero.min-ht-700 { min-height: 100vh; }
	.wine-fma-hero.max-ht-90 { max-height: 100vh; }
	/* Pin the nav's resting overlap to a FIXED 72px (instead of translateY(-80%)
	   of an unknown height) so the tabs can sit an exact 10px above it. Scoped to
	   wine pages, and only in the resting state — the scrolled/open menu (.down)
	   keeps the theme's own positioning. */
	.type-wine .site-header:not(.down) { transform: none; }
	.type-wine .site-header:not(.down) .nav-container { transform: translateY(-72px); }
	/* Anchor the copy + tabs so the pills land 10px above the nav (72 + 10). */
	.wine-fma-hero .fma-text-overlay { top: auto; bottom: 82px; }
	.wine-selectors { justify-content: center; width: 100%; }
	.wine-selector { align-items: center; }
	/* On mobile drop the outer pill-bar background/stroke and give each pill its
	   own chip background. Keep all three on one line by shrinking them. */
	.wine-tier-pills {
		flex-wrap: nowrap;
		justify-content: center;
		gap: 7px;
		padding: 0;
		border: none;
		background: transparent;
		box-shadow: none;
	}
	.wine-tier-pills .wine-pill {
		padding: 8px 12px;
		font-size: 14px;
		letter-spacing: 0.03em;
		white-space: nowrap;
		background: rgba(255,255,255,0.92);
		box-shadow: 0 4px 14px rgba(0,0,0,0.10);
	}
	.wine-tier-pills .wine-pill.is-active { background: var(--wine-gold); }
	/* Match the vintage dropdown to the pill chips so it doesn't look small/out of
	   place when it's the only selector (e.g. Rosé, which has no tiers). */
	.wine-vintage-dropdown {
		font-size: 14px;
		font-weight: 600;
		border-color: transparent;
		padding: 10px 42px 10px 20px;
	}
	.wine-about { padding: 56px 0 64px; }
	.wine-about-features { grid-template-columns: repeat(2, 1fr); gap: 32px 28px; }
	.wine-other-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
	.wine-about-features { grid-template-columns: 1fr; }
}

/* =========================================================================
 * Footer menu — Wines varietals
 * The footer uses the same menu (assigned to Primary + Footer). The theme lays
 * each .menu-item as a flex ROW, which floats the Wines submenu to the right of
 * the label. Stack it as a small centered list beneath "Wines" instead.
 * ====================================================================== */
#footer-menu .menu-item-has-children {
	flex-direction: column;
}
#footer-menu .menu-item-has-children > .sub-menu {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: 6px;
	padding: 0;
	list-style: none;
	background: transparent;
}
#footer-menu .menu-item-has-children > .sub-menu .menu-item {
	padding: 3px 0;
}
#footer-menu .menu-item-has-children > .sub-menu a,
#footer-menu .menu-item-has-children > .sub-menu a:visited {
	font-size: 12px;
	font-weight: 500;
	opacity: 0.85;
}
