/**
 * Simple Product Gallery Styles (No Owl Carousel)
 * 
 * @package VerdenoGarden
 * @version 1.0.0
 */

/* Gallery Container */
.product-gallery-container {
    width: 100%;
    max-width: 100%;
}

/* Main Gallery */
.product-main-gallery {
    width: 100%;
    margin-bottom: 15px;
    position: relative;
}

.main-image-wrapper {
    width: 100%;
    position: relative;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    border: none;
    box-shadow: none;
    /* Create square aspect ratio */
    padding-bottom: 100%; /* 1:1 Aspect Ratio */
    height: 0;
}

.main-product-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    z-index: 1;
    transition: transform 0.18s ease-out;
    will-change: transform;
}

.main-image-wrapper.zoom-enabled {
    cursor: zoom-in;
}

.main-image-wrapper.zoom-enabled:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.main-image-wrapper.zoom-active {
    cursor: zoom-out;
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.2);
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.main-image-wrapper.zoom-active .main-product-image {
    transition: transform 0.1s ease-out;
}

/* Thumbnail Gallery */
.product-thumb-gallery {
    width: 100%;
    position: relative;
    margin-top: 20px !important;
    padding: 0 40px;
}

.thumb-gallery-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
}

.thumb-gallery-inner {
    display: flex;
    gap: 12px;
    transition: transform 0.3s ease;
    width: 100%;
    justify-content: center;
}

/* Thumbnail Items */
.thumb-item {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    padding: 2px;
    position: relative;
}

.thumb-item:hover {
    border-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.thumb-item.active {
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.thumb-item.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #4CAF50;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 4px;
}

/* Navigation Buttons */
.thumb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 2px solid #e0e0e0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #666;
}

.thumb-nav:hover {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.thumb-prev {
    left: 0;
}

.thumb-next {
    right: 0;
}

.thumb-nav i {
    font-size: 12px;
}

.thumb-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.thumb-nav:disabled:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: #e0e0e0;
    color: inherit;
}

/* For scrollable thumbnails */
.thumb-gallery-scrollable .thumb-gallery-inner {
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #f0f0f0;
}

.thumb-gallery-scrollable .thumb-gallery-inner::-webkit-scrollbar {
    height: 6px;
}

.thumb-gallery-scrollable .thumb-gallery-inner::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.thumb-gallery-scrollable .thumb-gallery-inner::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-thumb-gallery {
        padding: 0 30px;
    }
    
    .thumb-item {
        flex: 0 0 70px;
        width: 70px;
        height: 70px;
    }
    
    .thumb-nav {
        width: 30px;
        height: 30px;
    }
    
    .thumb-nav i {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .product-thumb-gallery {
        padding: 0 25px;
    }
    
    .thumb-item {
        flex: 0 0 60px;
        width: 60px;
        height: 60px;
    }
    
    .thumb-gallery-inner {
        gap: 8px;
    }
    
    .thumb-gallery-wrapper {
        padding: 8px;
    }
}

/* Loading State */
.main-image-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
