/**
 * Product Gallery & Lightbox Styles
 */

/* Product Gallery Grid */
.product-gallery {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.product-main-image {
    flex: 1;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f9fa;
}

.product-main-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.product-main-image:hover img {
    transform: scale(1.05);
}

.product-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 100px;
}

.product-gallery-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.product-gallery-thumbnail:hover {
    border-color: #E22828;
    transform: scale(1.05);
}

.product-gallery-thumbnail.active {
    border-color: #E22828;
}

/* Lightbox */
.product-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.product-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    margin: 0 auto;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    transition: transform 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(226, 40, 40, 0.8);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 15px;
    border-radius: 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Product Card Image */
.product-card-image {
    width: 100%;
    height: 200px;
    max-width: 180px;
    max-height: 180px;
    margin: 0 auto;
    padding: 14px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.product-card-image-placeholder {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
    border-radius: 8px 8px 0 0;
}

/* Responsive */
@media (max-width: 768px) {
    .product-gallery {
        flex-direction: column-reverse;
    }
    
    .product-thumbnails {
        flex-direction: row;
        max-width: 100%;
        overflow-x: auto;
    }
    
    .product-gallery-thumbnail {
        flex-shrink: 0;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        padding: 5px 10px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }
    
    .lightbox-counter {
        bottom: 10px;
    }
}
