/* ═══════════════════════════════════════
   PRODUCT DETAIL PAGE
═══════════════════════════════════════ */

.product-detail-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 2rem calc(5rem + env(safe-area-inset-bottom));
    font-family: 'DM Sans', sans-serif;
}

/* ── BREADCRUMB ── */
.product-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #999;
    margin-bottom: 2rem;
}

.product-breadcrumb a {
    color: #999;
    text-decoration: none;
    transition: color 0.15s;
}

.product-breadcrumb a:hover { color: #111; }
.product-breadcrumb-sep { color: #ddd; }
.product-breadcrumb-current { color: #111; font-weight: 500; }

/* ── MAIN LAYOUT ── */
.product-detail-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 3.5rem;
    align-items: start;
}

/* ── GALLERY ── */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: calc(var(--header-height, 64px) + 24px);
}

.product-main-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 16px;
    overflow: hidden;
    background: #f7f5f2;
    touch-action: pan-y;
    cursor: zoom-in;
}

.product-main-image-wrap .slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.product-main-image-wrap .product-image {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-main-image-wrap .slider-btn {
    opacity: 1;
    background: rgba(255,255,255,0.88);
}

/* ── THUMBNAILS ── */
.product-thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    overflow: hidden;
}

.product-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.18s;
    flex-shrink: 0;
    background: #f7f5f2;
}

.product-thumb.active { border-color: #111; }

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── INFO PANEL ── */
.product-detail-info {
    display: flex;
    flex-direction: column;
    padding-top: 8px;
}

.product-detail-category {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 12px;
}

.product-detail-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 400;
    color: #111;
    line-height: 1.2;
    margin: 0 0 20px;
    letter-spacing: 0.01em;
}

.product-detail-price {
    font-size: 1.4rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 28px;
}

.product-detail-divider {
    height: 1px;
    background: #f0f0f0;
    margin-bottom: 24px;
}

.product-detail-desc-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 10px;
}

.product-detail-description {
    font-size: 14px;
    line-height: 1.75;
    color: #555;
    margin-bottom: 32px;
    white-space: pre-line;
}

/* ── STOCK ── */
.product-detail-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    background: #f7f7f7;
    border-radius: 100px;
    padding: 5px 12px;
    margin-bottom: 24px;
    width: fit-content;
}

.product-detail-stock.out-of-stock {
    background: #fff1f1;
    color: #e53935;
}

/* ── ADD TO CART ── */
.product-detail-add-btn {
    background: #111;
    color: #fff;
    border: none;
    padding: 16px 32px;
    border-radius: 100px;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
    width: 100%;
    max-width: 300px;
}

.product-detail-add-btn:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

.product-detail-add-btn:active { transform: scale(0.98); }

.product-detail-add-btn:disabled {
    background: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── VARIANT SELECTOR ── */
.variant-selector {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 8px 0 4px;
}

.variant-group-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #888;
    display: block;
    margin-bottom: 8px;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variant-option-btn {
    padding: 10px 18px;
    min-height: 44px;
    border-radius: 999px;
    border: 1.5px solid #d1d5db;
    background: #fff;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
    color: #111;
}

.variant-option-btn:hover {
    border-color: #111;
}

.variant-option-btn.selected {
    border-color: #111;
    background: #111;
    color: #fff;
}

.variant-option-btn.unavailable {
    opacity: .4;
    text-decoration: line-through;
    cursor: not-allowed;
}

/* ── RELATED PRODUCTS ── */
.product-related {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid #f0f0f0;
}

.product-related-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 400;
    color: #111;
    margin-bottom: 2rem;
    letter-spacing: 0.04em;
}

/* ── STATES ── */
.product-detail-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.product-detail-notfound {
    text-align: center;
    padding: 6rem 2rem;
    color: #bbb;
}

.product-detail-notfound i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 16px;
    color: #e0e0e0;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .product-gallery { position: static; }

    .product-main-image-wrap {
        aspect-ratio: 3 / 4;
        height: auto;
        max-height: none;
        border-radius: 10px;
    }

    /* Thumbnails scroll horizontally — no wrapping rows */
    .product-thumbnails {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .product-thumbnails::-webkit-scrollbar { display: none; }

    .product-thumb {
        width: 56px;
        height: 56px;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .product-detail-page   { padding: 1rem 14px calc(80px + env(safe-area-inset-bottom)); }
    .product-detail-name   { font-size: 1.6rem; }
    .product-detail-price  { font-size: 1.15rem; }
    .product-detail-add-btn { max-width: 100%; }
    .product-thumb         { width: 48px; height: 48px; }
    .product-related-title { font-size: 1.4rem; }

    .product-detail-description {
        max-height: 160px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 375px) {
    .product-detail-name  { font-size: 1.35rem; }
    .product-detail-price { font-size: 1rem; }
}


/* ═══════════════════════════════════════
   LIGHTBOX / ZOOM
═══════════════════════════════════════ */
.product-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.18s ease;
}

.lightbox-img-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    touch-action: pinch-zoom;
    -webkit-overflow-scrolling: touch;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
    display: block;
    touch-action: pinch-zoom;
    cursor: default;
    border-radius: 4px;
}

.lightbox-close {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 10000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.lightbox-close:hover { background: rgba(255,255,255,0.28); }

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10000;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.lightbox-nav:hover { background: rgba(255,255,255,0.28); }
.lightbox-nav.prev { left: max(16px, env(safe-area-inset-left)); }
.lightbox-nav.next { right: max(16px, env(safe-area-inset-right)); }

.lightbox-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    z-index: 10000;
}

@media (max-width: 480px) {
    .lightbox-nav { display: none; }
}
