/* Modern Product Gallery Styles */
.product-gallery-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
}

/* Main Image Container */
.product-main-image-container {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    cursor: zoom-in;
    transition: box-shadow 0.3s ease;
}

.product-main-image-container:hover {
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.2);
}

.product-main-image-container.zoomed {
    cursor: zoom-out;
}

.product-main-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background: #f8f8f8;
}

.product-main-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center center;
}

.product-main-image-container:hover img {
    transform: scale(1.05);
}

.product-main-image-container.zoomed img {
    transform: scale(2.5);
    cursor: grab;
}

.product-main-image-container.zoomed img:active {
    cursor: grabbing;
}

/* Zoom Indicator */
.zoom-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(139, 69, 19, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-indicator i {
    font-size: 16px;
}

.product-main-image-container:hover .zoom-indicator {
    opacity: 1;
}

.product-main-image-container.zoomed .zoom-indicator {
    opacity: 1;
    background: rgba(139, 69, 19, 0.95);
}

/* Lightbox Button */
.lightbox-trigger {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(139, 69, 19, 0.9);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lightbox-trigger:hover {
    background: rgba(139, 69, 19, 1);
    transform: scale(1.1);
    color: white;
}

.product-main-image-container:hover .lightbox-trigger {
    opacity: 1;
}

.lightbox-trigger i {
    font-size: 18px;
}

/* Thumbnail Gallery */
.product-thumbnail-gallery {
    position: relative;
    width: 100%;
    padding: 0 5px;
}

.thumbnail-scroll-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #8b4513 #f0f0f0;
}

.thumbnail-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-scroll-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.thumbnail-scroll-container::-webkit-scrollbar-thumb {
    background: #8b4513;
    border-radius: 3px;
}

.thumbnail-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #6b3410;
}

.thumbnail-item {
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.thumbnail-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
    border-color: rgba(139, 69, 19, 0.5);
}

.thumbnail-item.active {
    border-color: #8b4513;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4);
    transform: translateY(-3px);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbnail-item:hover img {
    transform: scale(1.1);
}

.thumbnail-item.active img {
    transform: scale(1.05);
}

/* Navigation Arrows for Thumbnails */
.thumbnail-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(139, 69, 19, 0.9);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.product-thumbnail-gallery:hover .thumbnail-nav {
    opacity: 1;
}

.thumbnail-nav:hover {
    background: rgba(139, 69, 19, 1);
    transform: translateY(-50%) scale(1.1);
}

.thumbnail-nav.prev {
    left: -15px;
}

.thumbnail-nav.next {
    right: -15px;
}

.thumbnail-nav i {
    font-size: 14px;
}

/* Image Counter */
.image-counter {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-main-image-container:hover .image-counter {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 992px) {
    .product-main-image-wrapper {
        padding-top: 70%;
    }
    
    .thumbnail-item {
        width: 80px;
        height: 80px;
    }
    
    .product-main-image-container.zoomed img {
        transform: scale(2);
    }
}

@media (max-width: 768px) {
    .product-main-image-wrapper {
        padding-top: 65%;
    }
    
    .thumbnail-item {
        width: 70px;
        height: 70px;
    }
    
    .thumbnail-scroll-container {
        gap: 8px;
    }
    
    .product-main-image-container.zoomed img {
        transform: scale(1.8);
    }
    
    .zoom-indicator {
        font-size: 11px;
        padding: 8px 12px;
    }
    
    .lightbox-trigger {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .product-main-image-wrapper {
        padding-top: 60%;
    }
    
    .thumbnail-item {
        width: 60px;
        height: 60px;
    }
    
    .product-main-image-container.zoomed img {
        transform: scale(1.5);
    }
    
    .thumbnail-nav {
        display: none;
    }
}

/* Loading State */
.product-main-image-wrapper.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
