/* =========================================
   PAGE HEADER / BREADCRUMBS
   (verbatim from the original — same pattern as the catalog page)
   ========================================= */
.product-section { padding: 10px 0 100px; }

.page-header { padding: 10px 0 20px; border-bottom: 1px solid var(--border-light); margin-bottom: 30px; }

.breadcrumbs {
    display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary);
    margin-bottom: 15px; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.breadcrumbs::-webkit-scrollbar { display: none; }
.breadcrumbs > * { flex-shrink: 0; }
.breadcrumbs a { color: var(--text-secondary); transition: 0.3s; }
@media (hover: hover) and (pointer: fine) {
    .breadcrumbs a:hover { color: var(--accent-gold); }
}
.breadcrumbs i { font-size: 9px; color: var(--text-muted); }
.breadcrumbs span { color: var(--text-secondary); }

.product-title { font-size: 32px; font-weight: 500; line-height: 1.4; color: var(--text-main); margin-bottom: 20px; max-width: 800px; }
.title-meta { display: flex; justify-content: flex-end; margin-top: -10px; width: 100%; }

/* =========================================
   PRODUCT LAYOUT: GALLERY + DETAILS
   ========================================= */
.product-container { display: grid; grid-template-columns: 35% 1fr; gap: 60px; align-items: flex-start; }

.product-gallery { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 120px; }
.main-image-wrapper {
    width: 100%; aspect-ratio: 1 / 1; background: var(--bg-soft); border-radius: 4px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-light);
    position: relative; cursor: pointer; touch-action: pan-y;
}
.main-image-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
@media (hover: hover) and (pointer: fine) {
    .main-image-wrapper:hover img { transform: scale(1.03); }
}

.thumbnails { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.thumb-btn { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 4px; background: var(--bg-soft); border: 1px solid var(--border-light); overflow: hidden; cursor: pointer; opacity: 0.6; transition: all 0.3s ease; }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.thumb-btn.active { opacity: 1; border-color: var(--accent-gold); }
@media (hover: hover) and (pointer: fine) {
    .thumb-btn:hover { opacity: 1; border-color: var(--accent-gold); }
}

/* Wishlist/share icon pair, floating over the top-right corner of the
   main product photo — same quiet frosted-glass look as the recommendation
   carousel's scroll arrows (css/overlays.css .reco-scroll-btn): a faint
   tinted glass circle with a soft blur, not a solid dark badge, so it
   reads as a subtle overlay control rather than another loud button.
   Stacked vertically here since the product page only has one image slot
   to anchor to (a catalog card anchors one icon per corner instead). */
.image-float-actions {
    position: absolute; top: 12px; right: 12px; z-index: 6;
    display: flex; flex-direction: column; gap: 10px;
}
.img-float-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.88); border: 1px solid var(--border-light);
    -webkit-backdrop-filter: var(--blur-control); backdrop-filter: var(--blur-control);
    color: var(--navy); box-shadow: var(--shadow-soft); display: flex; align-items: center; justify-content: center;
    font-size: 14px; cursor: pointer; transition: all 0.25s ease;
}
/* Without the blur (html.no-blur / reduced transparency, see css/base.css)
   the near-transparent glass tint alone can get lost over a light part of
   the photo — a darker tint keeps the icons readable. */
