/* Product page redesign (VG-035, prototype docs/prototype/product_page_v1): hero, section links, description + facts, reviews summary, bottom buy bar.
   Loaded after vg-refresh.css on the product page only; it overrides the older VG-027 layout rules by selector order. */

/* ---- hero ---- */
.vg-pdp-top { grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); grid-template-areas: "gallery title" "gallery buy"; grid-template-rows: auto auto; align-content: center; align-items: start; column-gap: 60px; row-gap: 0; padding-bottom: 36px; }
.vg-pdp-gallery { align-self: center; }
.vg-pdp-zoom { margin-inline: auto; border: 0; border-radius: 22px; background: transparent; box-shadow: none; }
.vg-pdp-zoom:hover { border: 0; box-shadow: none; }
.vg-pdp-intro { grid-area: title; min-width: 0; align-self: end; }
.vg-pdp-buy { align-self: start; }
.vg-pdp-intro .vg-pdp-title { margin: 0 0 12px; font-size: clamp(22px, 1.9vw, 28px); line-height: 1.2; letter-spacing: -.5px; }
.vg-pdp-intro .vg-pdp-rating { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 13px; }
.vg-pdp-intro .vg-pdp-rating a { color: var(--vg-text); font-weight: 400; text-decoration: none; }
.vg-pdp-intro .vg-pdp-rating a:hover { text-decoration: underline; }
.vg-pdp-pricebox { margin: 26px 0 18px; }
.vg-pdp-price-row { gap: 6px 15px; }
.vg-pdp-price { font-size: 36px; letter-spacing: -1px; }
.vg-pdp-discount { border-radius: 6px; padding: 3px 9px; font-size: 12px; }
.vg-pdp-actions { flex-wrap: nowrap; }
.vg-pdp-actions > .vg-pdp-add { flex: 1 1 auto; max-width: none; }
.vg-pdp-ship { margin: 14px 0 0; color: var(--vg-text-muted); font-size: 13px; line-height: 1.5; }

/* ---- section links ---- */
.vg-pdp-anchors { position: sticky; top: var(--vg-shell-height, 140px); z-index: 5; display: flex; flex-wrap: nowrap; gap: 34px; margin: 0 0 34px; padding: 0; border-bottom: 1px solid var(--vg-c-e6eddd); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); }
.vg-pdp-anchors a { padding: 16px 2px; border-bottom: 3px solid transparent; color: var(--vg-text); font-weight: 400; text-decoration: none; }
.vg-pdp-anchors a:hover { text-decoration: none; color: var(--vg-green-dark); }
.vg-pdp-anchors a.is-active { border-bottom-color: var(--vg-green); font-weight: 700; }

