/* custom_gallery.css */
.custom-product-gallery {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 50%;
    float: left;
    margin-bottom: 30px;
    box-sizing: border-box;
    padding-right: 30px;
}

.custom-gallery-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100px;
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.custom-gallery-thumbnails::-webkit-scrollbar {
    width: 5px;
}

.custom-gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.custom-thumb {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0.6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    background: #fff;
    flex-shrink: 0;
}

.custom-thumb img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.custom-thumb:hover {
    opacity: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.custom-thumb.active {
    opacity: 1;
    border-color: var(--primary, #8CBC4F);
}

.custom-gallery-main {
    flex: 0 0 auto;
    width: fit-content;
    height: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    line-height: 0;
}

.custom-gallery-main a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.custom-gallery-main img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    transition: opacity 0.15s ease-in-out;
    padding: 0;
    box-sizing: border-box;
}

@media (max-width: 991px) {
    .custom-product-gallery {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        float: none !important;
        padding-right: 0 !important;
        margin-bottom: 20px !important;
    }

    .custom-gallery-main {
        margin-left: 75px !important;
        width: calc(100% - 75px) !important;
        height: auto !important;
        min-height: unset !important;
        padding: 0px !important;
        line-height: 0 !important;
    }

    .custom-gallery-main img {
        padding: 0px !important;
    }

    .custom-gallery-thumbnails {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        height: 100% !important;
        /* Constrain strictly to main image height */
        width: 65px !important;
        max-height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding-bottom: 0px !important;
        margin-top: 0px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        gap: 10px !important;
    }

    .custom-thumb {
        width: 60px !important;
        height: 60px !important;
        flex: 0 0 auto !important;
    }

    .custom-thumb img {
        height: 100% !important;
        object-fit: cover !important;
    }
}