html.no-blur .img-float-btn { background: #fff; }
@media (prefers-reduced-transparency: reduce) {
    .img-float-btn { background: #fff; }
}
@media (hover: hover) and (pointer: fine) {
    .img-float-btn:hover { background: var(--accent-soft); color: var(--accent-gold); border-color: var(--accent-gold); }
}
.img-float-btn:active { transform: scale(0.9); }
.img-float-btn.w-active { color: var(--accent-gold); border-color: var(--accent-gold); }
.img-float-btn.w-active i { animation: heartJump 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* Instagram-style outline heart glyph (its actual web icon path, not Font
   Awesome's fatter fa-heart) — thin stroke, no fill. Liked state fills the
   heart with the current (gold, not IG's red — keeps the site's own
   accent instead of borrowing Instagram's brand color) instead of
   swapping in a different icon. */
.ig-heart { width: 20px; height: 20px; display: block; }
.img-float-btn.w-active .ig-heart { fill: currentColor; }

/* Share icon: the exact reference PNG supplied (icon/share-icon.png),
   recolored via CSS mask instead of an <img> so it still picks up
   currentColor (matches the button's hover/active color transitions the
   same way the heart's stroke does) rather than being stuck one fixed
   color forever. */
.ig-send {
    width: 20px; height: 20px; display: block; background-color: currentColor;
    -webkit-mask-image: url('../icon/share-icon.png'); mask-image: url('../icon/share-icon.png');
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
}

/* Reviews shortcut icon — same reference-PNG-as-mask technique as .ig-send
   above, so it's a third icon in the same floating stack. */
.ig-reviews {
    width: 19px; height: 19px; display: block; background-color: currentColor;
    -webkit-mask-image: url('../icon/reviews-icon.png'); mask-image: url('../icon/reviews-icon.png');
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
}

.mobile-gallery-dots { display: none; position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); gap: 8px; z-index: 10; }
.mg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); cursor: pointer; transition: 0.3s; }
.mg-dot.active { background: var(--accent-gold); width: 24px; border-radius: 4px; }

/* =========================================
   PRODUCT DETAILS / PURCHASE AREA
   ========================================= */
.product-details { display: flex; flex-direction: column; }

.meta-tags { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.meta-left { display: flex; align-items: center; gap: 20px; }
.status-badge {
    display: inline-flex; align-items: center; gap: 5px; background: none; color: var(--success);
    padding: 0; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;
}
.status-badge.out-of-stock { color: var(--danger); }
.tea-badge {
    display: inline-flex; align-items: center; gap: 5px; background: none; color: var(--accent-gold);
    padding: 0; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; text-decoration: none;
}
/* .tea-badge reuses the gold verified-checkmark seal (see verified-badge.js
   for the original), but sits inline before plain text rather than after a
   name — .tea-badge's own `gap` already spaces it, so the component's
   usual margin-left/top nudge (meant for that other context) is zeroed. */
.tea-badge .tea-badge-seal { margin-left: 0; top: 0; width: 12px; height: 12px; }
.sku { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

.price-block { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 25px; }
.current-price { font-size: 33px; font-weight: 700; color: var(--accent-gold); line-height: 1; }
.price-unit { font-size: 16px; color: var(--text-secondary); font-weight: 500; padding-bottom: 6px; }

.purchase-area-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.weight-options { display: inline-flex; gap: 6px; }
.w-btn { padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--text-secondary); border-radius: 4px; background: var(--bg-soft); border: 1px solid var(--border-strong); transition: 0.3s; cursor: pointer; }
.w-btn.active { background: transparent; color: var(--accent-gold); border-color: var(--accent-gold); }
@media (hover: hover) and (pointer: fine) {
    .w-btn:hover { background: transparent; color: var(--accent-gold); border-color: var(--accent-gold); }
}

.secondary-actions { display: flex; gap: 20px; }
.action-link { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: color 0.3s; background: none; border: none; }
.action-link i { font-size: 14px; }
@media (hover: hover) and (pointer: fine) {
    .action-link:hover { color: var(--text-main); }
}
.action-link.w-active { color: var(--accent-gold); }

.action-row { display: flex; gap: 20px; margin-bottom: 30px; height: 48px; }
.qty-selector { display: flex; align-items: center; background: var(--bg-soft); border: 1px solid var(--border-strong); border-radius: 4px; height: 100%; padding: 0; width: 120px; }
.qty-action { width: 36px; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 18px; cursor: pointer; transition: 0.2s; background: transparent; }
@media (hover: hover) and (pointer: fine) {
    .qty-action:hover { color: var(--text-main); background: var(--bg-soft); }
}
.qty-action:active { background: var(--bg-soft); }
.qty-number { flex: 1; text-align: center; font-size: 15px; font-weight: 500; color: var(--text-main); border-left: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong); height: 100%; display: flex; align-items: center; justify-content: center; }
.btn-add-to-cart { flex: 1; height: 100%; background: var(--accent-gold); color: #fff; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; border-radius: 4px; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all 0.3s ease; border: none; cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
    .btn-add-to-cart:hover { background: var(--accent-hover); }
}
.btn-add-to-cart:active { transform: scale(0.97); }
.btn-add-to-cart:disabled { opacity: 0.5; cursor: not-allowed; }

/* =========================================
   TABS: DESCRIPTION / SPECS / REVIEWS
   ========================================= */
.tabs-section { margin-top: 80px; border-top: 1px solid var(--border-strong); padding-top: 60px; scroll-margin-top: calc(var(--sticky-top) + 20px); }
.tabs-header { display: flex; gap: 60px; margin-bottom: 40px; }
.tab-btn { font-size: 15px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; padding-bottom: 10px; border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.3s; background: none; border-top: none; border-left: none; border-right: none; }
.tab-btn.active { color: var(--text-main); border-bottom-color: var(--accent-gold); }
@media (hover: hover) and (pointer: fine) {
    .tab-btn:hover { color: var(--text-main); border-bottom-color: var(--accent-gold); }
}
.tab-body { max-width: 900px; font-size: 14px; line-height: 1.8; color: var(--text-secondary); }
.tab-body p { margin-bottom: 20px; }
.tab-body h4 { color: var(--text-main); font-size: 16px; margin: 30px 0 15px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.spec-table { width: 100%; max-width: 600px; border-collapse: collapse; }
.spec-table tr { border-bottom: 1px solid var(--border-strong); }
.spec-table td { padding: 14px 0; font-size: 14px; }
.spec-table td:first-child { color: var(--text-secondary); width: 40%; }
.spec-table td:last-child { color: var(--text-main); font-weight: 500; }

/* =========================================
   REVIEWS TAB
   Reuses css/reviews.css's own components (.review-card/.rc-*, .rf-*,
   .btn-primary) so a review posted from here looks identical to one on
   the main Reviews page — it's the same Supabase table, just filtered
   client-side to this product's name (see renderReviewsTab() in
   js/pages/product.js). No rating-summary block above the form — just
   the form, then the list.
   ========================================= */
.pr-reviews-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.pr-reviews-title { font-size: 18px; font-weight: 500; color: var(--text-main); margin: 0; }
.pr-reviews-badge {
    background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 500;
    width: 22px; height: 22px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
}
.pr-reviews-list { display: flex; flex-direction: column; gap: 16px; max-width: 700px; margin-bottom: 28px; }
.pr-reviews-empty { color: var(--text-secondary); font-size: 14px; line-height: 1.8; max-width: 600px; margin-bottom: 28px; }
.pr-reviews-viewall {
    display: inline-block; color: var(--accent-gold); font-size: 14px; font-weight: 500;
    text-decoration: none; border-bottom: 1px solid transparent; margin-bottom: 40px; transition: 0.2s;
}
@media (hover: hover) and (pointer: fine) {
    .pr-reviews-viewall:hover { border-bottom-color: var(--accent-gold); }
}

/* Inline "write a review" form — plain, always in the page's own flow
   (not a modal), laid out to match the reference the shop owner sent
   (name + social sign-in on one row, email, comment, star rating,
   submit) but reskinned in the site's own dark/gold palette, and sized
   to the tab's own content width (.tab-body's own 900px cap) rather
   than a narrower box of its own. Reuses css/reviews.css's .rf-*
   field/textarea/star-picker/button styling. reviews.html's own
   write-a-review form (no product thumbnail/name) reuses this exact
   same component — see .pr-reviews-write-section in css/reviews.css. */
.pr-review-form {
    margin-bottom: 40px;
    position: relative;
}
/* Desktop: neutral wrapper, form lays out in-flow, always open (the
   trigger button below stays hidden). Mobile (<=600px): becomes a
   fixed-position bottom-sheet overlay — same visual pattern as
   css/reviews.css's .mobile-sort-overlay/.mobile-sort-sheet — toggled
   via window.alfToggleReviewSheet(). */
.pr-review-sheet-overlay { display: contents; }
.pr-write-review-btn { display: none; }
.pr-review-sheet-close { display: none; }
.pr-review-form-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 20px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--border-light); }
.pr-review-form-title { font-size: 15px; font-weight: 500; color: var(--text-main); }
.pr-review-form-title-row .rf-rating-select { gap: 8px; }
.pr-review-form-title-row .rf-rating-select i { font-size: 18px; }

/* Product mini-preview (thumbnail + name) to the left of the fields —
   same pairing the combo-card below already uses (.combo-img is 70px),
   just sized a touch larger since it's the sole visual anchor here. */
.pr-review-body { display: flex; align-items: flex-start; gap: 28px; }
.pr-review-product { flex-shrink: 0; width: 90px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pr-review-product-img { width: 90px; height: 90px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border-light); background: var(--bg-soft); }
.pr-review-product-name { display: none; font-size: 12px; color: var(--accent-gold); line-height: 1.4; text-align: left; align-self: flex-start; }
.pr-review-fields { flex: 1; min-width: 0; }

.rf-stack { display: flex; flex-direction: column; gap: 20px; }
.rf-stack .rf-label { margin-bottom: 10px; }

/* Desktop: name field + social-login row share one line (name a touch
   narrower to leave room); mobile stacks them via display:contents +
   order further down, .pr-review-name gets width:100% there instead. */
.pr-review-row { display: flex; flex-direction: row; align-items: center; gap: 20px; }
.pr-review-name { flex: 1 1 auto; min-width: 0; max-width: 68%; }

/* Small person-icon prefix inside the name field, matching the
   reference's avatar-glyph — reuses .rf-input for the field itself. */
.rf-input-icon { position: relative; width: 100%; }
.rf-input-icon i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; pointer-events: none; }
.rf-input-icon .rf-input { padding-left: 42px; }
.rf-input-icon .rf-input--locked ~ i { color: var(--accent-gold); }

