/* ============================================================
   RB Fireworks — Product Detail Page Styles
   Extends style.css + shop.css
   ============================================================ */

/* ─────────────────────────────────────────────
   PRODUCT MAIN
───────────────────────────────────────────── */
.product-main {
    background: var(--black);
    padding: 100px 0 80px; /* 100px clears fixed navbar */
    min-height: 70vh;
}

.product-breadcrumb {
    margin-bottom: 36px;
}

/* ─────────────────────────────────────────────
   DETAIL GRID
───────────────────────────────────────────── */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(36px, 6vw, 80px);
    align-items: start;
}

@media (max-width: 860px) {
    .product-detail-grid { grid-template-columns: 1fr; }
    .product-main { padding-top: 90px; }
}

/* ─────────────────────────────────────────────
   GALLERY
───────────────────────────────────────────── */
.product-gallery {
    position: sticky;
    top: 84px; /* below navbar */
}

@media (max-width: 860px) {
    .product-gallery { position: static; }
}

/* Main stage */
.gallery-stage {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--black-3);
    border: 1px solid var(--border);
    aspect-ratio: 1 / 1;
    cursor: zoom-in;
    transition: border-color 0.3s ease;
}
.gallery-stage:hover { border-color: var(--border-hover); }

.gallery-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.gallery-stage:hover .gallery-main-img { transform: scale(1.03); }

/* Placeholder when no image */
.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.06);
}
.gallery-placeholder svg { width: 80px; height: 80px; }

/* Nav arrows */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(8,8,8,0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: var(--transition);
    opacity: 0;
}
.gallery-stage:hover .gallery-nav-btn { opacity: 1; }
.gallery-nav-btn:hover { background: rgba(234,88,12,0.7); border-color: rgba(234,88,12,0.5); }
.gallery-nav-btn svg { width: 18px; height: 18px; }
.gallery-nav-btn.prev { left: 12px; }
.gallery-nav-btn.next { right: 12px; }

/* Counter */
.gallery-counter {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(8,8,8,0.7);
    backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.8);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
    pointer-events: none;
}

/* Expand button */
.gallery-expand {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(8,8,8,0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: var(--transition);
    opacity: 0;
}
.gallery-stage:hover .gallery-expand { opacity: 1; }
.gallery-expand:hover { background: rgba(234,88,12,0.6); color: #fff; }
.gallery-expand svg { width: 15px; height: 15px; }

/* Thumbnails */
.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.thumb-btn {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--black-3);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    padding: 0;
}
.thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.thumb-btn:hover { border-color: var(--border-hover); }
.thumb-btn:hover img { transform: scale(1.08); }
.thumb-btn.active { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(234,88,12,0.25); }

/* ─────────────────────────────────────────────
   PRODUCT INFO
───────────────────────────────────────────── */
.product-detail-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Badges row */
.detail-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.detail-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--orange-glow);
    border: 1px solid rgba(234,88,12,0.25);
    border-radius: 50px;
    color: var(--orange-light);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.detail-cat-pill svg { width: 12px; height: 12px; }

