/**
 * futbol-mesa CSS — partial 8/8: 08-product. Single-product page (PDP) redesign.
 * Two-column layout (gallery + sticky buy-box), trust block restructure (3-stat row + WhatsApp pill),
 * product tabs underline styling, breadcrumb, gallery, and related products cards.
 * Load order is load-bearing (LRN-020/TSK-034): enqueued 01->08 in inc/assets.php,
 * before storefront-woocommerce. Do NOT reorder or move rules between partials. @package futbol-mesa
 */

/* ============================================================================
   SINGLE-PRODUCT PAGE LAYOUT: two-column grid (gallery + sticky buy-box)
   ============================================================================ */

/* Desktop: gallery (left, 1fr) + sticky buy-box (right, ~380px) in a grid layout.
   Mobile (≤900px): stack to single column, gallery first then buy-box.
   The .product wrapper (Storefront default) has FIVE direct children, not just
   the gallery/buy-box pair: .woocommerce-product-gallery, .summary.entry-summary,
   .woocommerce-tabs, .related.products and .storefront-product-pagination (all
   siblings inside content-single-product.php). Declaring only 2 columns here
   without explicitly placing/spanning each child left every one of them to CSS
   Grid's auto-placement, which — verified via CDP grid-overlay inspection and
   elementFromPoint() hit-testing in a real browser — did not reliably assign
   gallery/summary to column 1/2 in DOM order on this page. Every child below
   gets an explicit placement/span rule further down so layout is deterministic
   regardless of auto-placement, instead of relying on it implicitly. */
body.fm.single-product .product {
	display: grid;
	grid-template-columns: 1fr 380px;
	gap: clamp(24px, 3.5vw, 52px);
	align-items: start;
	/* Positioning context for the absolutely-pinned "¡Oferta!" badge below. */
	position: relative;
}

/* Storefront's core CSS sets `.single-product div.product{overflow:hidden}` — a
   classic clearfix to contain the old floated `.images`/`.summary` children.
   Those are now `float:none` (see below), so the clearfix no longer does
   anything useful, but it silently breaks `position: sticky` on the buy-box:
   an `overflow` value other than `visible` on an ancestor changes what a
   descendant's sticky positioning is contained/clipped by, and here it made
   the buy-box scroll away instead of sticking (verified in a real browser by
   scrolling and reading getBoundingClientRect() — invisible from a static
   screenshot at scroll position 0). Restoring `visible` is safe now that nothing
   inside needs float containment. */
body.fm.single-product .product {
	overflow: visible;
}

/* `.hfeed.site` (the theme's page wrapper div, printed by Storefront's own
   header.php — not something the child theme controls or may edit) carries
   site-wide `overflow-x: hidden` (guarding against horizontal scrollbars from
   full-bleed content elsewhere), paired with `overflow-y: auto`. That mixed
   hidden/auto overflow on the buy-box's nearest scrolling ancestor is a known
   cross-browser gotcha: it silently breaks `position: sticky` on descendants
   even many levels down, with zero visual sign at scroll position 0 (confirmed
   by binary-testing each axis on each ancestor in a real browser — clamping
   only ever engaged once `.hfeed.site`'s overflow-x specifically was not
   `hidden`). `overflow-x: clip` keeps the same "no horizontal scrollbar" guarantee
   as `hidden` (verified: document.documentElement.scrollWidth stays equal to
   window.innerWidth after this change) but — unlike `hidden` — does not
   establish a scroll container, so it doesn't interfere with `position: sticky`
   on any descendant. Scoped to `body.single-product` only, so pages that never
   needed this fix keep the original `hidden` untouched. */
body.fm.single-product .hfeed.site {
	overflow-x: clip;
}

/* Pin the hero row explicitly: gallery in column 1 (1fr), buy-box in column 2
   (380px) — don't rely on auto-placement for these two (see note above). */
body.fm.single-product .product > .woocommerce-product-gallery {
	grid-column: 1;
	grid-row: 1;
}

/* The buy-box spans row 1 AND row 2 (tabs), not just row 1. A grid item's
   `position: sticky` is clamped to the bounds of its OWN grid area, not the
   whole grid container (verified in a real browser: scrolling produced a
   perfectly linear 1:1 top-position change with no clamping at all — sticky
   was applying per computed style, but had zero room to visibly stick,
   because the buy-box's own content (774px) is already as tall as row 1
   alone, leaving no slack to stick within). Spanning into row 2 gives it a
   taller grid area to stick within while gallery + tabs scroll past on the
   left, matching the intent of a sticky buy-box; .woocommerce-tabs is kept to
   column 1 only (below) so it doesn't overlap this column-2 span. */
