/* ======================================================
   product.css — Byniss site-v2 product detail (PDP)
   Plain CSS, same tokens as home.css. Mobile-first.
   (Loaded alongside products.css, which supplies .pcard
   and the recently-viewed rail styles reused here.)
   ====================================================== */

.pdp {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(14px, 3vw, 30px) clamp(14px, 4vw, 52px) clamp(90px, 12vw, 70px);
}

/* Breadcrumb */
.pdp-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.pdp-crumb a { color: var(--text-muted); }
.pdp-crumb a:hover { color: var(--primary); }
.pdp-crumb i { font-size: 10px; opacity: .6; }
.pdp-crumb span { color: var(--text-strong); font-weight: 600; }

.pdp-top { display: grid; grid-template-columns: 1fr; gap: clamp(20px, 4vw, 40px); }

/* ── GALLERY ── */
.pdp-gallery-stage { display: flex; flex-direction: column; gap: 12px; }
.pdp-main {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 12px 30px rgba(180, 90, 120, .16);
}
.pdp-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.pdp-track::-webkit-scrollbar { display: none; }
.pdp-slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 3 / 4; }
.pdp-slide img { width: 100%; height: 100%; object-fit: cover; }

.pdp-zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    cursor: pointer;
    color: var(--text-2);
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.pdp-zoom:hover { color: var(--primary); }

.pdp-dots { display: flex; justify-content: center; gap: 7px; }
.pdp-dot {
    width: 8px; height: 8px; border-radius: 50%;
    border: none; background: var(--border-soft); cursor: pointer; padding: 0;
    transition: background .2s, transform .2s;
}
.pdp-dot.is-active { background: var(--primary); transform: scale(1.25); }

.pdp-thumbs { display: none; }
.pdp-thumb {
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: var(--white);
    aspect-ratio: 3 / 4;
    transition: border-color .2s;
}
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-thumb.is-active { border-color: var(--primary); }

/* Lightbox */
.pdp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1800;
    background: rgba(20, 6, 14, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .25s ease;
}
.pdp-lightbox.is-open { opacity: 1; }
.pdp-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.pdp-lightbox-close {
    position: absolute; top: 18px; right: 18px;
    width: 46px; height: 46px; border: none; border-radius: 50%;
    background: rgba(255, 255, 255, .15); color: #fff; font-size: 20px; cursor: pointer;
}

/* ── INFO ── */
.pdp-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.pdp-badges:empty { display: none; }
.pdp-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(24px, 4vw, 36px);
    line-height: 1.15;
    color: var(--text-strong);
    margin-bottom: 10px;
}
.pdp-pricing { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.pdp-price-now { font-size: clamp(24px, 3.4vw, 30px); font-weight: 800; color: var(--primary); }
.pdp-price-old { font-size: 16px; color: var(--text-muted); text-decoration: line-through; }
.pdp-discount {
    background: linear-gradient(135deg, var(--btn-1), var(--btn-2));
    color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.pdp-tax { color: var(--text-muted); font-size: 12px; }

.pdp-stock {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13.5px; font-weight: 600; margin-bottom: 14px;
    color: #2f7d54;
}
.pdp-stock.is-out { color: #b3261e; }

.pdp-short { color: var(--text); font-size: 14.5px; line-height: 1.6; margin-bottom: 4px; }
.pdp-divider { margin: 14px 0; justify-content: flex-start; }

/* Variants */
.pdp-variation { margin-bottom: 20px; }
.pdp-var-label { font-size: 13px; font-weight: 600; color: var(--text-strong); margin-bottom: 10px; letter-spacing: .3px; }
.pdp-var-label strong { color: var(--primary); }
.pdp-swatches { display: flex; flex-wrap: wrap; gap: 10px; }

.pdp-variation-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    min-height: 46px;
    padding: 10px 16px;
    border: 1.5px solid var(--border-soft);
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-strong);
    transition: border-color .2s, box-shadow .2s, color .2s, opacity .2s;
}
.pdp-variation-btn.is-swatch { width: 46px; padding: 3px; border-radius: 50%; }
.pdp-variation-btn.is-swatch img,
.pdp-variation-btn .pdp-swatch-dot {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
}
.pdp-variation-btn:hover:not(.is-disabled) { border-color: var(--primary); color: var(--primary); }

.pdp-variation-btn.is-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .18);
    color: var(--primary);
}

.pdp-variation-btn.is-disabled {
    opacity: .45;
    cursor: not-allowed;
    color: var(--text-muted);
    border-style: dashed;
}
/* diagonal strike for unavailable */
.pdp-variation-btn.is-disabled::after {
    content: '';
    position: absolute;
    left: 8%; right: 8%; top: 50%;
    height: 1.5px;
    background: currentColor;
    transform: rotate(-18deg);
    opacity: .7;
}
.pdp-variation-btn.is-swatch.is-disabled::after { left: 4%; right: 4%; }

.pdp-lowstock {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(20, 6, 14, .06);
    color: var(--btn-2);
    font-size: 12.5px; font-weight: 600;
    padding: 6px 12px; border-radius: 20px;
    margin-bottom: 14px;
}
.pdp-lowstock i { color: var(--gold-mid); }

