/*
    Hood Archery Shop - V7.2 mobile product gallery flow hardfix
    nopCommerce 4.80 + Element + SevenSpikes CloudZoom/Slick carousel

    Fixes mobile overlap where CloudZoom thumbnail carousel/grid visually overflows
    the .gallery box and .overview / review / short-description begins over thumbnails.

    Strategy:
    - On mobile, force thumbnail area into one horizontal scroll strip.
    - Keep gallery, thumbs and overview in normal document flow.
    - Hide carousel arrows/dots on mobile to avoid absolute-position overlays.
    - JS companion file additionally reserves dynamic gallery height after images/slick load.
*/

@media all and (max-width: 767px) {
    .html-product-details-page .product-essential,
    .product-details-page .product-essential {
        display: block !important;
        clear: both !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        contain: none !important;
    }

    .html-product-details-page .product-essential::after,
    .product-details-page .product-essential::after {
        content: "";
        display: block;
        clear: both;
    }

    .html-product-details-page .product-essential > .gallery,
    .product-details-page .product-essential > .gallery {
        display: block !important;
        float: none !important;
        clear: both !important;
        position: relative !important;
        z-index: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 auto 26px !important;
        padding: 0 !important;
        overflow: visible !important;
        contain: none !important;
        box-sizing: border-box !important;
    }

    .html-product-details-page .gallery::after,
    .product-details-page .gallery::after,
    .html-product-details-page .sevenspikes-cloudzoom-gallery::after,
    .product-details-page .sevenspikes-cloudzoom-gallery::after {
        content: "";
        display: block;
        clear: both;
    }

    .html-product-details-page .sevenspikes-cloudzoom-gallery,
    .product-details-page .sevenspikes-cloudzoom-gallery,
    .html-product-details-page .gallery .picture-wrapper,
    .product-details-page .gallery .picture-wrapper,
    .html-product-details-page .gallery #sevenspikes-cloud-zoom,
    .product-details-page .gallery #sevenspikes-cloud-zoom,
    .html-product-details-page .gallery .picture,
    .product-details-page .gallery .picture,
    .html-product-details-page .gallery .picture-link {
        display: block !important;
        float: none !important;
        clear: both !important;
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        contain: none !important;
        box-sizing: border-box !important;
        aspect-ratio: auto !important;
    }

    .html-product-details-page .gallery .picture-wrapper,
    .product-details-page .gallery .picture-wrapper,
    .html-product-details-page .gallery #sevenspikes-cloud-zoom,
    .product-details-page .gallery #sevenspikes-cloud-zoom {
        overflow: hidden !important;
        margin: 0 auto 8px !important;
        text-align: center !important;
        font-size: 0 !important;
    }

    .html-product-details-page .gallery img.cloudzoom,
    .product-details-page .gallery img.cloudzoom,
    .html-product-details-page .gallery #cloudZoomImage,
    .product-details-page .gallery #cloudZoomImage {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        object-fit: contain !important;
        aspect-ratio: auto !important;
    }

    /* Force thumbs to one horizontal strip. This avoids multi-row overflow under .gallery. */
    .html-product-details-page .gallery .picture-thumbs,
    .product-details-page .gallery .picture-thumbs,
    .html-product-details-page .gallery .picture-thumbs.in-carousel,
    .product-details-page .gallery .picture-thumbs.in-carousel {
        display: block !important;
        float: none !important;
        clear: both !important;
        position: relative !important;
        z-index: 5 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 92px !important;
        max-height: none !important;
        margin: 8px auto 0 !important;
        padding: 0 8px !important;
        overflow: hidden !important;
        contain: none !important;
        box-sizing: border-box !important;
    }

    .html-product-details-page .gallery .picture-thumbs-list,
    .product-details-page .gallery .picture-thumbs-list,
    .html-product-details-page .gallery #picture-thumbs-carousel,
    .product-details-page .gallery #picture-thumbs-carousel,
    .html-product-details-page .gallery .picture-thumbs .slick-slider,
    .product-details-page .gallery .picture-thumbs .slick-slider,
    .html-product-details-page .gallery .picture-thumbs .slick-list,
    .product-details-page .gallery .picture-thumbs .slick-list {
        display: block !important;
        visibility: visible !important;
        float: none !important;
        clear: both !important;
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 92px !important;
        max-height: none !important;
        margin: 0 auto !important;
        padding: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
        text-align: left !important;
        font-size: 0 !important;
        -webkit-overflow-scrolling: touch !important;
        contain: none !important;
        box-sizing: border-box !important;
    }

    .html-product-details-page .gallery .picture-thumbs .slick-track,
    .product-details-page .gallery .picture-thumbs .slick-track {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        float: none !important;
        position: relative !important;
        transform: none !important;
        width: max-content !important;
        min-width: 100% !important;
        height: auto !important;
        min-height: 92px !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        contain: none !important;
    }

    .html-product-details-page .gallery .picture-thumb,
    .product-details-page .gallery .picture-thumb,
    .html-product-details-page .gallery .picture-thumbs .slick-slide {
        display: inline-block !important;
        float: none !important;
        flex: 0 0 84px !important;
        width: 84px !important;
        min-width: 84px !important;
        max-width: 84px !important;
        height: 84px !important;
        min-height: 84px !important;
        max-height: 84px !important;
        margin: 0 5px !important;
        padding: 0 !important;
        vertical-align: top !important;
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .html-product-details-page .gallery .picture-thumbs a.cloudzoom-gallery,
    .product-details-page .gallery .picture-thumbs a.cloudzoom-gallery,
    .html-product-details-page .gallery .picture-thumbs .thumb-item,
    .product-details-page .gallery .picture-thumbs .thumb-item {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 84px !important;
        min-width: 84px !important;
        max-width: 84px !important;
        height: 84px !important;
        min-height: 84px !important;
        max-height: 84px !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .html-product-details-page .gallery .picture-thumbs a.cloudzoom-gallery::before,
    .product-details-page .gallery .picture-thumbs a.cloudzoom-gallery::before {
        content: none !important;
        display: none !important;
        padding-top: 0 !important;
    }

    .html-product-details-page .gallery .picture-thumbs img,
    .product-details-page .gallery .picture-thumbs img,
    .html-product-details-page .gallery .picture-thumbs .cloud-zoom-gallery-img,
    .product-details-page .gallery .picture-thumbs .cloud-zoom-gallery-img {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: cover !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .html-product-details-page .gallery .picture-thumbs .slick-prev,
    .product-details-page .gallery .picture-thumbs .slick-prev,
    .html-product-details-page .gallery .picture-thumbs .slick-next,
    .product-details-page .gallery .picture-thumbs .slick-next,
    .html-product-details-page .gallery .slick-dots,
    .product-details-page .gallery .slick-dots {
        display: none !important;
    }

    .html-product-details-page .product-essential > .overview,
    .product-details-page .product-essential > .overview {
        display: block !important;
        float: none !important;
        clear: both !important;
        position: relative !important;
        z-index: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 auto 32px !important;
        padding: 14px 18px 0 !important;
        overflow: visible !important;
        text-align: center !important;
        box-sizing: border-box !important;
        contain: none !important;
    }

    .html-product-details-page .overview .product-reviews-overview,
    .product-details-page .overview .product-reviews-overview,
    .html-product-details-page .overview .short-description,
    .product-details-page .overview .short-description {
        display: block !important;
        clear: both !important;
        position: relative !important;
        z-index: 1 !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .html-product-details-page .overview .short-description,
    .product-details-page .overview .short-description {
        margin: 18px 0 26px !important;
        padding: 0 0 24px !important;
        border-bottom: 1px solid #eee !important;
        font-size: 15px !important;
        line-height: 1.55 !important;
        text-align: center !important;
    }
}