/* The site's real Google/Facebook OAuth (see reviewFormHTML()'s comment) —
   small round icon buttons rather than the full-width .btn-social-auth
   bars used on the login modal, since here they're a secondary shortcut
   next to the name field, not the primary way in. */
.pr-review-social { display: flex; align-items: center; gap: 18px; padding-top: 0; flex-shrink: 0; }
.pr-review-social span { font-size: 12px; color: var(--text-secondary); margin-right: 4px; }
.pr-social-btn {
    width: auto; height: auto; border-radius: 0; border: none;
    background: transparent; color: var(--text-main); display: flex; align-items: center; justify-content: center;
    font-size: 18px; padding: 0; cursor: pointer; transition: 0.25s;
}
@media (hover: hover) and (pointer: fine) {
    .pr-social-btn:hover { color: var(--accent-gold); }
}
.pr-social-btn:disabled { cursor: not-allowed; opacity: 0.35; }
@media (hover: hover) and (pointer: fine) {
    .pr-social-btn:disabled:hover { color: var(--text-main); }
}

.pr-review-submit { text-align: right; }
.pr-review-submit .btn-primary { width: auto; padding: 14px 34px; }
.pr-rf-login-btn {
    display: none; width: 100%; background: transparent; border: 1px solid var(--border-light);
    color: var(--text-main); padding: 14px; border-radius: 4px; font-size: 14px; font-weight: 500;
    cursor: pointer; transition: 0.25s; align-items: center; justify-content: center; gap: 10px;
}
@media (hover: hover) and (pointer: fine) {
    .pr-rf-login-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
}
.pr-rf-login-btn i { font-size: 13px; }