body.fm.single-product .product > .summary.entry-summary {
	grid-column: 2;
	grid-row: 1 / 3;
}

/* Tabs sit in column 1 only (row 2) — column 2 of this row is the buy-box's
   sticky span (above), not full-width, to avoid overlapping it. */
body.fm.single-product .product > .woocommerce-tabs {
	grid-column: 1;
	grid-row: 2;
}

/* Related products / upsells are NOT grid children anymore: inc/product.php
   rehooks them to `woocommerce_after_single_product` (outside div.product),
   because as grid items they extended the sticky buy-box's clamping bounds —
   Chrome clamps a sticky grid item to the grid container, not its own grid
   area, so the buy-box kept sticking down over the related section. The grid
   now only ever holds gallery / summary / tabs (plus the absolutely-pinned
   sale badge and Storefront's clearfix ::before/::after, which auto-place
   into empty 0px rows and are harmless). */

/* Reset Storefront's default two-column float layout on both former columns so
   they fill their CSS Grid track instead of the old percentage box model.
   Storefront's `.images` (= this element, it carries both classes) sets
   width:41.17%/float:left, and `.summary` sets width:52.94%/float:right — CSS
   Grid respects a grid item's own explicit width over the track's stretch
   default, so without this both the gallery and buy-box render narrower than
   their column (verified via getBoundingClientRect() in a real browser: the
   buy-box sat at ~57% of its track, the gallery/FlexSlider narrower still —
   invisible from static HTML, only visible via computed styles/runtime JS).
   `.woocommerce-product-gallery` ties Storefront's `.images` selector on
   specificity (3 classes each) and prints earlier (LRN-020), so it needs
   `!important` here, same as the precedent in 05-shop-grid-cart.css.

   `min-width: 0` on both is the standard CSS Grid "blowout" fix: a grid item's
   default `min-width` is `auto`, which respects its DESCENDANTS' intrinsic
   content size — and FlexSlider (jquery.flexslider.js, WooCommerce's gallery
   slider) sets an explicit large inline pixel width deep inside the gallery
   (`.woocommerce-product-gallery__wrapper`, e.g. numberOfSlides × measured
   slide width) that otherwise forces the whole `1fr` track to expand to fit
   it, blowing the grid out past its container (verified via CDP grid-overlay
   + getBoundingClientRect() in a real browser: the 1fr track measured over
   2600px in a ~875px container without this). `min-width: 0` tells the browser
   this item's minimum content contribution for track-sizing is zero; the
   `width: 100%` above still makes it fill whatever size the track resolves
   to once unblocked. */
body.fm.single-product .woocommerce-product-gallery {
	float: none !important;
	width: 100% !important;
	min-width: 0 !important;
	margin-right: 0 !important;
}

/* TSK-049 follow-up: removing the shop sidebar on single-product pages
   (futbol_mesa_remove_sidebar_on_product(), inc/product.php) adds Storefront's
   own `storefront-full-width-content` body class, which activates a DIFFERENT,
   dormant rule in storefront-woocommerce-style (the parent theme's own
   woocommerce.css, printed after our partials — LRN-020):
   `.storefront-full-width-content.single-product div.product .summary
   {width:56.52%}`. That selector ties this one at (0,4,1) specificity and
   prints later, so it wins without `!important` — verified via
   getBoundingClientRect() showing the buy-box at 56.52% of its 380px grid
   track (~215px) instead of filling it. Same fix as the gallery above. */
body.fm.single-product .summary.entry-summary {
	float: none !important;
	width: 100% !important;
	min-width: 0 !important;
	margin-right: 0 !important;
}

/* Sticky positioning for the buy-box (right column on desktop).
   Offset by 16px from the top of the viewport; z-index below the sticky header (100)
   and sticky mobile add-to-cart bar (99), so it doesn't occlude them. */
