/* =============================================
   PRODUCT DETAIL PAGE — Dark Theme
   Uses CSS variables from styles.css
   ============================================= */

/* Spacer under fixed nav */
.prod-spacer {
    height: var(--nav-h);
}

/* Main wrapper */
.prod-main {
    background: var(--black);
    min-height: 70vh;
    padding: 3rem 0 5rem;
}

.prod-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 3rem;
}

/* Back link */
.prod-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 2.5rem;
    transition: color 0.25s;
}

.prod-back:hover {
    color: var(--gold);
}

/* Two-column layout */
.prod-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 4rem;
    align-items: start;
}

@media (max-width: 900px) {
    .prod-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

/* =============================================
   LEFT COLUMN — Image / 3D Gallery
   ============================================= */

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* View toggle (2D / 3D) */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.toggle-btn {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.5rem 1.25rem;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    border-color: var(--gold);
    color: var(--cream);
}

.toggle-btn.active {
    background: var(--gold);
    color: var(--black);
    border-color: var(--gold);
    font-weight: 500;
}

/* Main image container */
.gallery-2d-wrapper {
    display: block;
    position: relative;
}

.gallery-2d-wrapper.hidden {
    display: none;
}

.main-image-wrapper {
    width: 100%;
    aspect-ratio: 4 / 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.6s var(--ease);
}

.main-image:hover {
    transform: scale(1.02);
}

/* Thumbnails */
.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.thumbnail-wrapper {
    aspect-ratio: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}

.thumbnail-wrapper.active {
    border-color: var(--gold);
}

.thumbnail-wrapper:hover {
    border-color: rgba(232, 228, 220, 0.5);
}

.thumbnail-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s var(--ease);
}

.thumbnail-wrapper:hover .thumbnail-image {
    transform: scale(1.05);
}

/* Fullscreen button */
.fullscreen-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(13, 13, 13, 0.7);
    color: var(--cream);
    border: 1px solid rgba(232, 228, 220, 0.25);
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    font-size: 1.125rem;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    z-index: 10;
    line-height: 1;
}

.fullscreen-btn:hover {
    background: rgba(201, 168, 76, 0.85);
    color: var(--black);
    border-color: var(--gold);
}

/* =============================================
   3D MODEL VIEWER
   ============================================= */

.viewer-3d-wrapper {
    width: 100%;
    aspect-ratio: 4 / 5;
    background: var(--surface);
    border: 1px solid var(--border);
    display: none;
    position: relative;
    overflow: hidden;
}

.viewer-3d-wrapper.active {
    display: block;
}

model-viewer {
    width: 100%;
    height: 100%;
    background: var(--surface);
}

/* Model controls hint */
.model-viewer-controls {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--dark);
    border: 1px solid var(--border);
}

.control-item {
    font-family: var(--sans);
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.5;
    padding: 0.4rem 0.75rem;
    border-left: 2px solid var(--gold);
}

.control-item strong {
    color: var(--cream);
    font-weight: 500;
}

/* 3D Loading Overlay */
.model-loading-overlay {
    position: absolute;
    inset: 0;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.3s ease;
}

.model-loading-content {
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.loading-text {
    font-family: var(--sans);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.loading-bar {
    width: 240px;
    height: 2px;
    background: var(--border);
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    background: var(--gold);
    width: 0%;
    transition: width 0.3s ease;
}

.loading-percentage {
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--gold);
}

/* =============================================
   RIGHT COLUMN — Product Info
   ============================================= */

.product-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: 0.5rem;
}

.product-title {
    font-family: var(--serif);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    font-style: italic;
    color: var(--cream);
    line-height: 1.1;
    margin: 0;
}

.product-artist {
    font-family: var(--sans);
    font-size: 0.8125rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0;
}

/* Gold divider */
.prod-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, var(--gold) 0%, transparent 80%);
    opacity: 0.4;
}

.product-description {
    font-family: var(--sans);
    font-size: 0.9375rem;
    color: rgba(232, 228, 220, 0.6);
    line-height: 1.85;
    font-weight: 300;
}

/* WhatsApp inquiry button */
.btn-inquiry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--sans);
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1rem 2.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    align-self: flex-start;
}

.btn-whatsapp {
    background: #25D366;
    color: #0D0D0D;
}

.btn-whatsapp:hover {
    background: #128C7E;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3);
}

.whatsapp-icon {
    font-size: 1.1rem;
}

/* =============================================
   FULLSCREEN OVERLAY
   ============================================= */

.fullscreen-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.97);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.fullscreen-overlay.active {
    display: flex;
}

.fullscreen-content {
    max-width: 95vw;
    max-height: 95vh;
    position: relative;
}

.fullscreen-content img {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
}

.fullscreen-content model-viewer {
    width: 95vw;
    height: 95vh;
}

.fullscreen-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--cream);
    border: 1px solid rgba(232, 228, 220, 0.35);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 300;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    z-index: 10000;
}

.fullscreen-close:hover {
    background: var(--gold);
    color: var(--black);
    border-color: var(--gold);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 900px) {
    .prod-container {
        padding: 0 2rem;
    }

    .prod-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .prod-main {
        padding: 2.5rem 0 4rem;
    }
}

@media (max-width: 640px) {
    .prod-container {
        padding: 0 1.25rem;
    }

    .prod-main {
        padding: 2rem 0 4rem;
    }

    .main-image-wrapper {
        aspect-ratio: 3 / 4;
    }

    .product-title {
        font-size: 1.75rem;
    }

    .product-description {
        font-size: 0.875rem;
    }

    .btn-inquiry {
        width: 100%;
        justify-content: center;
    }

    .thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    }

    .toggle-btn {
        flex: 1;
        min-width: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.6875rem;
    }

    .prod-back {
        font-size: 0.6875rem;
        margin-bottom: 1.5rem;
    }

    .fullscreen-close {
        top: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
}