/* Network-failure banner only (see showReviewFeedback() in
   product.js) — the success case doesn't use this, see
   .pr-review-done below. max-height/opacity (not display) so it can
   fade in AND back out smoothly. */
.pr-review-feedback {
    display: flex; align-items: center; gap: 10px; font-size: 13.5px; line-height: 1.5;
    padding: 0 16px; border-radius: 4px; max-height: 0; margin-top: 0; opacity: 0;
    overflow: hidden; pointer-events: none; border: 1px solid transparent;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin-top 0.3s ease, padding 0.3s ease;
}
.pr-review-feedback.active { max-height: 80px; margin-top: 16px; padding: 14px 16px; opacity: 1; pointer-events: auto; }
.pr-review-feedback i { font-size: 15px; flex-shrink: 0; }
.pr-review-feedback--error { background: rgba(229, 72, 77, 0.1); border-color: rgba(229, 72, 77, 0.35); color: var(--danger); }
/* Not currently used - both showReviewFeedback() call sites (product.js,
   reviews.js) only ever pass 'error' (a success submit uses
   celebrateSubmitSuccess() instead) - kept defined so the function's
   'success' branch doesn't render unstyled if that ever changes. */
.pr-review-feedback--success { background: rgba(30, 158, 90, 0.1); border-color: rgba(30, 158, 90, 0.35); color: var(--success); }

/* Success case (see celebrateSubmitSuccess() in product.js): nothing
   collapses — the stars the person picked pop in place (reuses
   .rf-star-pop, the same animation the empty-rating case plays, just
   as a celebration instead of an error cue) and this plain caption
   fades in directly under the star row once they're done — it lives
   right inside .pr-review-form-title-row, right after #formStars, and
   flex-basis:100% (below) drops it onto its own line under the stars
   on desktop. No card, no border, no icon — just quiet grey text,
   self-fading. */
.pr-review-done {
    flex: 0 0 100%; text-align: right; color: var(--text-secondary); font-size: 12.5px; font-weight: 500;
    max-height: 0; opacity: 0; margin-top: 0; overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin-top 0.3s ease;
}
.pr-review-done.active { max-height: 24px; opacity: 1; margin-top: 12px; }

