/* ===================================
   Product Gallery Component
   =================================== */

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Main Image */
.gallery-main {
    position: relative;
    width: 100%;
    background-color: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    min-height: 280px;
}

.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    transition: transform var(--transition);
}

.gallery-main.zoomed {
    cursor: zoom-out;
}

.gallery-main.zoomed img {
    transform: scale(2);
}

/* Zoom Lens */
.zoom-lens {
    position: absolute;
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    width: 200px;
    height: 200px;
    pointer-events: none;
    display: none;
}

.gallery-main:hover .zoom-lens {
    display: block;
}

/* Navigation Arrows */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 2;
}

.gallery-nav-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn.prev {
    left: var(--spacing-md);
}

.gallery-nav-btn.next {
    right: var(--spacing-md);
}

/* Thumbnails */
.gallery-thumbnails {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    padding: var(--spacing-xs);
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: var(--color-bg-gray);
    border-radius: var(--radius);
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: var(--radius);
}

.gallery-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    background-color: var(--color-bg-gray);
}

.gallery-thumb:hover {
    border-color: var(--color-primary-light);
}

.gallery-thumb.active {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fullscreen Gallery Modal */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--spacing-xl);
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.gallery-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.gallery-modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-full);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.gallery-modal-close:hover {
    background: var(--color-danger);
    color: white;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-thumb {
        width: 60px;
        height: 60px;
    }
    
    .gallery-nav-btn {
        width: 32px;
        height: 32px;
    }
}