body.fm.single-product .summary.entry-summary {
	position: sticky;
	top: 16px;
	z-index: 98;
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* Buy-box card styling: white background, hairline border, rounded panel, shadow, padding. */
body.fm.single-product .summary.entry-summary {
	background: #fff;
	border: 1px solid var(--color-hairline);
	border-radius: var(--radius-panel);
	padding: clamp(20px, 2vw, 26px);
	box-shadow: var(--shadow-card);
}

/* Mobile breakpoint (≤900px): stack to single column, gallery first, buy-box below.
   Reset sticky positioning, flex layout, and the explicit column/row placement
   (single-column grid only has column 1 — grid-column:2 would overflow it). */
@media (max-width: 900px) {
	body.fm.single-product .product {
		grid-template-columns: 1fr;
	}

	body.fm.single-product .product > .woocommerce-product-gallery {
		grid-column: 1;
		grid-row: auto;
	}

	body.fm.single-product .product > .summary.entry-summary {
		grid-column: 1;
		grid-row: auto;
	}

	body.fm.single-product .product > .woocommerce-tabs {
		grid-column: 1;
		grid-row: auto;
	}

	body.fm.single-product .summary.entry-summary {
		position: static;
		top: auto;
		z-index: auto;
	}
}

/* ============================================================================
   GALLERY STYLING
   ============================================================================ */

/* Main product image: square aspect-ratio, rounded, hairline border. */
body.fm.single-product .woocommerce-product-gallery__wrapper {
	position: relative;
	background: #fff;
	border: 1px solid var(--color-hairline);
	border-radius: var(--radius-card);
	overflow: hidden;
}

body.fm.single-product .woocommerce-product-gallery__image img {
	display: block;
	width: 100%;
	aspect-ratio: 1/1;
	object-fit: cover;
	object-position: center;
}

/* Thumbnail strip below the main image. Flexslider thumbnails (if present).
   Small rounded squares with hairline border, terracotta border on hover/active. */
body.fm.single-product .flex-control-nav {
	display: flex;
	/* Wrap within the gallery column: products carry up to 6 gallery images
	   (e.g. Bases Grana2) and an unwrapped row overflows under the buy-box. */
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 14px;
	padding: 0;
	list-style: none;
}

body.fm.single-product .flex-control-nav li {
	margin: 0;
	padding: 0;
	flex: 0 0 auto;
}

body.fm.single-product .flex-control-nav a {
	display: block;
	width: 88px;
	height: 88px;
	border-radius: var(--radius-button);
	border: 2px solid var(--color-hairline);
	overflow: hidden;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

body.fm.single-product .flex-control-nav a:hover,
body.fm.single-product .flex-control-nav a.flex-active {
	border-color: var(--color-terracotta);
}

body.fm.single-product .flex-control-nav img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* ============================================================================
   TRUST BLOCK: 3-column stat row + WhatsApp CTA pill
   ============================================================================ */

/* Wrapper div (added in TSK-049) to contain both the stat row and WhatsApp pill. */
body.fm.single-product .futbol_mesa_trust_wrapper {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 18px 0 0;
	padding: 14px 0 0;
	border-top: 1px solid var(--color-hairline-faint);
}

/* 3-column stat row: flex with space-between, dividers between columns. */
body.fm.single-product .futbol_mesa_trust {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	justify-content: space-between;
	gap: 8px;
}

body.fm.single-product .futbol_mesa_trust li {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	flex: 1;
	text-align: center;
	margin: 0;
	position: relative;
}

/* Divider lines between stat columns (after 1st and 2nd items). */
body.fm.single-product .futbol_mesa_trust li:not(:last-child)::after {
	content: '';
	position: absolute;
	right: -4px;
	top: 0;
	bottom: 0;
	width: 1px;
	background: var(--color-hairline-faint);
}

/* Hide SVG icons in the stat row (we're showing a minimal design with stat + label only). */
body.fm.single-product .futbol_mesa_trust svg {
	display: none;
}

/* Bold, green-colored stat value (e.g., "24-48h", "100%", "15 días"). */
body.fm.single-product .futbol_mesa_trust_stat {
	display: block;
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 0.8rem;
	color: var(--color-pitch-green);
}

/* Small muted label below the stat. */
body.fm.single-product .futbol_mesa_trust_label {
	display: block;
	font-size: 0.7rem;
	color: var(--color-muted);
	margin-top: 2px;
	line-height: 1.2;
}

/* Link styling within the trust label (returns link). */
body.fm.single-product .futbol_mesa_trust_link {
	color: inherit;
	text-decoration: underline;
	transition: color 0.15s ease;
}

body.fm.single-product .futbol_mesa_trust_link:hover,
body.fm.single-product .futbol_mesa_trust_link:focus {
	color: var(--color-terracotta);
}

/* WhatsApp CTA pill: full-width, green-tinted background, centered flex layout. */
body.fm.single-product .futbol_mesa_trust_whatsapp {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 12px 16px;
	border-radius: var(--radius-button);
	background: rgba(111, 191, 148, 0.14);
	color: var(--color-pitch-green);
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 0.9rem;
	text-decoration: none;
	transition: background-color 0.15s ease;
	border: none;
	cursor: pointer;
}

body.fm.single-product .futbol_mesa_trust_whatsapp:hover,
body.fm.single-product .futbol_mesa_trust_whatsapp:focus {
	background: rgba(111, 191, 148, 0.24);
	color: var(--color-pitch-green);
}

/* SVG icon inside the WhatsApp pill: green circle with white icon. */
body.fm.single-product .futbol_mesa_trust_whatsapp svg {
	display: inline-flex;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--color-accent-green);
	color: #fff;
	fill: currentColor;
	align-items: center;
	justify-content: center;
}

/* ============================================================================
   PRODUCT TABS: underline-tab styling (CSS-only)
   ============================================================================ */

/* Tabs container and bar. */
body.fm.single-product .woocommerce-tabs {
	margin-bottom: 0;
}

/* Storefront's DEFAULT tab layout is not a horizontal-bar-then-panel-below
   design — it's a side-by-side float layout: `ul.tabs{width:29.4%;float:left}`
   (a vertical tab list) beside `.panel{width:64.7%;float:right;margin-top:0}`
   (verified via CDP matched-styles in a real browser: the panel rendered at
   the SAME top offset as the tab bar, because it was still floating right
   next to it, invisible from static HTML/curl). `float:none; width:100%`
   resets both so the panel stacks below the now-horizontal tab bar instead. */
body.fm.single-product .woocommerce-tabs ul.tabs {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 24px;
	border-bottom: 1px solid var(--color-hairline);
	margin-bottom: 22px;
	float: none;
	width: 100%;
}

body.fm.single-product .woocommerce-tabs ul.tabs li {
	margin: 0;
	padding: 0;
	border: none;
	background: none;
}

/* Tab label: bold, uppercase-ish, muted text on inactive, terracotta underline on active. */
body.fm.single-product .woocommerce-tabs ul.tabs li a {
	display: inline-block;
	padding: 0 0 14px;
	margin: 0;
	border: none;
	color: var(--color-muted);
	text-decoration: none;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 0.95rem;
	line-height: 1;
	transition: color 0.15s ease;
	position: relative;
}

/* Hover state: terracotta text color. */
body.fm.single-product .woocommerce-tabs ul.tabs li a:hover {
	color: var(--color-terracotta);
}

/* Active tab: ink text, terracotta bottom border underline. */
body.fm.single-product .woocommerce-tabs ul.tabs li.active a {
	color: var(--color-ink);
	font-weight: 800;
	border-bottom: 3px solid var(--color-terracotta);
	padding-bottom: 11px; /* Adjust to align with other tabs: 14px - 3px border = 11px */
	margin-bottom: 1px; /* Negative margin to account for border taking space */
}

/* Tab panel content. Reset Storefront's `.panel{width:64.7%;float:right}`
   (see note above `ul.tabs`) so the panel stacks full-width below the tab bar. */
body.fm.single-product .woocommerce-tabs .woocommerce-Tabs-panel {
	margin: 0;
	padding: 0;
	display: block;
	float: none;
	width: 100%;
}

/* Each panel (description/additional-information/reviews) renders its own
   `<h2>` heading by default (e.g. `templates/single-product/tabs/description.php`)
   — redundant here since the active tab label already says "Descripción" /
   "Información adicional" / "Valoraciones", per the mockup's underline-tab
   design (no repeated in-panel heading). Hide it; WooCommerce's own tabs JS
   still toggles the whole panel, this only hides the heading node within it. */
body.fm.single-product .woocommerce-tabs .woocommerce-Tabs-panel > h2:first-child {
	display: none;
}

/* The reviews panel's heading is nested one level deeper with its own class
   (`templates/single-product-reviews.php`: `.woocommerce-Tabs-panel #reviews
   #comments h2.woocommerce-Reviews-title`), so it isn't caught by the
   `> h2:first-child` rule above — hide it the same way, same reasoning. */
body.fm.single-product .woocommerce-tabs .woocommerce-Reviews-title {
	display: none;
}

body.fm.single-product .woocommerce-tabs .woocommerce-Tabs-panel p {
	font-size: 1rem;
	line-height: 1.7;
	color: var(--color-body);
	margin: 0 0 16px;
	max-width: 62ch;
}

body.fm.single-product .woocommerce-tabs .woocommerce-Tabs-panel p:last-child {
	margin-bottom: 0;
}

body.fm.single-product .woocommerce-tabs .woocommerce-Tabs-panel table {
	max-width: 620px;
	border-top: 1px solid var(--color-hairline);
}

body.fm.single-product .woocommerce-tabs .woocommerce-Tabs-panel table tr {
	border-bottom: 1px solid var(--color-hairline-faint);
}

body.fm.single-product .woocommerce-tabs .woocommerce-Tabs-panel th {
	text-align: left;
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 0.82rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--color-muted);
	padding: 13px 4px;
}

