/* White, not var(--color-surface) (2026-07-26 correction, same reasoning
   as the product-card image fix): the contain-fit photo rarely fills its
   box edge-to-edge, so a gray backdrop here read as a gray panel behind
   the product rather than the product "sitting" on a clean white page. */
.store-detail-image { width:100%; max-height:480px; object-fit:contain; object-position:center; display:block; background:#fff; }
.product-detail { --product-border:var(--color-border); --product-muted:var(--color-text-muted); }
.product-detail-layout { display:grid; grid-template-columns:minmax(0, 1.35fr) minmax(320px, 1fr); gap:2rem; align-items:start; }
.product-detail-media, .product-summary { min-width:0; border:1px solid var(--product-border); border-radius:16px; background:#fff; box-shadow:0 10px 30px rgba(16,24,40,.06); overflow:hidden; }
.product-summary { padding:clamp(1.25rem, 3vw, 2rem); }
.product-summary-category { display:inline-flex; align-items:center; padding:.35rem .7rem; border:1px solid var(--color-brand-border); border-radius:999px; color:var(--color-brand-active); background:var(--color-brand-soft); font-size:.85rem; font-weight:500; }
.product-summary-manufacturer { display:inline-flex; align-items:center; margin-left:.5rem; color:var(--color-text-muted); font-size:.9rem; font-weight:500; }
.product-summary-manufacturer img { max-height:28px; max-width:120px; object-fit:contain; vertical-align:middle; }
.product-specifications-group-title { margin:1rem 0 .4rem; color:var(--color-text); font-size:.95rem; font-weight:600; }
.product-specifications-group-title:first-child { margin-top:0; }
.product-faq-list { display:flex; flex-direction:column; gap:1rem; }
.product-faq-question { margin:0 0 .3rem; color:var(--color-heading); font-weight:600; }
.product-faq-answer { margin:0; color:var(--color-text-muted); line-height:1.6; }
.product-video-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:1.25rem; }
.product-video-card { display:flex; flex-direction:column; }
.product-video-facade { position:relative; display:block; width:100%; padding:0; border:0; border-radius:10px; overflow:hidden; background:#0b0d10; cursor:pointer; aspect-ratio:16/9; }
.product-video-facade:focus-visible { outline:2px solid var(--color-focus); outline-offset:2px; }
.product-video-thumb { width:100%; height:100%; object-fit:cover; display:block; }
.product-video-thumb-empty { display:block; width:100%; height:100%; background:linear-gradient(135deg,#1c1f25,#2b2f36); }
.product-video-play-icon { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; transition:transform .15s ease; }
.product-video-facade:hover .product-video-play-icon, .product-video-facade:focus-visible .product-video-play-icon { transform:scale(1.08); }
.product-video-embed { display:block; width:100%; aspect-ratio:16/9; border:0; border-radius:10px; overflow:hidden; background:#0b0d10; }
.product-video-meta { padding-top:.6rem; }
.product-video-title { margin:0 0 .25rem; font-size:.95rem; font-weight:600; color:var(--color-heading); }
.product-video-desc { margin:0; font-size:.9rem; color:var(--color-text-muted); line-height:1.6; }
.product-summary-title { margin:.9rem 0 .4rem; color:var(--color-heading); font-size:clamp(1.75rem, 3vw, 2.5rem); line-height:1.15; }
.product-meta-line { display:flex; flex-wrap:wrap; gap:.25rem 1rem; margin:0 0 .75rem; color:var(--product-muted); font-size:.9rem; }
.product-meta-line strong { color:var(--color-text); font-weight:600; }
.product-summary-lead { margin:0 0 1.25rem; color:var(--product-muted); font-size:1rem; line-height:1.65; }
.product-tag-list { display:flex; flex-wrap:wrap; gap:.4rem; list-style:none; margin:0 0 .75rem; padding:0; }
.product-tag-list a { display:inline-flex; padding:.2rem .6rem; border-radius:999px; background:var(--color-surface-alt); color:var(--color-text); font-size:.85rem; text-decoration:none; }
.product-tag-list a:hover { background:var(--color-border); }
.product-entity-line { margin:0 0 .75rem; color:var(--product-muted); font-size:.88rem; }
.product-price {
  display:flex;
  flex-direction:row;
  flex-wrap:wrap;
  align-items:baseline;
  gap:.3rem .55rem;
  min-width:0;
  margin-bottom:1rem;
  color:var(--color-brand-text);
  font-size:clamp(1.8rem, 3vw, 2.35rem);
  font-weight:700;
  line-height:1.2;
}
.product-price-primary { white-space:nowrap; }
.product-price-secondary { color:var(--product-muted); font-size:1rem; font-weight:400; }
.product-price-was { color:var(--product-muted); font-size:1.15rem; font-weight:500; text-decoration:line-through; }
.product-price-savings { flex-basis:100%; color:var(--color-success-text); font-size:.95rem; font-weight:500; }
.product-badges { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin-bottom:.25rem; }
.product-availability { display:inline-flex; align-items:center; gap:.45rem; padding:.4rem .7rem; border-radius:999px; font-size:.88rem; font-weight:600; }
.product-availability::before { width:.5rem; height:.5rem; border-radius:50%; background:currentColor; content:""; }
.product-availability.is-available { color:var(--color-success-text); background:var(--color-success-surface); }
.product-availability.is-unavailable { color:var(--color-danger-text); background:var(--color-danger-surface); }
.product-type-badge { display:inline-flex; align-items:center; padding:.4rem .7rem; border-radius:999px; font-size:.88rem; font-weight:600; }
.product-type-badge.is-digital { color:#3730a3; background:#e0e7ff; }
.product-promo-badge { display:inline-flex; align-items:center; padding:.4rem .7rem; border-radius:999px; color:var(--color-danger-contrast); background:var(--color-danger); font-size:.88rem; font-weight:600; }
.product-gallery-promo-badge { position:absolute; top:.75rem; left:.75rem; z-index:2; padding:.35rem .65rem; border-radius:999px; color:var(--color-danger-contrast); background:var(--color-danger); font-size:.85rem; font-weight:600; box-shadow:0 2px 8px rgba(0,0,0,.18); }
/* No active promotion (server-rendered [hidden], or JS clears the text on
   variant switch): fully collapse, never a residual empty red pill. A bare
   class selector for `display` always beats the UA default [hidden]{display:none}
   rule (author origin wins ties), so [hidden] must be restated here at
   matching-or-higher specificity. :empty is a second safety net for the
   moment between clearing textContent and the hidden attribute landing. */
.product-promo-badge[hidden],
.product-promo-badge:empty { display:none; padding:0; margin:0; min-width:0; background:none; }
.product-gallery-promo-badge[hidden],
.product-gallery-promo-badge:empty { display:none; padding:0; margin:0; min-width:0; background:none; box-shadow:none; }
.product-purchase-note { margin:.75rem 0 0; color:var(--product-muted); font-size:.88rem; }
.product-purchase-note-highlight { padding:.6rem .85rem; border-radius:10px; color:#664d03; background:#fff8e1; font-weight:600; }
.product-purchase { margin-top:1.25rem; }
.product-purchase-row { display:flex; align-items:end; gap:.75rem; }
.product-quantity { flex:0 0 88px; }
.product-quantity .form-control { min-height:48px; text-align:center; }
.product-add-button { min-height:48px; flex:1 1 auto; font-weight:600; box-shadow:0 5px 14px var(--color-brand-shadow); }
.product-add-button:hover { transform:translateY(-1px); box-shadow:0 7px 18px var(--color-brand-shadow-hover); }
.product-add-button:focus-visible, .product-quantity .form-control:focus-visible { outline:3px solid var(--color-focus); outline-offset:2px; }
.product-service-summary { list-style:none; margin:1.1rem 0 0; padding:.85rem 1rem 0; border-top:1px solid var(--product-border); display:flex; flex-direction:column; gap:.4rem; color:var(--product-muted); font-size:.9rem; }
.product-service-summary li { padding-left:1.4rem; position:relative; }
.product-service-summary li::before { content:"✓"; position:absolute; left:0; color:var(--color-success-text); font-weight:700; }

.product-image-placeholder { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.75rem; padding:4rem 1.5rem; color:var(--color-text-muted); background:var(--color-surface); }

.product-detail-accordion { margin-top:2rem; }
.product-detail-accordion .accordion-item { border:1px solid var(--product-border); border-radius:16px !important; overflow:hidden; box-shadow:0 8px 24px rgba(16,24,40,.04); }
.product-detail-accordion .accordion-item + .accordion-item { margin-top:1rem; }
.product-detail-accordion .accordion-button { font-weight:600; color:var(--color-text); background:#fff; }
.product-detail-accordion .accordion-button:not(.collapsed) { color:var(--color-brand-active); background:var(--color-brand-soft); box-shadow:inset 0 -1px 0 var(--product-border); }
.product-detail-accordion .accordion-button:focus { box-shadow:0 0 0 3px var(--color-focus-ring-subtle); }
.product-description { color:var(--color-text); line-height:1.75; overflow-wrap:anywhere; }

/* YouTube lazy-embed facade (see storeLazyYoutubeEmbeds() in index.php and
   assets/js/store-youtube-facade.js). Same 16:9 box in both the facade and
   activated-iframe state, so clicking play never shifts layout. */
.store-yt-facade { position:relative; display:block; width:100%; max-width:100%; aspect-ratio:16/9; overflow:hidden; border-radius:12px; background:#000; cursor:pointer; margin:.75rem 0; }
.store-yt-facade-thumb { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.store-yt-facade-play { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.15); transition:background-color .15s ease; }
.store-yt-facade:hover .store-yt-facade-play, .store-yt-facade:focus-visible .store-yt-facade-play { background:rgba(0,0,0,.3); }
.store-yt-facade:focus-visible { outline:3px solid var(--color-focus-ring-strong); outline-offset:2px; }
.store-yt-facade-frame { position:absolute; inset:0; width:100%; height:100%; border:0; }
.product-additional-list { display:grid; grid-template-columns:minmax(130px, .35fr) 1fr; margin:0; }
.product-additional-list dt, .product-additional-list dd { margin:0; padding:.65rem 0; border-bottom:1px solid var(--color-border); }
.product-additional-list dt { color:var(--product-muted); font-weight:500; }
.product-additional-list dd { color:var(--color-text); font-weight:500; overflow-wrap:anywhere; }
.product-additional-list dt:last-of-type, .product-additional-list dd:last-of-type { border-bottom:0; }

.product-related { margin-top:2.5rem; }
.product-related h2 { margin:0 0 1rem; color:var(--color-text); font-size:1.2rem; }

/* Plain CSS grid — this page never loads Bootstrap, so the old
   .row.row-cols-*.g-3 classes never actually applied any layout: cards
   were stacking as unconstrained full-width blocks. 1 / 2 / 3 / 4 columns
   at mobile / tablet / laptop / desktop, fixed gap, no overflow (grid
   tracks are 1fr, so the row can never exceed the container's width). */
.product-related-grid { display:grid; grid-template-columns:1fr; gap:1.25rem; }
@media (min-width:576px) { .product-related-grid { grid-template-columns:repeat(2, 1fr); } }
@media (min-width:992px) { .product-related-grid { grid-template-columns:repeat(3, 1fr); } }
@media (min-width:1400px) { .product-related-grid { grid-template-columns:repeat(4, 1fr); } }

.product-related-card { height:100%; display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--product-border,var(--color-border)); border-radius:14px; background:#fff; box-shadow:0 1px 2px rgba(16,24,40,.04); transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.product-related-card:hover { transform:translateY(-3px); border-color:var(--color-primary-border-subtle); box-shadow:0 12px 28px rgba(16,24,40,.09); }

/* Fixed-ratio image zone: never lets a large original dictate the card's
   size — the box is always 4/3 (capped at 230px tall) regardless of the
   source image's own dimensions, and object-fit:contain keeps the whole
   product visible without cropping. */
.product-related-image-link { display:block; aspect-ratio:4/3; max-height:230px; overflow:hidden; background:#fff; border-bottom:1px solid var(--product-border,var(--color-border)); }
.product-related-image { width:100%; height:100%; display:block; object-fit:contain; object-position:center; }
.product-related-image-placeholder { display:flex; align-items:center; justify-content:center; color:var(--product-muted,var(--color-text-muted)); font-size:.82rem; }

.product-related-body { min-width:0; padding:1.1rem 1rem; display:flex; flex:1 1 auto; flex-direction:column; align-items:center; text-align:center; }
.product-related-name { margin:0 0 .6rem; display:-webkit-box; overflow:hidden; font-size:.95rem; font-weight:600; line-height:1.35; min-height:2.7em; overflow-wrap:anywhere; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.product-related-name a { color:var(--color-text); text-decoration:none; }
.product-related-footer { width:100%; display:flex; flex-direction:column; align-items:center; gap:.9rem; margin-top:auto; }
.product-related-cta { width:100%; font-weight:600; }
.product-related-card a:focus-visible { outline:3px solid var(--color-focus); outline-offset:3px; }

@media (max-width:991.98px) { .product-detail-layout { grid-template-columns:1fr; gap:1.25rem; } }
@media (max-width:575.98px) {
  .product-summary { padding:1.15rem; }
  .product-purchase-row { align-items:stretch; flex-direction:column; }
  .product-quantity { width:100%; flex-basis:auto; }
  .product-quantity .form-control { text-align:left; }
  .product-add-button { width:100%; }
  /* Sticky (not fixed) add-to-cart on narrow mobile — the exact same
     single form/button, just pinned to the bottom of its own
     .product-summary panel while that panel is on screen. Because
     position:sticky is bounded by its containing block, it can never
     cover the accordion/related-products content below: once the page
     scrolls past the end of .product-summary, this stops sticking
     together with it — no separate fixed overlay, no duplicated form,
     no double-submit risk. */
  .product-purchase {
    position:sticky;
    bottom:0;
    z-index:5;
    margin:1.25rem -1.15rem -1.15rem;
    padding:.85rem 1.15rem calc(.85rem + env(safe-area-inset-bottom, 0px));
    background:var(--color-background);
    border-top:1px solid var(--product-border);
    box-shadow:0 -6px 18px rgba(16,24,40,.08);
  }
  .product-additional-list { grid-template-columns:1fr; }
  .product-additional-list dt { padding-bottom:.1rem; border-bottom:0; }
  .product-additional-list dd { padding-top:.1rem; }
}

/* ===== Merged from store-gallery.css =====
   store-product.css and store-gallery.css are always <link>-ed together on
   every product-detail page (see index.php) — never one without the other —
   so this is a pure request-count reduction, not a duplication risk. No
   selector names overlap with anything above. */
/* White, same reasoning as .store-detail-image above. */
.product-gallery-main { min-height:320px; position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden; background:#fff; border-radius:calc(.375rem - 1px) calc(.375rem - 1px) 0 0; }
.product-gallery-open { width:100%; padding:0; border:0; display:flex; align-items:center; justify-content:center; background:transparent; cursor:zoom-in; }
.product-gallery-open picture { width:100%; display:block; }
.product-gallery-main .store-detail-image { height:480px; }
.product-gallery-arrow { width:44px; height:44px; position:absolute; top:50%; z-index:2; display:flex; align-items:center; justify-content:center; transform:translateY(-50%); border:0; border-radius:50%; color:#212529; background:rgba(255,255,255,.9); box-shadow:0 2px 12px rgba(16,24,40,.18); font-size:1.7rem; line-height:1; transition:background-color .15s ease, transform .15s ease; }
.product-gallery-arrow:hover { background:#fff; transform:translateY(-50%) scale(1.06); }
.product-gallery-arrow-prev { left:1rem; }
.product-gallery-arrow-next { right:1rem; }
.product-gallery-thumbnails { display:flex; gap:.75rem; overflow-x:auto; padding:1rem; border-top:1px solid var(--color-border); scrollbar-width:thin; }
.product-gallery-thumbnail { width:88px; height:88px; flex:0 0 88px; padding:5px; display:flex; align-items:center; justify-content:center; background:#fff; border:2px solid var(--color-border); border-radius:10px; cursor:pointer; transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.product-gallery-thumbnail:hover { border-color:var(--color-primary-border-subtle); box-shadow:0 4px 12px rgba(16,24,40,.12); transform:translateY(-2px); }
.product-gallery-thumbnail.is-active { border-color:var(--color-brand-text); box-shadow:0 0 0 3px var(--color-focus-ring-subtle); }
/* ---- desktop: vertical thumbnail rail to the left of the main image
   (2026-07-26 correction) — replaces thumbnails-below-the-image. order:-1
   moves them first visually without reordering the DOM (the gallery JS
   selects by data-attribute, not position, so this is purely visual).
   Mobile keeps the original horizontal strip below the image — a side
   rail wouldn't leave enough width for a usable main image there. */
@media (min-width:576px) {
  .product-gallery { display:flex; align-items:flex-start; gap:1rem; padding:1rem; }
  .product-gallery-main { order:1; flex:1 1 auto; min-width:0; border-radius:12px; }
  .product-gallery-thumbnails {
    order:-1;
    flex:0 0 88px;
    flex-direction:column;
    max-height:480px;
    overflow-x:visible;
    overflow-y:auto;
    padding:0;
    border-top:0;
  }
}
.product-gallery-open:focus-visible, .product-gallery-arrow:focus-visible, .product-gallery-thumbnail:focus-visible, .product-lightbox-control:focus-visible { outline:3px solid var(--color-focus-border); outline-offset:3px; }
.product-gallery-thumbnail img { width:100%; height:100%; object-fit:contain; object-position:center; display:block; }
.product-gallery-thumbnail picture { width:100%; height:100%; display:block; }
.product-lightbox[hidden] { display:none; }
.product-lightbox { position:fixed; inset:0; z-index:1080; padding:1.5rem; display:flex; align-items:center; justify-content:center; color:#fff; background:rgba(0,0,0,.92); }
.product-lightbox-stage { width:100%; height:100%; position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.product-lightbox-stage > picture { display:flex; align-items:center; justify-content:center; }
.product-lightbox-image { max-width:calc(100vw - 8rem); max-height:calc(100vh - 6rem); width:auto; height:auto; object-fit:contain; cursor:zoom-in; transform:scale(1); transform-origin:center; transition:transform .2s ease; user-select:none; -webkit-user-drag:none; }
.product-lightbox-image.is-zoomed { transform:scale(2); cursor:zoom-out; }
.product-lightbox-control { width:48px; height:48px; position:absolute; z-index:2; display:flex; align-items:center; justify-content:center; border:0; border-radius:50%; color:#fff; background:rgba(255,255,255,.14); font-size:2rem; line-height:1; transition:background-color .15s ease; }
.product-lightbox-control:hover { background:rgba(255,255,255,.26); }
.product-lightbox-close { top:0; right:0; }
.product-lightbox-prev { left:0; top:50%; transform:translateY(-50%); }
.product-lightbox-next { right:0; top:50%; transform:translateY(-50%); }
.product-lightbox-counter { position:absolute; left:50%; bottom:0; z-index:2; transform:translateX(-50%); padding:.35rem .75rem; border-radius:999px; background:rgba(0,0,0,.55); font-variant-numeric:tabular-nums; }
body.product-lightbox-open { overflow:hidden; }
@media (max-width:575.98px) {
  .product-gallery-main { min-height:240px; }
  .product-gallery-main .store-detail-image { height:320px; }
  .product-gallery-arrow { width:40px; height:40px; }
  .product-gallery-arrow-prev { left:.5rem; }
  .product-gallery-arrow-next { right:.5rem; }
  .product-gallery-thumbnail { width:80px; height:80px; flex-basis:80px; }
  .product-lightbox { padding:.75rem; }
  .product-lightbox-image { max-width:calc(100vw - 1.5rem); max-height:calc(100vh - 5rem); }
  .product-lightbox-control { width:42px; height:42px; }
}