/* ---- description + facts ---- */
.vg-pdp-columns { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 70px; max-width: none; margin: 0; padding-bottom: 25px; align-items: start; }
.vg-pdp-columns::before { display: none; }
.vg-pdp-columns > section { scroll-margin-top: calc(var(--vg-shell-height, 140px) + 70px); }
.vg-pdp-facts { border-radius: 16px; }
.vg-pdp-facts h3 { margin: 0; font-size: 17px; }
.vg-pdp-facts dl { margin: 0; }
.vg-pdp-facts dl > div { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid #e0e7d7; }
.vg-pdp-facts dl > div:last-child { border-bottom: 0; }
.vg-pdp-facts dt { color: var(--vg-text-muted); }
.vg-pdp-facts dd { margin: 0; text-align: end; overflow-wrap: anywhere; }

/* ---- reviews ---- */
.vg-pdp-reviews-wrap { border-block: 1px solid var(--vg-c-e6eddd); }
.vg-pdp-reviews-wrap .vg-pdp-reviews { margin: 0; padding: 36px 0 20px; border: 0; scroll-margin-top: calc(var(--vg-shell-height, 140px) + 70px); }
.vg-pdp-reviews:focus, .vg-pdp-description:focus { outline: 0; }
.vg-pdp-reviews::after { display: none; }
.vg-pdp-reviews-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.vg-pdp-reviews-head h2 { margin: 0; }
.vg-pdp-reviews-head .vg-pdp-write { margin: 0; }
.vg-pdp-review-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 70px; align-items: start; }
.vg-pdp-score-wrap { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.vg-pdp-score { font-size: 44px; font-weight: 700; line-height: 1.1; }
.vg-pdp-score-note { margin-top: 2px; color: var(--vg-text-muted); font-size: 12px; }
.vg-pdp-bars { font-size: 12px; }
.vg-pdp-bar-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.vg-pdp-bar-row > span:first-child { min-width: 28px; }
.vg-pdp-track { display: block; flex: 1; height: 6px; border-radius: 6px; background: #edf0e8; overflow: hidden; }
.vg-pdp-fill { display: block; height: 6px; border-radius: 6px; background: var(--vg-green); }
.vg-pdp-review-list > li { margin: 0; }
.vg-pdp-review-list .vg-review-card { min-height: 0; margin: 0 0 24px; padding: 0 0 24px; border: 0; border-bottom: 1px solid var(--vg-c-e6eddd); border-radius: 0; background: transparent; }
.vg-pdp-review-list > li:last-child .vg-review-card { border-bottom: 0; }
.vg-pdp-review-list .vg-review-bottom { margin-top: 0; align-items: flex-start; }
.vg-pdp-review-list .vg-review-card > p { margin: 8px 0 0; font-size: 14px; line-height: 1.8; }

/* ---- bottom buy bar (replaces the bar under the header) ---- */
.vg-pdp-bar { top: auto; bottom: 0; border-top: 1px solid var(--vg-c-e6eddd); border-bottom: 0; box-shadow: 0 -5px 24px rgba(32, 50, 14, .08); transform: translateY(110%); }
.vg-pdp-bar.is-visible { transform: none; }
.vg-pdp-bar-inner { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.vg-pdp-wrap { padding-bottom: 0; }
.vg-pdp-also { margin-top: 28px; }

@media (max-width: 900px) {
    .vg-pdp-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "gallery" "buy"; row-gap: 14px; padding-bottom: 24px; }
    .vg-pdp-intro { align-self: start; }
    .vg-pdp-pricebox { margin: 0px 0 12px; }
    .vg-pdp-anchors { gap: 28px; margin-bottom: 24px; }
    .vg-pdp-columns { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-bottom: 28px; }
    .vg-pdp-review-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .vg-pdp-bars { display: none; }
    .vg-pdp-reviews-wrap .vg-pdp-reviews { padding-top: 26px; }
}
@media (max-width: 600px) {
    .vg-pdp-intro .vg-pdp-title { font-size: 22px; letter-spacing: -.3px; }
    .vg-pdp-price { font-size: 30px; }
    .vg-pdp-anchors { justify-content: space-between; gap: 0; }
    .vg-pdp-anchors a { padding-block: 13px; }
    .vg-pdp-reviews-head { align-items: flex-start; }
    .vg-pdp-reviews-head .vg-pdp-write { min-height: 40px; padding: 8px 14px; font-size: 13px; }
}

/* Phone: the trail is Home > ... > the product's own category. The product itself is hidden (it is the heading below), the middle steps collapse into a plain "...". */
@media (max-width: 900px) {
    .vg-pdp-crumbs .vg-cat-crumbs ol { flex-wrap: nowrap; }
    .vg-pdp-crumbs .vg-cat-crumbs li:not(:first-child):not(:nth-last-child(-n+2)) { display: none; }
    .vg-pdp-crumbs .vg-cat-crumbs li:first-child:has(~ li:nth-child(4))::after { content: '\203a\00a0\2026'; margin-inline-start: 9px; color: var(--vg-c-626b5c); }
    [dir=rtl] .vg-pdp-crumbs .vg-cat-crumbs li:first-child:has(~ li:nth-child(4))::after { content: '\2039\00a0\2026'; }
}

/* Manufacturer row of the facts list: the value is the brand link. */
.vg-pdp-facts dd a { color: var(--vg-green-dark); font-weight: 700; text-decoration: none; }
.vg-pdp-facts dd a:hover { text-decoration: underline; }

/* Wide buy buttons: the same soft hover as the product cards (the shared 4% grow is too much on a button this wide). */
.vg-pdp-add.vg-grow, .vg-pdp-bar-add.vg-grow { transition: background var(--vg-ease-card, .22s ease), transform var(--vg-ease-card, .22s ease), box-shadow var(--vg-ease-card, .22s ease); }
@media (hover: hover) { .vg-pdp-add.vg-grow:hover:not(:disabled), .vg-pdp-bar-add.vg-grow:hover:not(:disabled) { transform: scale(1.02); } }
.vg-pdp-add.vg-grow:active, .vg-pdp-bar-add.vg-grow:active { transform: scale(1); }

/* Enlarged picture: a square window with padding; the picture is up to 550x550 inside it and the close button sits below. */
.vg-pdp-lightbox { --vg-lb: min(94vw, 94dvh, 740px); width: var(--vg-lb); height: var(--vg-lb); max-width: none; max-height: none; padding: 44px; }
.vg-pdp-lightbox[open] { gap: 10px; }
.vg-pdp-lightbox img { flex: 1 1 0; min-height: 0; width: 100%; max-width: 600px; height: auto; max-height: none; object-fit: contain; }
@media (max-width: 900px) { .vg-pdp-lightbox { --vg-lb: 100vw; width: 100vw; height: 100dvh; padding: 20px; } }

/* The "also order" rail shows 10 products on a phone as well (the shared rule hides everything after the 9th). */
@media (max-width: 600px) { .vg-pdp-also .vg-rail-track > .vg-product-card:nth-child(n+10) { display: flex; } }


/* The gallery sits in a rounded green frame. */
.vg-pdp-gallery { padding: 12px; border: 1px solid var(--vg-c-a8d68a, #a8d68a); border-radius: 16px; }

/* The picture frame is as tall as the picture: side padding only, no space above and below it. */
.vg-pdp-zoom { aspect-ratio: auto; max-width: 460px; padding: 0 20px; }
.vg-pdp-zoom img { width: 100%; height: auto; aspect-ratio: 1 / 1; max-height: none; }
@media (max-width: 900px) { .vg-pdp-zoom { max-width: 194px; padding: 0; } .vg-pdp-zoom img { max-width: 194px; max-height: 194px; } }

/* Space between the quantity control and the Add to cart button. */
.vg-pdp-actions { gap: 30px; }

/* Less space under the top block, on every screen. */
.vg-pdp-top { padding-bottom: 10px; }
@media (max-width: 900px) { .vg-pdp-top { padding-bottom: 10px; } }

/* Facts box: under the Add to cart button on desktop, under the description on a phone (two copies, one shown). */
.vg-pdp-columns { grid-template-columns: minmax(0, 1fr); }
.vg-pdp-facts-buy { margin-top: 25px; }
.vg-pdp-facts-side { display: none; }
@media (max-width: 900px) {
    .vg-pdp-facts-buy { display: none; }
    .vg-pdp-facts-side { display: block; }
}

/* Desktop: the gallery frame is as tall as the whole top block (both grid rows); the picture stays in its middle. */
@media (min-width: 901px) {
    .vg-pdp-gallery { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
    .vg-pdp-top { align-items: stretch; }
    .vg-pdp-intro { align-self: end; }
    .vg-pdp-buy { align-self: start; }
}

/* Buy bar: the last block of the content. It sticks to the bottom of the screen while the page is above it and rests right above the footer at the end of the page. */
.vg-pdp-bar { position: sticky; top: auto; bottom: 0; inset-inline: auto; width: 100%; transform: none; transition: none; }
.vg-pdp-bar:not(.is-visible) { height: 0; overflow: hidden; border: 0; box-shadow: none; visibility: hidden; }

/* While the bar floats at the bottom of the screen, the cookie icon (bottom right) would sit on top of its button: it is hidden,
   and shown again once the page is at its end and the bar rests above the footer. */
/* VG-066: the floating widgets (cookie icon, accessibility button) are hidden while the bar floats at the bottom (they overlapped its button and took its room: the title was squeezed). */
body:has(.vg-pdp-bar.is-visible:not(.is-docked)) :is(.silktide-cookie-icon, #silktide-cookie-icon, [id^="silktide-cookie-icon"]) { display: none !important; }
/* The accessibility button is only made invisible (not removed): taking it out of the widget's layout stretched the widget panel over the whole page height. An opened panel stays. */
body:has(.vg-pdp-bar.is-visible:not(.is-docked)) #vplugin._vp_open_false #vplugin-toggler { visibility: hidden; pointer-events: none; }

/* A name longer than 100 characters makes the text column tall: the picture is a little smaller then. */
.vg-pdp-top.has-long-title .vg-pdp-zoom { max-width: 380px; }
@media (max-width: 900px) { .vg-pdp-top.has-long-title .vg-pdp-zoom { max-width: 170px; } }

/* Opening the enlarged picture hides the page scrollbar: its space is kept so the page does not jump sideways. */
html:has(dialog.vg-pdp-lightbox[open]) { overflow: hidden; scrollbar-gutter: stable; }

/* Phone: the gallery frame is exactly 220px tall for a single picture (min and max; the picture is centered in it), at most 220px tall (picture 194px + 12px padding and 1px border on each side). With thumbnails it grows as needed. */
@media (max-width: 900px) {
    .vg-pdp-gallery { box-sizing: border-box; min-height: 220px; display: flex; flex-direction: column; justify-content: center; }
    .vg-pdp-gallery:not(:has(.vg-pdp-thumbs)) { max-height: 220px; overflow: hidden; }
}

/* The accessibility widget sits above the buy bar (the bar is opaque and was drawn over it); the bar content leaves room for it on the left. */
.vplugin-toggler, #vplugin-toggler { z-index: 100 !important; }

/* VG-066: on a phone the product name in the bar may take two lines and uses all the space left by the price and the button. */
@media (max-width: 600px) {
    .vg-pdp-bar-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; line-height: 1.25; overflow-wrap: anywhere; }
}