body.fm.single-product .woocommerce-tabs .woocommerce-Tabs-panel td {
	font-size: 0.98rem;
	color: var(--color-body);
	padding: 13px 4px;
}

/* ============================================================================
   BREADCRUMB: small muted text with "/" separators
   ============================================================================ */

/* Storefront wraps the nav in `.storefront-breadcrumb` with its own default
   padding (~1.4em top) and a large bottom margin (~3.7em). Shop/archive/cart
   neutralise that wrapper in 01-tokens-header.css and let the wrapper alone
   supply spacing; single-product instead styles the nav directly (below), so
   the wrapper must be zeroed here or its padding/margin double-stacks with the
   nav's own — pushing the crumbs down and leaving a big gap before the title. */
body.fm.single-product .storefront-breadcrumb {
	margin: 0;
	padding: 0;
}

/* Breadcrumb nav: small size, muted text. Top padding only — the nav is a
   direct child of `.col-full` (see markup: `.col-full > nav.woocommerce-breadcrumb`),
   which already applies the left/right content gutter; adding it here too
   double-indents the crumbs past the gallery/title's left edge below.
   Bottom margin matches the PDP hero's own top padding (Producto.dc.html):
   the `.product` grid below has no top spacing of its own, so with the
   wrapper's default ~3.7em margin zeroed out above, this is now the only
   thing keeping the crumbs off the gallery image. */
