/* Styles pour la galerie produits améliorée */

.kb-product-gallery-wrapper {
    margin: 20px 0;
}

/* Image principale */
.kb-main-image-container {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
}

.kb-main-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

/* Effet zoom au survol */
.kb-main-image.kb-zoomable:hover {
    transform: scale(1.1);
}

/* Hint de zoom */
.kb-zoom-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.kb-main-image-container:hover .kb-zoom-hint {
    opacity: 1;
}

.kb-zoom-icon {
    font-size: 16px;
}

/* Miniatures */
.kb-gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.kb-thumbnail {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.kb-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kb-thumbnail:hover {
    border-color: #2271b1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.kb-thumbnail.active {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* Miniature vidéo */
.kb-video-thumbnail {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.kb-video-play-icon {
    font-size: 32px;
    opacity: 0.9;
}

.kb-video-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kb-video-thumbnail:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Lightbox personnalisé */
.glightbox-container {
    z-index: 99999 !important;
}

.gslide-description {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 4px;
    margin-top: 10px;
}

/* Animation de chargement */
.kb-gallery-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Badge "Nouveau" */
.kb-gallery-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #00a32a;
    color: white;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 10;
}

/* Compteur d'images */
.kb-gallery-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Navigation de la galerie */
.kb-gallery-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.kb-gallery-nav-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.kb-gallery-nav-btn:hover {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

.kb-gallery-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .kb-gallery-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }

    .kb-zoom-hint {
        display: none;
    }

    .kb-main-image.kb-zoomable {
        cursor: pointer;
    }

    .kb-main-image.kb-zoomable:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    .kb-gallery-thumbnails {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mode plein écran */
.kb-gallery-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.kb-gallery-fullscreen img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.kb-gallery-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.kb-gallery-close:hover {
    background: #e74c3c;
    color: white;
    transform: rotate(90deg);
}

/* Effet de transition */
.kb-gallery-fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}