@media (max-width: 600px) {
    .pr-review-submit .btn-primary { width: 100%; }

    /* Mobile sheet gets its own item order, distinct from desktop's
       nested two-column layout — rather than duplicating the form,
       every intermediate wrapper along the path from .pr-review-form to
       each item collapses via `display: contents`, promoting the item
       itself (title, stars, product name, each field, submit, the
       client-login button) to a direct flex child of .pr-review-form so
       it can be freely reordered with `order`. Desktop is untouched —
       none of this fires outside this media query. */
    .pr-review-form { display: flex; flex-direction: column; gap: 18px; }
    .pr-review-form-title-row,
    .pr-review-body,
    .pr-review-product,
    .pr-review-fields,
    .rf-stack,
    .pr-review-row { display: contents; }

    .pr-review-form-title {
        order: 1; padding-bottom: 14px; margin-bottom: 0;
        border-bottom: 1px solid var(--border-light);
    }
    .pr-review-product-img { display: none; }
    .pr-review-product-name { display: block; order: 2; font-size: 14px; color: var(--accent-gold); text-align: left; }
    .pr-review-name { order: 3; flex: 0 0 auto; min-width: 0; width: 100%; }
    .pr-review-social { display: none; }
    .pr-review-email { order: 4; }
    .pr-review-text { order: 5; }
    #formStars { order: 6; align-self: center; gap: 14px; }
    #formStars i { font-size: 22px; }
    .pr-review-done { order: 7; flex-basis: auto; text-align: center; }
    .pr-review-submit { order: 8; text-align: center; }
    .pr-review-feedback { order: 9; }
    .pr-rf-login-btn { order: 10; display: flex; }

    /* List -> "Написати відгук" button -> bottom sheet with the form,
       per the shop owner's reference screenshots. */
    .pr-write-review-btn {
        display: block; width: 100%; background: var(--accent-gold); color: #fff; border: none;
        border-radius: 4px; padding: 16px; font-size: 15px; font-weight: 500; cursor: pointer;
        margin-bottom: 40px; transition: 0.25s;
    }
    .pr-write-review-btn:active { background: var(--accent-gold-hover); }

    /* Апдейт 113: backdrop fade timing matched to the cart's (0.3s ->
       0.5s ease). The form sheet's own slide-up keeps its own duration -
       a slide is a different, intentional motion from a fade. */
    /* Апдейт 119: darkness matched to .cart-overlay (0.7, was 0.8), and
       the -webkit- prefix (missing here) added for Safari — see the
       longer explanation in css/overlays.css. */
    .pr-review-sheet-overlay {
        display: flex; position: fixed; inset: 0; background: rgba(27, 49, 82, 0.45); -webkit-backdrop-filter: var(--blur-overlay); backdrop-filter: var(--blur-overlay);
        z-index: 7000; align-items: flex-end; justify-content: center;
        opacity: 0; visibility: hidden; pointer-events: none; transition: 0.5s ease;
        touch-action: none; overscroll-behavior: none;
    }
    .pr-review-sheet-overlay.active { opacity: 1; visibility: visible; pointer-events: all; }
    .pr-review-sheet-overlay .pr-review-form {
        width: 100%; max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
        background: var(--bg-card); border-radius: 16px 16px 0 0; border-top: 1px solid var(--border-light);
        transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        margin-bottom: 0; padding: 24px 20px 30px;
    }
    .pr-review-sheet-overlay.active .pr-review-form { transform: translateY(0); }
    .pr-review-sheet-close {
        display: flex; position: absolute; top: 18px; right: 18px; width: 30px; height: 30px;
        align-items: center; justify-content: center; background: transparent; border: none;
        color: var(--text-secondary); font-size: 16px; cursor: pointer; z-index: 1;
    }
}

.separator-line { width: 100%; height: 1px; background: var(--border-light); margin-bottom: 30px; }

/* COMBO CARD */
.combo-card {
    background: linear-gradient(180deg, var(--bg-soft) 0%, #fff 100%);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 25px 28px;
}
.combo-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 2px;
    color: var(--accent-gold); margin-bottom: 22px;
}
.combo-header i { font-size: 12px; }

.combo-content { display: flex; align-items: center; gap: 24px; }

.combo-products { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.combo-item { display: block; border-radius: 4px; }
.combo-img {
    width: 64px; height: 64px; border-radius: 4px; object-fit: cover;
    background: var(--bg-soft); border: 1px solid var(--border-light); transition: border-color 0.2s;
}
@media (hover: hover) and (pointer: fine) {
    .combo-companion-link:hover .combo-img { border-color: var(--accent-gold); }
}
.combo-plus {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
    background: rgba(5, 83, 156, 0.12); color: var(--accent-gold);
    display: flex; align-items: center; justify-content: center; font-size: 10px;
}

.combo-divider { align-self: stretch; width: 1px; background: var(--bg-soft); }

.combo-total { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.combo-name {
    font-size: 13px; color: var(--text-secondary); text-decoration: none; margin-bottom: 8px;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: color 0.2s;
}
@media (hover: hover) and (pointer: fine) {
    .combo-name:hover { color: var(--accent-gold); }
}
.combo-total-val { font-size: 22px; font-weight: 700; color: var(--text-main); margin-bottom: 14px; }
.combo-buy {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; background: transparent; border: 1px solid var(--accent-gold); color: var(--accent-gold);
    border-radius: 4px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px;
    transition: all 0.3s; cursor: pointer;
}
.combo-buy i { font-size: 12px; }
@media (hover: hover) and (pointer: fine) {
    .combo-buy:hover { background: var(--accent-gold); color: #fff; }
}
.combo-buy:active { transform: scale(0.95); }

/* FEATURES GRID (delivery / payment / returns) */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 60px; border-top: 1px solid var(--border-light); padding-top: 60px; }
.feature-item { display: flex; flex-direction: column; gap: 15px; }
.feature-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--text-main); border-bottom: 1px solid var(--accent-gold); padding-bottom: 10px; width: max-content; }
.feature-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* RELATED / RECENTLY VIEWED — same rail pattern as home page rails */
.related-section { margin-top: 80px; }