body.fm.single-product nav.woocommerce-breadcrumb {
	font-size: 0.85rem;
	color: var(--color-muted);
	margin: 0 0 clamp(16px, 2.5vw, 26px);
	padding: clamp(20px, 3vw, 28px) 0 0;
}

/* Links: muted by default, terracotta on hover. */
body.fm.single-product nav.woocommerce-breadcrumb a {
	color: var(--color-muted);
	text-decoration: none;
	transition: color 0.15s ease;
}

body.fm.single-product nav.woocommerce-breadcrumb a:hover,
body.fm.single-product nav.woocommerce-breadcrumb a:focus {
	color: var(--color-terracotta);
}

/* Current (last) breadcrumb: bold, ink-colored. */
body.fm.single-product nav.woocommerce-breadcrumb .breadcrumb-current {
	color: var(--color-ink);
	font-weight: 600;
}

/* Separator "/" between breadcrumbs: semi-transparent. */
body.fm.single-product nav.woocommerce-breadcrumb::before,
body.fm.single-product nav.woocommerce-breadcrumb > span:not(.breadcrumb-current) {
	color: var(--color-muted);
	opacity: 0.5;
	margin: 0 8px;
}

/* ============================================================================
   RELATED PRODUCTS
   ============================================================================ */

/* Related products render the same `ul.products li.product` markup as the shop
   grid, BUT 05-shop-grid-cart.css's card styling is scoped to
   `:is(body.home, body.archive)` only (single-product intentionally excluded —
   that partial predates this task and never needed to cover the PDP). Verified
   in a real browser (TSK-049 QA): without a single-product-scoped equivalent,
   related-product cards render with WooCommerce/Storefront's unstyled defaults
   — including the loop add-to-cart link, which is NOT position:static in that
   default state and rendered as a large dark misplaced box. This mirrors
   05-shop-grid-cart.css's rules 1:1 (same tokens/values), just re-scoped to
   `body.fm.single-product .related.products`, so cards look identical to the
   shop grid without editing that other partial. */
body.fm.single-product .related.products ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: clamp(14px, 1.6vw, 22px);
	margin: 0;
	padding: 0;
	list-style: none;
}

body.fm.single-product .related.products ul.products::before,
body.fm.single-product .related.products ul.products::after {
	content: none;
}

