/**
 * LIGHTBOX - Visualisation Images en Plein Écran
 * Mayram Fashion House
 */

/* =================
   SAUVEGARDE SCROLL
   ================= */
body {
    overflow-y: auto !important;
}

/* =================
   OVERLAY
   ================= */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 2rem;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

/* =================
   CONTAINER
   ================= */
.lightbox-container {
    position: relative;
    width: 100%;
    max-width: 95vw;
    min-width: 400px;
    max-height: 95vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =================
   IMAGE
   ================= */
.lightbox-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 95vh;
    min-width: 200px;
    min-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: lightboxFadeIn 0.3s ease;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =================
   BOUTON FERMETURE
   ================= */
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close:hover {
    background: rgba(220, 53, 69, 0.9);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(220, 53, 69, 0.4);
}

.lightbox-close:active {
    transform: scale(0.95);
    background: rgba(220, 53, 69, 1);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* =================
   FLÈCHES NAVIGATION
   ================= */
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.lightbox-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox-arrow svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.5;
}

.lightbox-arrow-left {
    left: 20px;
}

.lightbox-arrow-right {
    right: 20px;
}

/* =================
   INDICATEUR
   ================= */
.lightbox-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10001;
}

/* =================
   BOUTON PLEIN ÉCRAN (Galerie Produits)
   ================= */
.gallery-fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.gallery-fullscreen-btn:hover {
    background: white;
    color: var(--secondary-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: scale(1.1);
}

.gallery-fullscreen-btn:active {
    transform: scale(0.95);
}

.gallery-fullscreen-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

/* Animation d'apparition au survol */
@media (hover: hover) {
    .gallery-fullscreen-btn {
        opacity: 0;
        pointer-events: none;
    }
    
    .gallery-main:hover .gallery-fullscreen-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

/* =================
   BOUTON PLEIN ÉCRAN (Galerie Créateurs)
   ================= */
.media-item {
    position: relative;
    overflow: visible;
}

.media-fullscreen-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
}

.media-item:hover .media-fullscreen-btn {
    opacity: 1;
    pointer-events: auto;
}

.media-fullscreen-btn:hover {
    background: white;
    color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transform: scale(1.15);
}

.media-fullscreen-btn:active {
    transform: scale(0.9);
}

.media-fullscreen-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

/* Sur mobile, toujours visible */
@media (max-width: 768px) {
    .media-fullscreen-btn {
        opacity: 1;
        pointer-events: auto;
        width: 32px;
        height: 32px;
        top: 5px;
        right: 5px;
    }
    
    .media-fullscreen-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .gallery-fullscreen-btn {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

/* =================
   RESPONSIVE
   ================= */
@media (max-width: 768px) {
    .lightbox-overlay {
        padding: 1rem;
    }
    
    .lightbox-container {
        min-width: 300px;
        min-height: 300px;
    }
    
    .lightbox-image {
        max-height: 90vh;
        min-width: 150px;
        min-height: 150px;
        padding: 15px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
    
    .lightbox-close svg {
        width: 20px;
        height: 20px;
    }
    
    .lightbox-arrow {
        width: 50px;
        height: 50px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .lightbox-arrow svg {
        width: 24px;
        height: 24px;
    }
    
    .lightbox-arrow-left {
        left: 10px;
        right: auto;
    }
    
    .lightbox-arrow-right {
        right: 10px;
        left: auto;
    }
    
    .lightbox-indicator {
        bottom: 10px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .gallery-fullscreen-btn {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
    
    .gallery-fullscreen-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .lightbox-overlay {
        padding: 0.5rem;
    }
    
    .lightbox-container {
        min-width: 250px;
        min-height: 250px;
    }
    
    .lightbox-image {
        max-height: 85vh;
        min-width: 100px;
        min-height: 100px;
        padding: 10px;
        border-radius: 4px;
    }
    
    .lightbox-close {
        top: 5px;
        right: 5px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-arrow {
        width: 45px;
        height: 45px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .lightbox-arrow-left {
        left: 5px;
        right: auto;
    }
    
    .lightbox-arrow-right {
        right: 5px;
        left: auto;
    }
    
    .gallery-fullscreen-btn {
        top: 5px;
        right: 5px;
        width: 40px;
        height: 40px;
    }
}

/* =================
   ÉTAT DE CHARGEMENT
   ================= */
.lightbox-image.loading {
    opacity: 0.5;
}

/* =================
   ANIMATION ZOOM
   ================= */
.lightbox-image.zoomed {
    cursor: zoom-out;
    cursor: -webkit-zoom-out;
    cursor: -moz-zoom-out;
}

.lightbox-image-wrapper {
    overflow: auto;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

.lightbox-image-wrapper:active {
    cursor: grabbing;
}

.lightbox-image-wrapper.zoomed {
    cursor: grab;
}

.lightbox-image-wrapper.zoomed:active {
    cursor: grabbing;
}

/* Zoom avec transformation */
.lightbox-image.zoom-2x {
    transform: scale(2);
    cursor: zoom-out;
    cursor: -webkit-zoom-out;
    cursor: -moz-zoom-out;
}

.lightbox-image.zoom-3x {
    transform: scale(3);
    cursor: zoom-out;
    cursor: -webkit-zoom-out;
    cursor: -moz-zoom-out;
}

.lightbox-image.zoom-4x {
    transform: scale(4);
    cursor: zoom-out;
    cursor: -webkit-zoom-out;
    cursor: -moz-zoom-out;
}

/* Animation fluide du zoom */
.lightbox-image {
    transform-origin: center center;
    will-change: transform;
}
