/* ============================================
   FOLIO — Galerie partagée
   Code commun à toutes les pages folio produits
   (Sp3ctra, Ondulab, futurs produits…)
   ============================================ */

/* Subnav produit "standalone" (pages folio sans hero).
   Au repos : la navbar Ondulab (~72 px, en position fixed) ET le subnav
   produit sont visibles, le subnav étant collé directement sous la navbar.
   Au scroll : la navbar Ondulab se cache (cf. body.subnav-stuck dans
   styles.css) et le subnav remonte se coller en haut (top:0). */
.product-subnav.product-subnav--standalone {
    top: 72px;          /* sticky : collé sous la navbar Ondulab au repos */
    transition: top 0.3s ease;
}

/* Sentinel "standalone" : place le subnav juste sous la navbar fixe
   (qui mesure ~72 px) et sert de déclencheur à l'IntersectionObserver.
   Au chargement il est visible → subnav non-stuck.
   Dès qu'on scrolle, il sort du viewport → body.subnav-stuck est ajoutée,
   la navbar Ondulab se cache et le subnav remonte à top:0. */
.product-subnav-sentinel.product-subnav-sentinel--standalone {
    height: 72px;
    margin: 0;
}

/* Quand stuck : le subnav remonte à top:0 (la navbar Ondulab est cachée). */
body.subnav-stuck .product-subnav.product-subnav--standalone {
    top: 0;
}

@media (max-width: 768px) {
    .product-subnav.product-subnav--standalone {
        top: 60px;
    }
    .product-subnav-sentinel.product-subnav-sentinel--standalone {
        height: 60px;
    }
}

/* Gallery Section */
.gallery-section {
    padding: 80px 0 120px;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
}

.gallery-header {
    text-align: left;
    margin-bottom: 40px;
}

.gallery-title {
    font-family: 'Inter', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: #888;
    max-width: 600px;
    margin: 0;
}

/* Category Filters */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 20px;
}

.category-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: #aaa;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.5);
    color: #fff;
}

.category-btn.active {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(138, 43, 226, 0.2));
    border-color: #00ffff;
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.category-btn .count {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.category-btn.active .count {
    background: rgba(0, 255, 255, 0.3);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 0 20px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .category-filters {
        gap: 8px;
    }

    .category-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    background: #111;
}

.gallery-item.hidden {
    display: none;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 255, 255, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
    padding: 40px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay-title {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.gallery-overlay-category {
    color: #00ffff;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 2rem;
    color: #fff;
    line-height: 1;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ffff;
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 1.5rem;
    z-index: 10001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ffff;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10001;
}

.lightbox-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.lightbox-counter {
    font-size: 0.8rem;
    color: #aaa;
}

/* Loading State */
.gallery-loading {
    text-align: center;
    padding: 60px 40px;
    color: #888;
    grid-column: 1 / -1;
}

.gallery-loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Empty state */
.gallery-empty {
    text-align: center;
    padding: 60px 40px;
    color: #666;
    grid-column: 1 / -1;
    font-size: 1.1rem;
}

/* Lightbox Responsive */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 85%;
        max-height: 85%;
    }

    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        width: 45px;
        height: 45px;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .lightbox-content {
        max-width: 90%;
        max-height: 80%;
    }

    .lightbox-nav {
        top: auto;
        bottom: 80px;
        transform: none;
        width: 50px;
        height: 50px;
        background: rgba(0, 0, 0, 0.8);
        border-color: rgba(255, 255, 255, 0.5);
    }

    .lightbox-prev {
        left: 20px;
    }

    .lightbox-next {
        right: 20px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .lightbox-info {
        bottom: 10px;
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}