/* =========================================
   GALLERY ZOOM MODAL
   ========================================= */
/* Апдейт 113: fade timing matched to the cart's (0.4s -> 0.5s ease) per
   the user's "smooth like cart everywhere" request. */
.gallery-overlay {
    position: fixed; inset: 0; background: rgba(255, 255, 255, 0.98); z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; pointer-events: none; transition: 0.5s ease;
    touch-action: none; overscroll-behavior: none;
    /* header (css/header.css) is `position: sticky` + `transform:
       translateZ(0)` — that combination promotes it to its own
       compositor layer, and on some mobile WebKit builds a promoted
       sticky layer keeps painting above a later fixed overlay even
       though this z-index is far higher (a real compositing quirk, not
       just a CSS stacking-context number comparison). Promoting this
       overlay to its own layer the same way makes the compositor
       actually respect the z-index difference again. */
    transform: translateZ(0);
    /* Belt-and-suspenders alongside lockScroll()'s overflow:hidden on
       html/body — this overlay's own box never needs to scroll (photo
       navigation is swipe/tap, not scroll), so hide any scrollbar a
       browser might still draw for it. */
    overflow: hidden; scrollbar-width: none;
}
.gallery-overlay::-webkit-scrollbar { display: none; }
.gallery-overlay.active { opacity: 1; visibility: visible; pointer-events: all; }
/* Anchors the × to the photo itself instead of the screen corner — its
   right edge must line up exactly with the photo's right edge, the way
   the partner reference does it, which only a wrapper sized to the photo
   (not the whole overlay) can guarantee at every viewport width. */
.gallery-close-anchor { position: relative; }
.gallery-close {
    position: absolute; top: -38px; right: -14px; color: var(--text-secondary); font-size: 26px;
    width: 40px; height: 40px; background: none; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1;
    transition: 0.25s; z-index: 10000;
}
@media (hover: hover) and (pointer: fine) {
    .gallery-close:hover { color: var(--accent-gold); }
}

/* Minimal cinematic viewer: image takes almost the whole frame, nav
   arrows stay invisible until the pointer is over the viewer (desktop
   only — touch devices navigate by swipe instead, see below), and
   switching images crossfades rather than hard-cutting. */
.gallery-modal-content {
    display: flex; align-items: center; justify-content: center; gap: 28px;
    width: 100%; max-width: 1500px; padding: 0 20px; position: relative;
}
.gallery-imgwrap {
    position: relative; width: min(85vh, 900px); height: min(85vh, 900px);
    transform: scale(0.96); opacity: 0;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
    /* Page scroll is already locked while the viewer is open (lockScroll()
       in openGallery), so this doesn't need to leave room for native
       scroll gestures — full control over 1-finger swipe and 2-finger
       pinch is handed to attachSwipeNav/attachImageZoom in product.js. */
    touch-action: none;
    overflow: hidden;
}
.gallery-overlay.active .gallery-imgwrap { transform: scale(1); opacity: 1; }
.gallery-modal-img {
    width: 100%; height: 100%; object-fit: contain; margin: 0 auto; user-select: none;
    border-radius: 4px; transition: opacity 0.2s ease, transform 0.15s ease-out; -webkit-touch-callout: none;
    cursor: zoom-in;
}
.gallery-modal-img.fading { opacity: 0; }
.gallery-imgwrap.zoomed .gallery-modal-img { cursor: zoom-out; transition: opacity 0.2s ease; }

.gallery-nav {
    color: var(--text-muted); font-size: 15px; cursor: pointer; transition: 0.25s;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--bg-soft); border: 1px solid transparent;
    opacity: 0; flex-shrink: 0;
}
@media (hover: hover) and (pointer: fine) {
    .gallery-modal-content:hover .gallery-nav { opacity: 1; }
}
@media (hover: hover) and (pointer: fine) {
    .gallery-nav:hover { color: var(--accent-gold); background: var(--accent-soft); border-color: var(--accent-gold); }
}

