/**
 * Product Detail Gallery — Slider + Lens Zoom + Lightbox
 * DijiDepo v5
 */

/* ═══════════════════════════════════════
   SLIDER
   ═══════════════════════════════════════ */
.pdp-gallery {
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.pdp-slider-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    border-radius: var(--radius-base, 12px);
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    cursor: grab;
}
.pdp-slider-wrap:active {
    cursor: grabbing;
}
.pdp-slider-wrap.zoom-active {
    cursor: crosshair;
}

.pdp-slider {
    display: flex;
    height: 100%;
    will-change: transform;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.pdp-slider.no-transition {
    transition: none !important;
}

.pdp-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pdp-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* ═══════════════════════════════════════
   ARROWS
   ═══════════════════════════════════════ */
.pdp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.pdp-slider-wrap:hover .pdp-arrow {
    opacity: 1;
}
.pdp-arrow:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(1.08);
}
.pdp-arrow:active {
    transform: translateY(-50%) scale(0.95);
}
.pdp-arrow-prev { left: 12px; }
.pdp-arrow-next { right: 12px; }

.pdp-arrow:disabled {
    opacity: 0 !important;
    pointer-events: none;
}

/* ═══════════════════════════════════════
   DOTS
   ═══════════════════════════════════════ */
.pdp-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.pdp-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    padding: 0;
    transition: all 0.25s;
}
.pdp-dot.active {
    background: var(--c-primary, #2563eb);
    width: 18px;
    border-radius: 4px;
}
.pdp-dot:hover:not(.active) {
    background: rgba(0, 0, 0, 0.4);
}

/* ═══════════════════════════════════════
   THUMBNAILS
   ═══════════════════════════════════════ */
.pdp-thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.pdp-thumb {
    aspect-ratio: 1;
    border-radius: calc(var(--radius-base, 12px) * 0.7);
    overflow: hidden;
    border: 2px solid #f3f4f6;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    background: #f9fafb;
    padding: 0;
}
.pdp-thumb:hover {
    border-color: var(--c-primary, #2563eb);
    transform: translateY(-1px);
}
.pdp-thumb.active {
    border-color: var(--c-primary, #2563eb);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-primary, #2563eb) 15%, transparent);
}
.pdp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* ═══════════════════════════════════════
   ZOOM HINT ICON
   ═══════════════════════════════════════ */
.pdp-zoom-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.pdp-slider-wrap:hover .pdp-zoom-hint {
    opacity: 0;
}

/* ═══════════════════════════════════════
   LENS ZOOM
   ═══════════════════════════════════════ */
.pdp-lens-area {
    position: absolute;
    border: 2px solid color-mix(in srgb, var(--c-primary, #2563eb) 45%, transparent);
    background: color-mix(in srgb, var(--c-primary, #2563eb) 6%, transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 11;
    border-radius: 4px;
}
.pdp-lens-area.visible {
    opacity: 1;
}

.pdp-zoom-result {
    display: none;
    position: absolute;
    top: 0;
    left: calc(100% + 20px);
    width: 100%;
    aspect-ratio: 1;
    background-color: #fff;
    background-repeat: no-repeat;
    border-radius: var(--radius-base, 12px);
    border: 1px solid #e5e7eb;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.18);
    z-index: 40;
    pointer-events: none;
    overflow: hidden;
}
.pdp-zoom-result.visible {
    display: block;
    animation: pdpZoomIn 0.2s ease-out;
}

@keyframes pdpZoomIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* ═══════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════ */
.pdp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.pdp-lightbox.open {
    opacity: 1;
    visibility: visible;
}

.pdp-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pdp-lb-content {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pdp-lb-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
    transform: scale(0.94);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.pdp-lightbox.open .pdp-lb-content img {
    transform: scale(1);
}

.pdp-lb-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.pdp-lb-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.pdp-lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.pdp-lb-arrow:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-50%) scale(1.08);
}
.pdp-lb-arrow.prev { left: 16px; }
.pdp-lb-arrow.next { right: 16px; }

.pdp-lb-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.35);
    padding: 4px 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1023px) {
    .pdp-zoom-result,
    .pdp-lens-area,
    .pdp-zoom-hint {
        display: none !important;
    }
    .pdp-slider-wrap {
        cursor: grab;
    }
    .pdp-arrow {
        width: 34px;
        height: 34px;
        opacity: 0.7;
    }
    .pdp-slider-wrap:hover .pdp-arrow {
        opacity: 0.85;
    }
    .pdp-arrow-prev { left: 8px; }
    .pdp-arrow-next { right: 8px; }
}

@media (max-width: 639px) {
    .pdp-thumbs {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        margin-top: 8px;
    }
    .pdp-thumb { border-radius: 8px; }
    .pdp-lb-arrow { width: 40px; height: 40px; }
    .pdp-lb-arrow.prev { left: 8px; }
    .pdp-lb-arrow.next { right: 8px; }
}

/* ═══════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .pdp-slider {
        transition: none !important;
    }
    .pdp-lightbox,
    .pdp-lb-content img,
    .pdp-zoom-result {
        transition: none !important;
        animation: none !important;
    }
}
