/*
   PICTURE-VIEWER.CSS
   Clean, Premium Image Viewer — No 3D Effects
*/

:root {
    --pv-bg: #050a06;
    --pv-brand: #00A651;
    --pv-brand-soft: rgba(0, 166, 81, 0.1);
    --pv-glass: rgba(10, 20, 15, 0.65);
    --pv-border: rgba(255, 255, 255, 0.14);
}

/* ─── Modal ─────────────────────────────────────────────── */
.pv-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;
    overflow: hidden;
    color: white;
    font-family: 'Poppins', sans-serif;
    user-select: none;
    background: rgba(5, 10, 6, 0.96);
}

.pv-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Dark overlay — no 3D transforms */
.pv-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 80, 30, 0.15) 0%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Image Stage ────────────────────────────────────────── */
.pv-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.pv-item-container {
    position: relative;
    bottom: 85px;
    border-radius: 28px;
    background: rgba(15, 25, 18, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--pv-border);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    padding: 0px;
    /* Entry animation: fade + slide up only, no 3D */
    animation: pvFadeIn 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes pvFadeIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pv-main-image {
    max-width: 99vw;
    max-height: 99vh;
    object-fit: contain;
    display: block;
    border-radius: 16px;
    filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.4));
    transition: opacity 0.35s ease, transform 0.35s ease;
    will-change: opacity, transform;
    cursor: crosshair;
}

/* ─── Magnifier — cursor-adjacent zoom lens ──────────────── */
.pv-magnifier {
    position: fixed;
    /* Fixed so it ignores container scroll */
    width: 200px;
    height: 200px;
    border-radius: 50%;
    pointer-events: none;
    display: none;
    z-index: 10000;
    background-repeat: no-repeat;
    overflow: hidden;
    /* Attractive styling */
    border: 3px solid var(--pv-brand);
    box-shadow:
        0 0 0 1px rgba(0, 166, 81, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(0, 0, 0, 0.15);
    /* Smooth glass ring */
    outline: 8px solid rgba(255, 255, 255, 0.06);
}

/* Crosshair centre dot */
.pv-magnifier::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 166, 81, 0.8);
    box-shadow: 0 0 6px rgba(0, 166, 81, 0.6);
}

/* ─── HUD Controls ───────────────────────────────────────── */
.pv-hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
}

.pv-btn {
    position: absolute;
    width: 44px;
    height: 44px;
    background: var(--pv-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--pv-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    pointer-events: auto;
    font-size: 18px;
}

.pv-close {
    top: 20px;
    right: 20px;
    border-radius: 14px;
}

.pv-close:hover {
    background: #ef4444;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.pv-nav {
    top: 40%;
    transform: translateY(-50%);
    border-radius: 14px;
}

.pv-prev {
    left: 15px;
}

.pv-next {
    right: 15px;
}

.pv-nav:hover {
    background: var(--pv-brand);
    border-color: var(--pv-brand);
    box-shadow: 0 0 24px rgba(0, 166, 81, 0.45);
    transform: translateY(-50%) scale(1.08);
}

/* ─── Footer ─────────────────────────────────────────────── */
.pv-footer {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 360px;
    max-width: 90%;
}

.pv-counter {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--pv-brand);
    background: var(--pv-brand-soft);
    padding: 6px 20px;
    border-radius: 50px;
    border: 1px solid rgba(0, 166, 81, 0.2);
}

.pv-progress-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.pv-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--pv-brand), #86efac);
    width: 0%;
    transition: width 0.7s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 10px;
}

/* ─── Product Info HUD ───────────────────────────────────── */
.pv-info-hud {
    position: absolute;
    top: 24px;
    left: 24px;
    background: var(--pv-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--pv-border);
    padding: 14px 24px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1100;
    pointer-events: auto;
    animation: pvFadeIn 0.6s 0.1s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.pv-info-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    margin: 0;
}

.pv-info-price {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--pv-brand);
}

/* ─── Auto-Play ──────────────────────────────────────────── */
.pv-autoplay-btn {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pv-glass);
    border: 1px solid var(--pv-border);
    padding: 10px 24px;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    pointer-events: auto;
    z-index: 1200;
    transition: background 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.pv-autoplay-btn.active {
    background: var(--pv-brand);
    border-color: var(--pv-brand);
    box-shadow: 0 0 20px rgba(0, 166, 81, 0.5);
}

.pv-autoplay-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    width: 0%;
}

/* ─── Mobile ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pv-info-hud {
        top: auto;
        bottom: 180px;
        left: 16px;
        padding: 10px 16px;
    }

    .pv-item-container {
        position: relative;
        bottom: 52px;
        border-radius: 28px;
        background: rgba(15, 25, 18, 0.6);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--pv-border);
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
        padding: 0px;
        /* Entry animation: fade + slide up only, no 3D */
        animation: pvFadeIn 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
    }

    .pv-main-image {
        max-width: 99vw;
        max-height: 72vh;
        object-fit: contain;
        display: block;
        border-radius: 16px;
        filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.4));
        transition: opacity 0.35s ease, transform 0.35s ease;
        will-change: opacity, transform;
        cursor: crosshair;
    }

    .pv-nav {
        top: 40%;
        transform: translateY(-50%);
        border-radius: 14px;
    }

    .pv-prev {
        left: 15px;
    }

    .pv-next {
        right: 15px;
    }

    .pv-autoplay-btn {
        bottom: 100px;
        padding: 8px 18px;
        font-size: 13px;
    }

    .pv-magnifier {
        display: none !important;
        /* No magnifier on touch devices */
    }
}