/* Dot indicator replaces the thumbnail strip — quieter, and doubles as
   the position indicator while swiping on mobile. */
.gallery-dots { display: flex; gap: 7px; margin-top: 26px; }
.gallery-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); transition: 0.25s; cursor: pointer; }
.gallery-dot.active { background: var(--accent-gold); width: 16px; border-radius: 3px; }

/* =========================================
   SKELETON (product-page-specific shapes; base .skeleton
   building blocks are already in css/states.css)
   ========================================= */
.skeleton-gallery-main { width: 100%; aspect-ratio: 1/1; border-radius: 4px; }
.skeleton-thumb { width: 80px; height: 80px; border-radius: 4px; flex-shrink: 0; }
.skeleton-title { height: 32px; width: 70%; margin-bottom: 20px; border-radius: 4px; }
.skeleton-price { height: 36px; width: 140px; margin-bottom: 25px; border-radius: 4px; }

/* =========================================
   RESPONSIVE
   (kept in original cascade order — do not reorder blocks)
   ========================================= */
@media (max-width: 992px) {
    .product-container { grid-template-columns: 1fr; gap: 40px; }
    .product-gallery { position: static; }
    .thumbnails { display: none; }
    .mobile-gallery-dots { display: flex; }
    .combo-content { flex-direction: column; align-items: flex-start; }
    .combo-divider { display: none; }
    .combo-total { text-align: left; width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 20px; }
    .combo-name { flex-basis: 100%; margin-bottom: 8px; text-align: left; }
    .combo-total-val { margin-bottom: 0; }
    .tabs-header { gap: 30px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
    .tabs-header::-webkit-scrollbar { display: none; }
    .features-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* Tablet portrait (iPad 768-834): photo and buy block side by side instead of a full-width
   square that pushed the price a whole screen down; the three advantages stay in a row */
@media (min-width: 601px) and (max-width: 992px) {
    .product-container { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 28px; align-items: start; }
    .product-gallery { position: sticky; top: calc(var(--sticky-top, 100px) + 16px); }
    .features-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; padding-top: 40px; }
}

@media (max-width: 600px) {
    .product-title { font-size: 22px; }
    .current-price { font-size: 28px; }
    .action-row { flex-direction: row; gap: 10px; height: 50px; }
    .qty-selector { width: 120px; height: 100%; flex-shrink: 0; }
    .btn-add-to-cart { width: auto; flex: 1; height: 100%; }
    /* With the tea-connoisseur badge visible, status badge + tea badge +
       wishlist button only miss fitting one row by a few px at phone
       widths, clipping the wishlist text at the right edge — flex-wrap
       as a safety net, plus tighter gaps/padding so it fits without
       wrapping in the common case. Wishlist stays pinned to the right
       (space-between) regardless of how many badges are on the left. */
    .meta-tags { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; row-gap: 10px; column-gap: 10px; margin-bottom: 15px; width: 100%; }
    .meta-left { flex-wrap: wrap; row-gap: 10px; gap: 10px; }
    .meta-tags .status-badge, .meta-tags .tea-badge { font-size: 10px; }
    .meta-tags .action-link { white-space: nowrap; }
    .purchase-area-top { flex-direction: column; align-items: flex-start; gap: 15px; }
    /* Апдейт 255: this used to force the box to 100vw/100dvh (true
       fullscreen, ignoring the photo's own 1:1 aspect ratio) so a pinch
       zoom would fill the whole phone screen like a native photo viewer.
       Product photos are square though, and a phone viewport is much
       taller than it is wide — "fullscreen" left most of that height as
       empty letterboxing above/below the actual visible picture, with
       the × sitting at the (invisible) box's top edge rather than the
       photo's own visible edge, way up near the site header with a big
       dead gap in between. Matching the photo's real aspect ratio here
       (same as desktop's box) keeps the × sitting right where the owner
       wants it — right above the picture people can actually see. */
    .gallery-modal-content { width: 100vw; padding: 0; gap: 0; max-width: none; }
    .gallery-imgwrap { width: 100vw; height: 100vw; }
    /* Апдейт 259: attachImageZoom() (js/pages/product.js) toggles this
       `.zoomed` class the moment pinch/double-tap scale goes above 1 —
       while it's active, break out of the resting boxed size above and
       take over the whole screen, so there's real room for the enlarged
       photo instead of it staying clipped to the small square (the
       .gallery-imgwrap `overflow: hidden` was clipping pinch-zoom to
       that box). Resets back to the boxed size the instant zoom drops
       back to 1 (reset()/apply() in attachImageZoom clear the class). */
    .gallery-imgwrap.zoomed { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 10001; }
    /* Right offset only — the × keeps the base rule's position:absolute
       and top:-38px (relative to .gallery-close-anchor, which now wraps
       the aspect-matched photo box above), same as desktop, so it sits
       right above the actual visible photo. Only `right` needs its own
       value here: the box runs edge-to-edge (no side padding, unlike
       desktop's .gallery-modal-content padding: 0 20px), so the
       desktop's -14px (deliberately hanging past the photo's edge)
       would push it half off the screen/notch here. */
    .gallery-close { right: -6px; }
    /* Апдейт 255 already stopped forcing the photo box to fill the whole
       screen — this absolute/pinned-to-the-screen-bottom positioning was
       the matching mobile-fullscreen-era rule for the dots, from when
       the image (and so the dots overlaid on it) really did own the
       full height. Now that the box hugs the actual photo like desktop
       does, the dots belong in normal flow right under it too — same
       rule as desktop, so just let the base .gallery-dots rule apply
       here unchanged instead of overriding it. */
    /* No hover on touch — arrows would otherwise stay stuck visible
       after a tap; navigation on mobile is by swipe + the dots below. */
    .gallery-nav { display: none; }
    /* Same divider already used inside this component on desktop
       (.combo-divider, between the products and the price) — same
       color/weight, just horizontal here since mobile stacks everything
       in one column instead of a row. */
    .combo-header {
        justify-content: center; border-bottom: 1px solid var(--border-light);
        padding-bottom: 16px; width: 100%;
    }
    .combo-content { flex-direction: column; align-items: center; text-align: center; }
    .combo-products { width: 100%; justify-content: center; margin-bottom: 10px; }
    .combo-total { flex-direction: column; align-items: center; text-align: center; gap: 0; margin-top: 0; }
    .combo-name { text-align: center; }
    .combo-total-val { font-size: 24px; margin-bottom: 15px; }
    .combo-buy { width: 100%; padding: 14px; font-size: 12px; justify-content: center; }
}

@media (max-width: 400px) {
    .reco-track .app-card { flex: 0 0 135px; }
}

/* "Купити в 1 клік" / "Повідомити, коли з'явиться": in .action-row, beside
   the cart button on desktop, on its own line below it on smaller screens */
.pr-extra-actions { flex: 1; display: flex; gap: 10px; height: 100%; min-width: 0; }
.pr-extra-actions:not(:has(.pr-extra-btn:not([hidden]))) { display: none; }
.pr-extra-btn {
    flex: 1; height: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid var(--accent-gold); border-radius: 4px; background: transparent; color: var(--accent-gold);
    font-family: inherit; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer; transition: background 0.2s ease, color 0.2s ease;
}
.pr-extra-btn[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .pr-extra-btn:hover { background: var(--accent-gold); color: #fff; } }
.pr-extra-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 768px) {
    .action-row { flex-wrap: wrap; height: auto; row-gap: 10px; }
    .action-row > .qty-selector, .action-row > .btn-add-to-cart { height: 50px; }
    .pr-extra-actions { flex: 1 1 100%; height: 46px; }
}


/* «Покупка частинами monobank» under the buy buttons (product.js renderPartsNote) */
.pr-parts {
    display: flex; align-items: flex-start; gap: 14px; margin: -8px 0 28px; padding: 14px 16px;
    border: 1px solid var(--border-light); border-radius: 12px; background: var(--bg-card, #fff);
}
.pr-parts[hidden], html:not([data-parts]) .pr-parts { display: none; }
.pr-parts-flag {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    min-width: 46px; height: 28px; padding: 0 10px; border-radius: 14px 14px 14px 4px;
    background: #111; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.3px; text-transform: lowercase;
}
.pr-parts-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 14px; line-height: 1.45; color: var(--text-main); }
.pr-parts-text b { font-weight: 600; font-size: 14px; }
.pr-parts-text #prPartsLine { font-weight: 600; color: var(--accent); }
.pr-parts-text small { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.pr-parts-text small a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }


/* the old price crossed out next to the current one on sale items */
.old-price { font-size: 18px; font-weight: 500; line-height: 1; color: var(--text-muted); padding-bottom: 3px; }
.old-price s { text-decoration: line-through; }
.ig-compare { width: 19px; height: 19px; display: block; }

@media (hover: hover) and (pointer: fine) { a.tea-badge:hover { text-decoration: underline; text-underline-offset: 3px; } }

/* gallery: with more than five photos the fifth thumbnail is a dimmed «+N» tile that opens the rest */
.thumb-more img { filter: brightness(0.45); }
.thumb-more-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.thumb-more { opacity: 1; }