.detail-stock-pill {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
}
.detail-stock-pill.in-stock  { color: #4ade80; }
.detail-stock-pill.out-stock { color: var(--muted); }

/* Name */
.detail-name {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 800;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 16px;
}

/* Price */
.detail-price {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 14px;
    line-height: 1;
}

/* Stock hints */
.detail-stock-warn,
.detail-stock-ok {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 14px;
}
.detail-stock-warn { color: #fbbf24; }
.detail-stock-ok   { color: #4ade80; }
.detail-stock-warn svg,
.detail-stock-ok   svg { width: 15px; height: 15px; flex-shrink: 0; }

.detail-sold-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted-2);
    margin-bottom: 14px;
}
.detail-sold-count svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Divider */
.detail-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

/* Description */
.detail-desc {
    font-size: 0.96rem;
    color: var(--muted-2);
    line-height: 1.75;
    margin-bottom: 28px;
}

/* Add to Cart actions */
.detail-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

/* Qty selector */
.qty-selector {
    display: flex;
    align-items: center;
    background: var(--black-3);
    border: 1px solid var(--border);
    border-radius: 50px;
    overflow: hidden;
    flex-shrink: 0;
}
.qty-step {
    width: 40px;
    height: 48px;
    background: none;
    border: none;
    color: var(--muted-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-family: inherit;
}
.qty-step:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.qty-step svg { width: 14px; height: 14px; }
.qty-display {
    min-width: 44px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    line-height: 48px;
    padding: 0 4px;
}

/* Add to Cart button */
.btn-detail-cart {
    flex: 1;
    justify-content: center;
    min-width: 180px;
}
.btn-detail-cart svg { width: 18px; height: 18px; }
.btn-detail-cart.added {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
}

/* Back to shop */
.back-to-shop {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    transition: color 0.2s ease;
    margin-top: 4px;
}
.back-to-shop svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.back-to-shop:hover { color: var(--orange-light); }
.back-to-shop:hover svg { transform: translateX(-3px); }

/* ─────────────────────────────────────────────
   RELATED PRODUCTS
───────────────────────────────────────────── */
.related-section {
    background: var(--black-2);
    padding: var(--section-pad) 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
@media (max-width: 1000px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .related-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 440px)  { .related-grid { grid-template-columns: 1fr; } }

/* Make product name in related grid a link */
.product-name a {
    color: inherit;
    transition: color 0.2s ease;
}
.product-name a:hover { color: var(--orange-light); }

/* ─────────────────────────────────────────────
   LIGHTBOX — product images
───────────────────────────────────────────── */
.product-lightbox {
    cursor: default;
}
.product-lightbox .lightbox-inner {
    cursor: default;
    position: relative;
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.lb-nav:hover { background: rgba(234,88,12,0.5); }
.lb-nav svg { width: 20px; height: 20px; }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }

@media (max-width: 600px) {
    .lb-prev { left: 8px; }
    .lb-next { right: 8px; }
}

/* ─────────────────────────────────────────────
   LIGHT MODE
───────────────────────────────────────────── */
[data-theme="light"] .product-main { background: var(--black); }
[data-theme="light"] .gallery-stage { background: #ebe8e3; border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .gallery-placeholder { color: rgba(0,0,0,0.1); }
[data-theme="light"] .gallery-nav-btn { background: rgba(255,255,255,0.85); color: #111; border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .gallery-nav-btn:hover { background: var(--orange); color: #fff; }
[data-theme="light"] .gallery-expand { background: rgba(255,255,255,0.85); color: #333; border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .gallery-counter { background: rgba(255,255,255,0.9); color: #333; border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .thumb-btn { background: #dedad4; border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .detail-name { color: #111; }
[data-theme="light"] .detail-divider { background: rgba(0,0,0,0.09); }
[data-theme="light"] .detail-desc { color: var(--muted-2); }
[data-theme="light"] .qty-selector { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .qty-step { color: #555; }
[data-theme="light"] .qty-step:hover { background: rgba(0,0,0,0.07); color: #111; }
[data-theme="light"] .qty-display { color: #111; border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .back-to-shop { color: var(--muted); }
[data-theme="light"] .btn-detail-cart { color: #fff !important; }
[data-theme="light"] .related-section { background: var(--black-2); }
[data-theme="light"] .detail-stock-pill.in-stock { color: #16a34a; }

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 860px) {
    .detail-actions { flex-direction: column; align-items: stretch; }
    .qty-selector { justify-content: center; }
    .btn-detail-cart { min-width: unset; }
}

@media (max-width: 480px) {
    .gallery-thumbs { gap: 8px; }
    .thumb-btn { width: 60px; height: 60px; }
    .detail-name { font-size: 1.5rem; }
}

/* ── Product Video Section ── */
.product-video-section {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}
.product-video-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
}
.product-video-title svg { color: var(--orange-light); flex-shrink: 0; }
.product-video-wrap {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border);
}
.product-video-wrap iframe,
.product-video-wrap video {
    width: 100%;
    height: 100%;
    display: block;
}
[data-theme="light"] .product-video-title { color: #111; }


/* ── Variant Pills ── */
.detail-variants {
    margin-bottom: 12px;
}
.detail-variants-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.detail-variants-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.variant-pill {
    padding: 6px 16px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.variant-pill:hover {
    border-color: var(--orange-light);
    color: var(--orange-light);
}
.variant-pill.active {
    border-color: var(--orange-light);
    background: rgba(251,146,60,0.12);
    color: var(--orange-light);
}

/* ─────────────────────────────────────────────
   SOCIAL SHARE
───────────────────────────────────────────── */
.detail-share {
    margin-top: 20px;
}

.detail-share-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.detail-share-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.share-btn:hover { background: var(--surface); color: var(--text); border-color: var(--text-muted); }
.share-copy:hover { background: rgba(245,158,11,0.12); color: var(--orange); border-color: var(--orange); }
