/* ============================
   Product Gallery Styles
   ============================== */

.product-gallery-wrapper {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    align-items: start;
}

/* Thumbnails Container */
.gallery-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thumbnail-item {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #f5f5f5;
    position: relative;
}

.thumbnail-item img,
.thumbnail-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-item:hover {
    border-color: #999;
    transform: scale(1.02);
}

.thumbnail-item.active {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Video Badge on Thumbnail */
.thumbnail-item.video-thumbnail::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    z-index: 2;
}

.thumbnail-item.video-thumbnail::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    z-index: 3;
}

/* Main Gallery Display */
.gallery-main-display {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    background: #f9f9f9;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main-display img,
.gallery-main-display video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Zoom Button */
.gallery-zoom-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-zoom-btn:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

/* Video Controls */
.gallery-main-display video {
    width: 100%;
    height: 100%;
}

.gallery-main-display video::-webkit-media-controls {
    background: rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-gallery-wrapper {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gallery-thumbnails {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .thumbnail-item {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
    }

    .gallery-main-display {
        max-width: 100%;
        aspect-ratio: 1;
    }

    .gallery-zoom-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .product-gallery-wrapper {
        gap: 10px;
    }

    .gallery-thumbnails {
        gap: 8px;
    }

    .thumbnail-item {
        width: 70px;
        height: 70px;
    }

    .gallery-main-display {
        aspect-ratio: 1;
    }
}

/* Animation for fade transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gallery-main-display.fade-in {
    animation: fadeIn 0.3s ease;
}