/* Buy row */
.pdp-buy { display: flex; gap: 12px; align-items: stretch; margin-bottom: 12px; }
.pdp-qty {
    display: inline-flex; align-items: center;
    background: var(--white); border: 1px solid var(--border-soft);
    border-radius: 999px; padding: 4px; flex-shrink: 0;
}
.pdp-qty-btn {
    width: 40px; height: 40px; border: none; background: none; border-radius: 50%;
    cursor: pointer; color: var(--text-2); font-size: 12px; transition: background .18s, color .18s;
}
.pdp-qty-btn:hover:not(:disabled) { background: rgba(var(--primary-rgb), .1); color: var(--primary); }
.pdp-qty-btn:disabled { opacity: .4; cursor: not-allowed; }
.pdp-qty input {
    width: 40px; text-align: center; border: none; background: none;
    font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 15px; color: var(--text-strong);
    -moz-appearance: textfield;
}
.pdp-qty input::-webkit-outer-spin-button,
.pdp-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdp-add { flex: 1; }
.pdp-add:disabled, .btn3.pdp-add[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.pdp-buynow { width: 100%; margin-bottom: 14px; }

.pdp-mini-actions { display: flex; gap: 10px; margin-bottom: 18px; }
.pdp-mini {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px; border: 1px solid var(--border-soft); border-radius: 12px;
    background: var(--white); cursor: pointer;
    font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 13px; color: var(--text-strong);
    transition: color .2s, border-color .2s;
}
.pdp-mini:hover { color: var(--primary); border-color: var(--primary); }
.pdp-mini.is-active { color: var(--neon); border-color: var(--neon); }
.pdp-mini.is-active i { font-weight: 900; }

.pdp-trust {
    display: flex; flex-wrap: wrap; gap: 10px 18px;
    padding: 14px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
    margin-bottom: 12px;
}
.pdp-trust li { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); font-weight: 500; }
.pdp-trust i { color: var(--primary); }
.pdp-meta { font-size: 12px; color: var(--text-muted); }

/* ── ACCORDION ── */
.pdp-accordion { margin-top: clamp(30px, 5vw, 50px); max-width: 860px; }
.pdp-acc { border-bottom: 1px solid var(--border-soft); }
.pdp-acc summary {
    list-style: none;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 4px; cursor: pointer;
    font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 15px; color: var(--text-strong);
}
.pdp-acc summary::-webkit-details-marker { display: none; }
.pdp-acc summary i { color: var(--primary); transition: transform .25s ease; }
.pdp-acc[open] summary i { transform: rotate(180deg); }
.pdp-acc-body { padding: 0 4px 18px; color: var(--text); font-size: 14px; line-height: 1.7; }
.pdp-acc-body p { margin-bottom: 8px; }
.pdp-specs { display: flex; flex-direction: column; gap: 2px; }
.pdp-specs li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--border-soft); }
.pdp-specs li span:first-child { color: var(--text-muted); }
.pdp-specs li span:last-child { color: var(--text-strong); font-weight: 600; text-align: right; }

/* ── SECTION HEAD + RAILS ── */
.pdp-section-head { text-align: center; margin: clamp(36px, 5vw, 56px) 0 20px; }
.pdp-section-head h2 {
    font-family: 'Cinzel', serif; font-weight: 700; font-size: clamp(20px, 3.4vw, 30px);
    text-transform: uppercase; letter-spacing: 2px; color: var(--text-strong);
}
.pdp-rail {
    display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 14px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.pdp-rail .pcard { flex: 0 0 46%; max-width: 210px; scroll-snap-align: start; }

/* ── STICKY MOBILE BUY BAR ── */
.pdp-stickybar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1200;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--white);
    border-top: 1px solid var(--border-soft);
    box-shadow: 0 -6px 20px rgba(26, 10, 20, .12);
    transform: translateY(120%);
    transition: transform .3s ease;
}
.pdp-stickybar.is-visible { transform: translateY(0); }
.pdp-stickybar-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pdp-stickybar-name {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pdp-stickybar-price { font-weight: 800; color: var(--primary); font-size: 17px; }
.pdp-stickybar .btn3 { flex-shrink: 0; }

/* ── TABLET ≥ 768px ── */
@media (min-width: 768px) {
    .pdp-rail .pcard { flex-basis: 30%; }
}

/* ── DESKTOP ≥ 992px ── */
@media (min-width: 992px) {
    .pdp-top { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }

    /* Gallery: vertical thumbnail column + main */
    .pdp-gallery-stage { flex-direction: row-reverse; gap: 14px; }
    .pdp-main { flex: 1; }
    .pdp-track { overflow: hidden; }              /* desktop switches via thumbs, not scroll */
    .pdp-thumbs {
        display: flex; flex-direction: column; gap: 10px;
        width: 84px; flex-shrink: 0;
        max-height: 560px; overflow-y: auto;
    }
    .pdp-dots { display: none; }

    /* Info sticks while gallery scrolls */
    .pdp-info { position: sticky; top: calc(var(--hd-h, 0px) + 20px); }

    /* Sticky mobile bar not needed on desktop */
    .pdp-stickybar { display: none; }

    .pdp-rail .pcard { flex-basis: 23%; max-width: 220px; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
    .pdp-stickybar, .pdp-lightbox, .pdp-acc summary i, .pdp-dot { transition-duration: .001ms; }
}
