.product-gallery {
    padding: 20px;
    background: #fff;
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 500px;
}

/* Thumbnails */
.thumbnails {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 460px;
    overflow-y: unset;
}

.thumb-item {
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.7;
    width: 70px;
    height: 70px;
}

.thumb-item:hover {
    opacity: 1;
    border-color: #666;
}

.thumb-item.active {
    border-color: #0066c0;
    opacity: 1;
}

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

/* Main Image */
.main-image-container {
    position: relative;
    width: 100%;
    height: 460px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    object-fit: contain;
}

/* Mobile Thumbnails */
.mobile-thumbnails {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 0;
    margin-bottom: 0px;
    -webkit-overflow-scrolling: touch;
}

.mobile-thumbnails .thumb-item {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
}

/* Custom Modal Styles */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 999999999 !important;
    padding: 80px 20px 20px 20px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.custom-modal-content {
    position: relative;
    width: 90%;
    height: 90vh;
    max-width: 1200px;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.modal-image-container {
    flex: 1;
    position: relative;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.custom-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
    z-index: 1050;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.custom-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}

.modal-zoom-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.modal-thumbnails-container {
    height: 100px;
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-thumbnails {
    height: 100%;
    padding: 15px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    -webkit-overflow-scrolling: touch;
}

.modal-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.modal-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.modal-thumbnails::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.modal-thumb-item {
    flex: 0 0 auto;
    width: 70px;
    height: 70px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.6;
    overflow: hidden;
}

.modal-thumb-item:hover {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.5);
}

.modal-thumb-item.active {
    border-color: #fff;
    opacity: 1;
}

.modal-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Animation */
.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Responsive */
@media (max-width: 767px) {
    .product-gallery {
        padding: 10px;
        margin: 0;
        max-height: 400px;
    }

    .main-image-container {
        margin-bottom: 10px;
        height: 340px;
    }
    
    .mobile-thumbnails {
        height: 60px;
    }
    
    .custom-modal {
        padding: 10px;
    }
    
    .custom-modal-content {
        width: 95%;
        height: 90vh;
        margin: 10px auto;
    }
    
    .modal-image-container {
        padding: 10px;
    }
    
    .modal-thumbnails-container {
        height: 80px;
    }
    
    .modal-thumbnails {
        padding: 10px;
    }

    .modal-thumb-item {
        width: 60px;
        height: 60px;
    }

    .custom-modal-close {
        top: 5px;
        right: 5px;
        font-size: 35px;
        background: rgba(0, 0, 0, 0.7);
        width: 45px;
        height: 45px;
        border: 2px solid rgba(255, 255, 255, 0.5);
    }

    .modal-main-image {
        max-width: calc(100% - 20px);
        max-height: calc(100% - 20px);
    }
}

/* Additional mobile styles for close button */
@media (max-width: 767px) {
    .modal-image-container {
        position: relative;
    }

    .custom-modal-close {
        position: absolute;
        top: 50px;
        right: 15px;
        background: rgba(0, 0, 0, 0.8);
        border: 1.5px solid rgba(255, 255, 255, 0.8);
    }
} 