body.fm.single-product .related.products ul.products li.product {
	/* !important required: storefront-woocommerce's `.columns-N ul.products li.product`
	   float/width/margin rule out-ranks this selector and prints after the child
	   (same precedent as 05-shop-grid-cart.css). */
	display: flex !important;
	flex-direction: column;
	width: auto !important;
	margin: 0 !important;
	float: none !important;
	min-width: 220px;
	max-width: 100%;
	border-radius: var(--radius-card);
	flex: 1 1 auto;
	background: #fff;
	border: 1px solid var(--color-hairline);
	padding: 16px;
	box-shadow: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.fm.single-product .related.products ul.products li.product:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-card);
}

body.fm.single-product .related.products ul.products li.product .woocommerce-loop-product__link {
	display: block;
	position: relative;
}

body.fm.single-product .related.products ul.products li.product .woocommerce-loop-product__link img {
	width: 100%;
	height: auto;
	aspect-ratio: 1/1;
	object-fit: cover;
	object-position: center;
	border-radius: var(--radius-button);
	margin-bottom: 16px;
}

body.fm.single-product .related.products ul.products li.product .onsale {
	position: absolute;
	top: 12px;
	right: 12px;
	background: var(--color-terracotta);
	color: #fff;
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 6px 11px;
	border-radius: var(--radius-sm);
	line-height: 1.2;
}

body.fm.single-product .related.products ul.products li.product .woocommerce-loop-product__title {
	text-align: center;
	margin-top: 16px;
	margin-bottom: 12px;
	color: var(--color-ink);
	transition: color 0.15s ease;
}

body.fm.single-product .related.products ul.products li.product:hover .woocommerce-loop-product__title {
	color: var(--color-terracotta);
}

body.fm.single-product .related.products ul.products li.product .price {
	text-align: center;
	margin-bottom: 12px;
	color: var(--color-terracotta);
}

body.fm.single-product .related.products ul.products li.product .price del {
	opacity: 1;
	color: var(--color-muted);
	text-decoration: line-through;
	font-size: 1rem;
	font-weight: 400;
	margin-right: 8px;
}

body.fm.single-product .related.products ul.products li.product .price ins {
	text-decoration: none;
	font-family: var(--font-heading);
	font-weight: 900;
	font-size: 1.35rem;
	color: var(--color-terracotta);
}

/* Add-to-cart button: FULL WIDTH, ink bg, white text, terracotta on hover. */
body.fm.single-product .related.products ul.products li.product .button.add_to_cart_button,
body.fm.single-product .related.products ul.products li.product a.added_to_cart {
	width: 100%;
	display: block;
	margin-top: auto;
	background-color: var(--color-ink) !important;
	color: #fff !important;
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 0.95rem;
	padding: 14px 16px;
	border-radius: var(--radius-button);
	text-align: center;
	text-decoration: none;
	border: none;
	transition: background-color 0.15s ease;
}

body.fm.single-product .related.products ul.products li.product .button.add_to_cart_button:hover,
body.fm.single-product .related.products ul.products li.product a.added_to_cart:hover {
	background-color: var(--color-terracotta) !important;
}

body.fm.single-product .related.products {
	margin-top: clamp(48px, 6vw, 80px);
}

body.fm.single-product .related.products h2 {
	font-family: var(--font-heading);
	font-weight: 900;
	font-size: clamp(1.4rem, 2.5vw, 2rem);
	letter-spacing: -0.02em;
	margin: 0 0 clamp(18px, 2.5vw, 28px);
	/* Mockup heading is left-aligned; Storefront centers section headings. */
	text-align: left;
}

/* ============================================================================
   PRODUCT SUMMARY CHILDREN: improve spacing and typography within the buy-box
   ============================================================================ */

/* Product line/brand eyebrow above the title (printed by
   futbol_mesa_product_eyebrow(), inc/product.php — replaces Storefront's
   brand-logo image at the same summary-hook priority). */
body.fm.single-product .summary .fm-product-eyebrow {
	display: block;
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--color-terracotta);
}

/* Product title inside the buy-box. */
body.fm.single-product .summary .product_title {
	font-family: var(--font-heading);
	font-weight: 900;
	font-size: clamp(1.4rem, 2.2vw, 1.85rem);
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 8px 0 0;
	color: var(--color-ink);
}

/* Price styling. */
body.fm.single-product .summary .price {
	margin: 18px 0 6px;
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
	font-size: 1.15rem;
}

/* Big terracotta price: the regular amount (non-sale products render it as a
   direct child) and the current amount inside <ins> (sale products). Must NOT
   match the crossed-out old price inside <del> — a bare `.price .amount` did,
   and the old price rendered at the same 40px Archivo 900 terracotta as the
   sale price (mockup: 1.15rem muted strikethrough). */
