/* Product refinement (after configurator, atelier, photo-gallery and order-diagram styles).
   Phone ≤ 767 px: one column. From 768 px: two columns with a sticky gallery. One rhythm and one "name · value" header for every step. */
.product-page{--galeria-h:min(560px,calc(100svh - 250px))}
.product-page .product-scene{align-self:stretch;min-width:0;overflow:visible}
.product-page .buy{padding-top:24px}
.product-page .product-breadcrumb{flex-wrap:wrap;gap:7px}
.product-page .product-breadcrumb a{min-height:24px}

/* ---------- gallery: photo 4:3 with the counter on it, thumbnails right below; the last thumbnail opens the diagram ---------- */
.product-page .photo-gallery-count{position:absolute;z-index:4;right:10px;bottom:10px;padding:2px 8px;border-radius:999px;background:rgb(16 21 23 / .72);color:#f1f0e9;font-size:12px;line-height:1.5;font-variant-numeric:tabular-nums;pointer-events:none}
.product-page .photo-gallery:has(.order-diagram-panel:not([hidden])) .photo-gallery-count{display:none}
/* position:relative keeps the sr-only label of the pattern thumbnail inside its button: without it the label is placed against
   .scene-sticky and widens the phone page past the screen (R2 P1-1; scripts/tests/product-thumbs.cjs). */
.product-page .thumbs.photo-thumbs button{flex-basis:72px;position:relative}
.product-page .thumbs.photo-thumbs .thumb-schemat{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;color:#d9dcd9;cursor:pointer}
.product-page .thumbs.photo-thumbs .thumb-schemat[aria-pressed=true]{color:#dfc4a0}
.product-page .thumb-schemat svg{width:40px;height:28px;overflow:visible}
.product-page .thumb-schemat-sil{fill:none;stroke:currentColor;stroke-width:1.3;vector-effect:non-scaling-stroke}
.product-page .thumb-schemat-dim{fill:none;stroke:currentColor;stroke-width:1;opacity:.7;vector-effect:non-scaling-stroke}
.product-page .thumbs .thumb-schemat-name{padding:0;font-size:11px;line-height:1.1;color:inherit}

/* ---------- steps: one gap, one header pattern ---------- */
.product-page .step{padding:0;margin-top:28px;gap:10px}
.product-page #config-size{margin-top:16px}
.product-page .lbl{min-height:24px}
.product-page .lbl .val,.product-page .addons-toggle .val{display:inline;margin:0 0 0 3px;font:400 15px/1.3 var(--sans);color:var(--fg-2);text-align:left}
.product-page .lbl .val::before,.product-page .addons-toggle .val::before{content:"·\00a0";content:"·\00a0"/""}
.product-page .ori-btn{min-height:44px}
.product-page .ori-btn span{display:inline}

/* Glass: two joined segments, name and full price in one row. */
.product-page .szklo{gap:0;border-radius:var(--r-btn);box-shadow:0 0 0 1px var(--linia-ui)}
.product-page .szklo .gl{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:2px 8px;min-height:0;padding:10px 12px;border-radius:0;box-shadow:none;text-align:left}
.product-page .szklo .gl+.gl{box-shadow:-1px 0 0 var(--linia-ui)}
.product-page .szklo .gl:has(input:checked){box-shadow:inset 0 0 0 2px #e4cbab}
.product-page .szklo .gl-name,.product-page .szklo .gl-amt{margin:0;font-size:15px}
.product-page .szklo .gl-amt{order:1}
.product-page .szklo .gl-cap{order:2;flex-basis:100%;display:block;font-size:12px;line-height:1.35;color:var(--fg-2)}
.product-page .szklo .gl-znacznik{display:none}

/* Light: the switch says its state in words. Switched off, the colours are dimmed and none looks chosen; a click still lights the mirror. */
.product-page.off .wl-barwy label{opacity:.5}
.product-page.off .wl-barwy label:has(input:checked){background:#ffffff03!important;border-color:#ffffff13!important;color:var(--jasny-2)}
.product-page.off .wl-barwy label:has(input:checked) .wl-b-nazwa{font-weight:400}
.product-page.off .wl-barwy label:has(input:checked)::before{transform:scaleX(.55);opacity:.35}
.product-page.off .wl-barwy label:hover,.product-page.off .wl-barwy label:has(:focus-visible){opacity:1}
.product-page .wlacznik{padding:2px 0 8px!important}
.product-page .wl-klawisz::after{content:"wył.";position:absolute;left:50%;top:calc(100% + 5px);translate:-50% 0;font-size:12px;line-height:1.2;color:var(--fg-2);white-space:nowrap;pointer-events:none}
.product-page .wl-klawisz:has(input:checked)::after{content:"wł.";color:var(--fg)}

/* Pattern: compact cards, visible without a click; the oval icon turns with the hanging orientation. */
.product-page .pats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.product-page .pats .pat{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;aspect-ratio:auto;min-height:88px;padding:8px 4px 6px;text-align:center}
.product-page .pat svg{width:44px;height:44px;flex:none;transition:rotate .25s ease}
.product-page .pat .pat-label{font-size:12px;line-height:1.25;color:var(--fg);white-space:normal}
.product-page .configurator:has([name="pr_orientation"][value="horizontal"]:checked) .pats[data-follows-orientation] svg{rotate:90deg}
/* Rectangle: the icon frame follows the chosen hanging; bars keep their direction on the wall (functions.php, proporia_ui_pattern_icon). */
.product-page .pat .pat-v{display:none}
.product-page .configurator:has([name="pr_orientation"][value="vertical"]:checked) .pat .pat-h{display:none}
.product-page .configurator:has([name="pr_orientation"][value="vertical"]:checked) .pat .pat-v{display:inline}
.product-page .pattern-note{font-size:13px;line-height:1.5;color:var(--fg-2)}
.product-page .pattern-note summary{width:fit-content;cursor:pointer;min-height:44px;box-sizing:border-box;padding-block:12px;text-decoration:underline;text-underline-offset:4px}
.product-page .front-step:has(.pat input[value="halo"]:checked) .pattern-note{display:none}

/* Add-ons: the header shows what is chosen ("brak" until something is). */
.product-page .addons-toggle{min-height:44px;padding:0}

/* ---------- purchase: the button on every width, the diagram as a text link under it ---------- */
.product-page .cta{padding-top:28px}
.product-page .cta .add-to-cart{display:flex}
.product-page .purchase-diagram{display:inline-flex;align-items:center;gap:8px;align-self:flex-start;min-height:44px;margin:0;padding:0;border:0;background:none;color:var(--fg);font:400 15px/1.3 var(--sans);text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:1px;cursor:pointer}
.product-page .purchase-diagram svg{width:18px;height:18px;flex:none}
.product-page .purchase-diagram[aria-pressed=true]{color:#dfc4a0}
/* Bottom bar only while neither the price under the title nor the purchase button is on screen (proporia.js sets .cta-away). */
.product-page:not(.cta-away) .mobile-purchase{display:none}
.product-page.cta-away .mobile-purchase{padding-block:8px}
.product-page.cta-away .mobile-purchase .btn{min-height:44px}

/* Numbers never part from their units. */
.product-page :is([data-total-price],.gl-amt,.size-opt-price,.amt,.wl-b-k,.size-trigger-label,.size-opt-label){white-space:nowrap}

/* "Other forms": price under the name, not squeezed beside it. */
.product-page .other-forms .form-tile-name{flex-direction:column;justify-content:flex-start;gap:2px}
/* Photos melt into the section at the bottom, like the home and catalogue cards (Jacek 11.11); the tile keeps the section colour on hover. */
.product-page .other-forms .form-tile-art img{-webkit-mask-image:linear-gradient(0deg,transparent,#000 12%);mask-image:linear-gradient(0deg,transparent,#000 12%)}
.product-page .other-forms .form-tile-art,.product-page .other-forms .form-tile:hover .form-tile-art{background:transparent}

.product-page .model-copy,.product-page .model-copy p,.product-page .model-copy li,
.product-page .editorial-copy p,.product-page .faq-list p,.product-page .faq-list dd{color:var(--fg-2,#b5bdbe)}
.product-page .model-copy h2,.product-page .model-copy h3,.product-page .faq-list summary{color:var(--fg,#f1f0e9)}

/* ---------- two columns from 768 px: sticky gallery sized by the window height, thumbnails always visible ---------- */
@media(min-width:768px){
    .product-page .scene-sticky{position:sticky;top:96px;gap:10px;width:min(100%,calc(var(--galeria-h) * 1200 / 896));margin-inline:auto}
    .product-page .scene-sticky:has(.order-diagram-panel:not([hidden])){position:sticky}
    .product-page .scene.photo-gallery{width:100%;height:auto;min-height:0;aspect-ratio:1200/896}
    .product-page .scene.photo-gallery:has(.order-diagram-panel:not([hidden])){aspect-ratio:auto;max-height:calc(100svh - 250px);overflow:auto;scrollbar-width:thin;scrollbar-color:var(--fg-2) var(--bg)}
    /* The drawing with its size label fits the first view of the panel (1366 × 768); the legend may scroll below it. */
    .product-page .order-diagram .order-diagram__svg{max-height:max(220px,calc(100svh - 410px))}
    /* Thumbnails share the photo width (8–9 fit beside a 4:3 photo); below 56 px the strip scrolls. */
    .product-page .thumbs.photo-thumbs button{flex:1 1 0;min-width:56px;max-width:88px}
    .product-page .mobile-purchase .bar-cta-short{display:none}
}
@media(min-width:768px) and (max-width:1023px){
    .product-page .product-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px}
}
/* Narrow decision column: icon above the label, so "Dotyk na tafli" never breaks unevenly. */
@media(min-width:768px) and (max-width:1099px){
    .product-page .segmenty .opt{flex-direction:column;gap:4px;min-height:60px;font-size:14px}
}
/* 768–800 px: the shared ≤ 800 px phone rules (configurator, atelier, photo-gallery) are undone for the two-column tablet layout. */
@media(min-width:768px) and (max-width:800px){
    .product-page .product-layout{display:grid;align-items:start}
    .product-page .buy{display:block;padding:8px 0 48px}
    .product-page .configurator{display:block}
    .product-page .product-scene{order:0;margin-inline:0;padding:16px 0 32px}
    .product-page .scene-sticky{top:16px}
    .product-page .product-breadcrumb{padding-top:0}
    .product-page .thumbs.photo-thumbs{padding-inline:0}
    .product-page .photo-gallery:has(.order-diagram-panel:not([hidden])){margin-inline:0}
}
@media(min-width:801px) and (max-height:700px){
    .product-page .scene-sticky{top:84px;gap:6px}
    .product-page .thumbs.photo-thumbs button{flex-basis:60px}
}

/* ---------- phone ---------- */
@media(max-width:767px){
    .product-page .scene-sticky{position:relative;top:auto;gap:8px}
    .product-page .scene.photo-gallery{height:auto;min-height:0;aspect-ratio:4/3;max-height:58svh}
    .product-page .scene.photo-gallery:has(.order-diagram-panel:not([hidden])){max-height:none;overflow:visible;aspect-ratio:auto}
    .product-page .buy{padding-top:16px}
    .product-page .step{margin-top:24px}
    .product-page .pats{grid-template-columns:repeat(3,minmax(0,1fr))}
    /* Touch targets ≥ 44 px: breadcrumbs and the delivery page link. */
    .product-page .product-breadcrumb a,.product-page .pay a{display:inline-flex;align-items:center;min-height:44px}
    /* Bar: price and button on one line, the configuration in one short line; the delivery term stays under the button in the page. */
    .product-page .mobile-purchase .mini,.product-page .bar-term,.product-page .bar-term-krotki,.product-page .mobile-purchase .bar-cta-long{display:none}
    .product-page .mobile-price{min-width:0;overflow:hidden}
    .product-page .bar-line{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:360px){
    .product-page .wl-barwy label{padding-inline:5px!important}
    .product-page .wl-b-nazwa{font-size:14px!important}
    .product-page .wl-b-k{font-size:12px!important}
    .product-page.cta-away .mobile-purchase{gap:10px}
    .product-page.cta-away .mobile-purchase .btn{padding-inline:16px}
}
