/* ==========================================================
   FireHub Product Gallery V4
   Independent gallery: MAIN IMAGE + horizontal thumbnails
   ========================================================== */

.single-product .fh-product-gallery-v4 {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Main image box */
.single-product .fh-product-gallery-v4 .fh-gallery-main {
    width: 100% !important;
    height: 500px !important;
    min-height: 500px !important;
    max-height: 500px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    border: 1px solid #E3E6EA !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* The link fills the frame but never changes image ratio */
.single-product .fh-product-gallery-v4 .fh-gallery-main-link {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
}

/* IMPORTANT: use original/full image, no crop */
.single-product .fh-product-gallery-v4 #fh-gallery-main-image {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 96% !important;
    max-height: 96% !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
}

/* Thumbnail strip */
.single-product .fh-product-gallery-v4 .fh-gallery-thumbs {
    width: 100% !important;
    height: 92px !important;
    min-height: 92px !important;
    margin-top: 12px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 2px 4px !important;
    box-sizing: border-box !important;
    scrollbar-width: thin !important;
}

/* Each thumbnail */
.single-product .fh-product-gallery-v4 .fh-gallery-thumb {
    flex: 0 0 82px !important;
    width: 82px !important;
    height: 82px !important;
    min-width: 82px !important;
    min-height: 82px !important;
    max-width: 82px !important;
    max-height: 82px !important;
    padding: 4px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    border: 1px solid #E1E5EA !important;
    border-radius: 9px !important;
    overflow: hidden !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.single-product .fh-product-gallery-v4 .fh-gallery-thumb img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: .62 !important;
}

.single-product .fh-product-gallery-v4 .fh-gallery-thumb:hover img,
.single-product .fh-product-gallery-v4 .fh-gallery-thumb.is-active img {
    opacity: 1 !important;
}

.single-product .fh-product-gallery-v4 .fh-gallery-thumb.is-active {
    border-color: #E63322 !important;
    box-shadow: 0 0 0 1px #E63322 !important;
}

/* Empty */
.single-product .fh-product-gallery-v4--empty .fh-gallery-main {
    color: #8A929E;
}

/* Mobile */
@media (max-width: 900px) {
    .single-product .fh-product-gallery-v4 .fh-gallery-main {
        height: 430px !important;
        min-height: 430px !important;
        max-height: 430px !important;
    }
}

@media (max-width: 640px) {
    .single-product .fh-product-gallery-v4 .fh-gallery-main {
        height: 360px !important;
        min-height: 360px !important;
        max-height: 360px !important;
        border-radius: 12px !important;
    }

    .single-product .fh-product-gallery-v4 #fh-gallery-main-image {
        max-width: 94% !important;
        max-height: 94% !important;
    }

    .single-product .fh-product-gallery-v4 .fh-gallery-thumbs {
        height: 76px !important;
        min-height: 76px !important;
        gap: 8px !important;
    }

    .single-product .fh-product-gallery-v4 .fh-gallery-thumb {
        flex-basis: 68px !important;
        width: 68px !important;
        min-width: 68px !important;
        height: 68px !important;
        min-height: 68px !important;
        max-width: 68px !important;
        max-height: 68px !important;
    }
}