body.fm.single-product .summary .price > .amount,
body.fm.single-product .summary .price ins .amount {
	font-family: var(--font-heading);
	font-weight: 900;
	font-size: clamp(2rem, 3vw, 2.5rem);
	line-height: 1;
	color: var(--color-terracotta);
}

/* Old (pre-sale) price: strikethrough, muted, body-size — per mockup. The
   inner .amount span must inherit, not restyle. --color-muted, not
   --color-footer-muted: same AA-contrast fix as the loop struck price (TSK-040). */
body.fm.single-product .summary .price del,
body.fm.single-product .summary .price del .amount {
	font-family: inherit;
	color: var(--color-muted);
	font-size: 1.15rem;
	font-weight: 400;
}

/* "¡Oferta!" flash badge. WooCommerce prints it as a DIRECT child of
   div.product (sale_flash, before the gallery), and storefront-woocommerce
   forces it to `position: relative` on single-product pages — which turns it
   into a stray grid item in our .product grid: it auto-placed into a cell,
   rendered as a 380px-wide strip and shifted the whole hero row (verified via
   getBoundingClientRect). Absolute positioning removes it from grid placement
   and pins it over the gallery's top-left corner per the mockup (.product is
   the positioning context, and the gallery starts at the grid's origin). */
body.fm.single-product .product > .onsale {
	position: absolute !important; /* storefront-woocommerce sets relative with higher print order */
	top: 14px;
	left: 14px;
	right: auto;
	z-index: 2;
	width: auto;
	margin: 0;
	background: var(--color-terracotta);
	color: #fff;
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 0.74rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 7px 13px;
	border-radius: var(--radius-sm);
	line-height: 1.2;
}

/* Savings pill under the price on sale products ("Ahorras 11,55 € (−16%)"),
   printed by futbol_mesa_sale_savings_pill() (inc/product.php). */
body.fm.single-product .summary .fm-savings-pill {
	display: inline-block;
	align-self: flex-start;
	background: rgba(168, 72, 48, 0.1);
	color: var(--color-terracotta);
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 0.82rem;
	letter-spacing: 0.02em;
	padding: 6px 12px;
	border-radius: var(--radius-pill);
}

/* Product short description / tagline. */
body.fm.single-product .summary .woocommerce-product-details__short-description {
	margin: 12px 0 0;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--color-body);
}

/* Quantity + add-to-cart button row. */
body.fm.single-product .summary .cart {
	display: flex;
	gap: 10px;
	margin: 20px 0 0;
	padding: 0;
	border: none;
	background: none;
}

/* Quantity input wrapper. Extra `.cart` in the chain beats Storefront's
   `.single-product div.product form.cart .quantity{float:left;margin-right:.875em}`
   (same class count, but its 2 type selectors win the tie-break over our 1) —
   without it that legacy margin stacks on top of the flex `gap`, stealing
   width from the add-to-cart button next to it. */
body.fm.single-product .summary .cart .quantity {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--color-hairline);
	border-radius: var(--radius-button);
	overflow: hidden;
	margin: 0;
	padding: 0;
}

body.fm.single-product .summary .quantity input {
	width: 40px;
	height: 52px;
	border: none;
	outline: none;
	box-shadow: none;
	padding: 0 4px;
	text-align: center;
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 1rem;
	background: #fff;
	color: var(--color-ink);
	-moz-appearance: textfield;
	appearance: textfield;
}

/* Hide native number spinner (Chrome/Safari) — custom +/- steppers replace it;
   without this, focusing the field grows it with browser-drawn up/down arrows. */
body.fm.single-product .summary .quantity input::-webkit-outer-spin-button,
body.fm.single-product .summary .quantity input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

body.fm.single-product .summary .quantity button {
	border: none;
	background: #fff;
	color: var(--color-ink);
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 1.1rem;
	width: 42px;
	height: 52px;
	cursor: pointer;
	transition: background-color 0.15s ease;
	padding: 0;
}

body.fm.single-product .summary .quantity button:hover {
	background: var(--color-cream);
}

/* Add to cart button. */
body.fm.single-product .summary button.single_add_to_cart_button {
	flex: 1;
	border: none;
	background: var(--color-ink);
	color: #fff;
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 1rem;
	letter-spacing: 0.02em;
	height: 52px;
	border-radius: var(--radius-button);
	cursor: pointer;
	transition: background-color 0.15s ease;
	text-transform: none;
	padding: 0 16px;
}

