/**
 * WooCommerce Product Gallery Styles
 */

/* Basis container */
.wc-product-gallery-wrapper {
    max-width: 700px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Hoofd galerij container */
.wc-gallery-main {
    position: relative;
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    aspect-ratio: 16 / 9;
}

/* Afbeeldingen container */
.wc-gallery-images {
    position: relative;
    width: 100%;
    height: 100%;
}

.wc-gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-gallery-image.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.wc-gallery-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Navigatie knoppen */
.wc-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wc-gallery-nav:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(1.05);
}

.wc-gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.wc-gallery-prev {
    left: 16px;
}

.wc-gallery-next {
    right: 16px;
}

.wc-gallery-nav svg {
    color: #333;
}

.wc-gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.wc-gallery-nav:disabled:hover {
    transform: translateY(-50%) scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Thumbnails wrapper */
.wc-gallery-thumbnails-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wc-gallery-thumbnails {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.wc-gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.wc-gallery-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.wc-gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.wc-gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Thumbnail knoppen */
.wc-gallery-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #f5f5f5;
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
}

.wc-gallery-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.wc-gallery-thumbnail:hover::after {
    background: rgba(0, 0, 0, 0.05);
}

.wc-gallery-thumbnail.active {
    border-color: #333;
    box-shadow: 0 0 0 1px #333;
}

.wc-gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Favorieten knop */
.wc-gallery-favorite {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.wc-gallery-favorite:hover {
    background: #f5f5f5;
    border-color: #333;
}

.wc-gallery-favorite svg {
    color: #666;
    transition: all 0.3s ease;
}

.wc-gallery-favorite:hover svg {
    color: #e74c3c;
}

.wc-gallery-favorite.favorited svg {
    fill: #e74c3c;
    color: #e74c3c;
}

/* Responsive design */
@media (max-width: 768px) {
    .wc-product-gallery-wrapper {
        max-width: 100%;
    }
    
    .wc-gallery-nav {
        width: 40px;
        height: 40px;
    }
    
    .wc-gallery-prev {
        left: 8px;
    }
    
    .wc-gallery-next {
        right: 8px;
    }
    
    .wc-gallery-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .wc-gallery-favorite {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .wc-gallery-main {
        aspect-ratio: 4 / 3;
    }
    
    .wc-gallery-nav {
        width: 36px;
        height: 36px;
    }
    
    .wc-gallery-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .wc-gallery-thumbnail {
        width: 50px;
        height: 50px;
    }
}

/* Loading state */
.wc-gallery-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Focus states voor toegankelijkheid */
.wc-gallery-nav:focus,
.wc-gallery-thumbnail:focus,
.wc-gallery-favorite:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .wc-gallery-nav,
    .wc-gallery-thumbnails-wrapper {
        display: none;
    }
    
    .wc-gallery-main {
        page-break-inside: avoid;
    }
}
