/* =========================================================
   BARRY BANGERS PRODUCT GALLERY — v1.1.0
   Standalone presentation layer for WooCommerce product images.
========================================================= */

.single-product .woocommerce-product-gallery {
    position: relative;
    margin-bottom: 24px !important;
}

.single-product .woocommerce-product-gallery__wrapper {
    margin: 0 !important;
}

.single-product .woocommerce-product-gallery__image {
    overflow: hidden;
    border-radius: 12px;
    background: #f2f2f2;
}

.single-product .woocommerce-product-gallery__image > a {
    display: block;
    cursor: zoom-in;
}

.single-product .woocommerce-product-gallery__image img {
    display: block;
    width: 100%;
    height: auto;
}

/* Hide WooCommerce's legacy magnifier because BBPG provides its own controls. */
.single-product .woocommerce-product-gallery__trigger {
    display: none !important;
}

/* =========================================================
   MAIN IMAGE CONTROLS
========================================================= */

.bbpg-main-prev,
.bbpg-main-next {
    position: absolute;
    top: 40%;
    z-index: 25;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    background: rgba(10,10,10,.62);
    color: #fff;
    font-size: 31px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.bbpg-main-prev {
    left: 14px;
}

.bbpg-main-next {
    right: 14px;
}

.bbpg-main-prev:hover,
.bbpg-main-prev:focus-visible,
.bbpg-main-next:hover,
.bbpg-main-next:focus-visible {
    background: #fa6401;
    border-color: #fa6401;
    transform: scale(1.05);
    outline: none;
}

.bbpg-main-counter {
    position: absolute;
    right: 14px;
    bottom: 92px;
    z-index: 25;
    min-width: 64px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(10,10,10,.68);
    color: #fff;
    font-family: Inter, Arial, sans-serif;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    backdrop-filter: blur(8px);
}

.bbpg-view-all {
    position: absolute;
    left: 14px;
    bottom: 92px;
    z-index: 25;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 999px;
    background: rgba(10,10,10,.68);
    color: #fff;
    font-family: Inter, Arial, sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition:
        background-color 160ms ease,
        border-color 160ms ease;
}

.bbpg-view-all:hover,
.bbpg-view-all:focus-visible {
    background: #fa6401;
    border-color: #fa6401;
    outline: none;
}

/* =========================================================
   MODERN THUMBNAIL STRIP
========================================================= */

.single-product .woocommerce-product-gallery .flex-control-thumbs {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
    margin: 10px 0 0 !important;
    padding: 0 !important;
    list-style: none;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs li {
    position: relative;
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 9px;
    background: #ececec;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    transition:
        border-color 160ms ease,
        transform 160ms ease;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs li:hover {
    transform: translateY(-1px);
}

.single-product .woocommerce-product-gallery .flex-control-thumbs img {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-fit: cover;
    opacity: .72;
    cursor: pointer;
    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs img:hover,
.single-product .woocommerce-product-gallery .flex-control-thumbs img.flex-active {
    opacity: 1;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs li:has(img.flex-active) {
    border-color: #fa6401;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs li.bbpg-hidden-thumb {
    display: none !important;
}

/* =========================================================
   FULLSCREEN LIGHTBOX
========================================================= */

.bbpg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 58px 78px 72px;
    background: rgba(5,5,5,.97);
    font-family: Inter, Arial, sans-serif;
}

.bbpg-lightbox.is-open {
    display: flex;
}

.bbpg-lightbox__stage {
    position: relative;
    width: min(1500px, 100%);
    height: min(84vh, 1000px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbpg-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 22px 80px rgba(0,0,0,.42);
}

.bbpg-lightbox__close,
.bbpg-lightbox__prev,
.bbpg-lightbox__next {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.10);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 160ms ease, border-color 160ms ease;
}

.bbpg-lightbox__close:hover,
.bbpg-lightbox__prev:hover,
.bbpg-lightbox__next:hover {
    background: #fa6401;
    border-color: #fa6401;
}

.bbpg-lightbox__close {
    top: 18px;
    right: 22px;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    font-size: 30px;
}

.bbpg-lightbox__prev,
.bbpg-lightbox__next {
    top: 50%;
    width: 50px;
    height: 58px;
    margin-top: -29px;
    border-radius: 999px;
    font-size: 34px;
}

.bbpg-lightbox__prev {
    left: 18px;
}

.bbpg-lightbox__next {
    right: 18px;
}

.bbpg-lightbox__counter {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

body.bbpg-lightbox-open {
    overflow: hidden !important;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {
    .single-product .woocommerce-product-gallery__image {
        border-radius: 9px;
    }

    .single-product .woocommerce-product-gallery .flex-control-thumbs {
        display: flex !important;
        gap: 7px;
        overflow-x: auto;
        padding-bottom: 3px !important;
        scrollbar-width: none;
    }

    .single-product .woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar {
        display: none;
    }

    .single-product .woocommerce-product-gallery .flex-control-thumbs li {
        flex: 0 0 92px;
        width: 92px !important;
        aspect-ratio: 4 / 3;
    }

    .single-product .woocommerce-product-gallery .flex-control-thumbs li.bbpg-hidden-thumb {
        display: block !important;
    }

    .bbpg-main-prev,
    .bbpg-main-next {
        top: 36%;
        width: 42px;
        height: 42px;
        margin-top: -21px;
        font-size: 28px;
    }

    .bbpg-main-prev {
        left: 8px;
    }

    .bbpg-main-next {
        right: 8px;
    }

    .bbpg-main-counter {
        right: 9px;
        bottom: 86px;
    }

    .bbpg-view-all {
        left: 9px;
        bottom: 86px;
        min-height: 34px;
        padding: 8px 12px;
        font-size: 10px;
    }

    .bbpg-lightbox {
        padding: 56px 10px 56px;
    }

    .bbpg-lightbox__stage {
        height: 76vh;
    }

    .bbpg-lightbox__close {
        top: 10px;
        right: 10px;
    }

    .bbpg-lightbox__prev,
    .bbpg-lightbox__next {
        width: 42px;
        height: 50px;
        margin-top: -25px;
    }

    .bbpg-lightbox__prev {
        left: 5px;
    }

    .bbpg-lightbox__next {
        right: 5px;
    }

    .bbpg-lightbox__counter {
        bottom: 10px;
    }
}