body.fm.single-product .summary button.single_add_to_cart_button:hover,
body.fm.single-product .summary button.single_add_to_cart_button:focus {
	background: var(--color-terracotta);
	color: #fff;
}

/* ============================================================================
   CTA BAND: shared pitch-green band above the footer (design/dc/cta-band.dc.html)
   ============================================================================ */

/* Rendered by futbol_mesa_product_cta_band() (inc/product.php) via
   storefront_before_footer, which fires outside the content column — the band
   is naturally full-width, no negative-margin breakout needed. Classes are
   unscoped (.fm-cta-band is unique to this template) so the component can be
   reused on other pages later. Eyebrow/body use rgba(255,255,255,0.85), not
   the mockup's 0.7 — 0.7 fails AA contrast on pitch-green (TSK-040 precedent
   in 01-tokens-header.css's .rules-banner). */
.fm-cta-band {
	background: var(--color-pitch-green);
	color: #fff;
}

.fm-cta-band__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: clamp(48px, 7vw, 96px) clamp(16px, 4vw, 48px);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: clamp(24px, 5vw, 64px);
	align-items: center;
}

.fm-cta-band__eyebrow {
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.85);
}

.fm-cta-band__title {
	font-family: var(--font-heading);
	font-weight: 900;
	font-size: clamp(2rem, 4vw, 3rem);
	letter-spacing: -0.02em;
	line-height: 1.05;
	margin: 16px 0 20px;
	color: #fff;
}

.fm-cta-band__text {
	font-size: 1.125rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.85);
	max-width: 32em;
	margin: 0;
}

.fm-cta-band__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: center;
}

.fm-cta-band__cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 1rem;
	padding: 16px 28px;
	border-radius: var(--radius-pill);
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* Selector is deliberately longer than BEM needs: 02-navigation-footer.css's
   global link color (`.woocommerce a:not(.button):not(.contact-link)`,
   specificity 0,3,1) matches these anchors and painted them terracotta.
   `.fm-cta-band .fm-cta-band__actions a.…` ties it at (0,3,1) and this
   partial prints later (01→08 enqueue order), so the tie breaks our way. */
.fm-cta-band .fm-cta-band__actions a.fm-cta-band__cta--fill {
	background: #fff;
	color: var(--color-pitch-green);
	border: 2px solid #fff;
}

.fm-cta-band .fm-cta-band__actions a.fm-cta-band__cta--fill:hover,
.fm-cta-band .fm-cta-band__actions a.fm-cta-band__cta--fill:focus {
	background: var(--color-cream);
	border-color: var(--color-cream);
	color: var(--color-pitch-green);
}

.fm-cta-band .fm-cta-band__actions a.fm-cta-band__cta--outline {
	background: transparent;
	color: #fff;
	border: 2px solid rgba(255, 255, 255, 0.5);
}

.fm-cta-band .fm-cta-band__actions a.fm-cta-band__cta--outline:hover,
.fm-cta-band .fm-cta-band__actions a.fm-cta-band__cta--outline:focus {
	background: rgba(255, 255, 255, 0.1);
	border-color: #fff;
	color: #fff;
}

/* Product tags in the buy-box meta link to 800+ thin legacy tag archives that
   are not part of the PDP mockup — hide the row. CSS-only on purpose: emptying
   the terms via the get_the_terms filter would also starve
   wc_get_related_products() of its tag-based matches. div.product is needed to
   out-rank Storefront's `.single-product div.product .product_meta .tagged_as
   { display: block }`, which ties and wins on order otherwise. */
body.fm.single-product div.product .product_meta .tagged_as {
	display: none;
}

/* ============================================================================
   MEDIA QUERIES: adjust spacing for narrower viewports
   ============================================================================ */

@media (max-width: 767px) {
	/* On mobile, further reduce the buy-box padding. */
	body.fm.single-product .summary.entry-summary {
		padding: clamp(16px, 2vw, 20px);
	}

	/* Stack tabs closer together. */
	body.fm.single-product .woocommerce-tabs ul.tabs {
		gap: 16px;
		margin-bottom: 16px;
	}

	/* Reduce font sizes on mobile for buy-box content. */
	body.fm.single-product .summary .product_title {
		font-size: 1.3rem;
	}

	body.fm.single-product .summary .price .amount {
		font-size: 1.8rem;
	}
}
