/* Retail Experience Theme v1.7.4 — unified, single-owner product gallery.
 * One stage, one thumbnail rail and no competing FlexSlider presentation.
 */
body.retail-route-product .woocommerce-product-gallery,
body.retail-route-product .woocommerce-product-gallery.images {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Safe no-JavaScript presentation. */
body.retail-route-product .woocommerce-product-gallery:not(.retail-v174-gallery-controlled) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child) {
    display: none !important;
}

/* Native WooCommerce/FlexSlider controls must never coexist with the theme rail. */
body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled > .flex-control-nav,
body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled > .flex-direction-nav,
body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled > .flex-pauseplay,
body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled .flex-control-thumbs,
body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled .flex-direction-nav {
    display: none !important;
}

body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled {
    position: relative !important;
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

body.retail-route-product .retail-v174-gallery-layout {
    display: grid !important;
    grid-template-columns: 84px minmax(0, 1fr) !important;
    gap: 1rem !important;
    align-items: start !important;
    width: 100% !important;
    min-width: 0 !important;
}

body.retail-route-product .retail-v174-gallery-stage {
    position: relative !important;
    display: grid !important;
    min-width: 0 !important;
    aspect-ratio: 1 / 1 !important;
    place-items: center !important;
    overflow: hidden !important;
    border: 1px solid rgba(23, 25, 41, .09) !important;
    border-radius: 20px !important;
    background: #fff !important;
}

body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled .woocommerce-product-gallery__wrapper {
    position: relative !important;
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
}

body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled .woocommerce-product-gallery__image {
    display: none !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    transform: none !important;
}

body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled .woocommerce-product-gallery__image.is-retail-gallery-active {
    display: grid !important;
    place-items: center !important;
}

body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled .woocommerce-product-gallery__image > a {
    display: grid !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    place-items: center !important;
    margin: 0 !important;
    padding: clamp(.75rem, 2vw, 1.5rem) !important;
    overflow: hidden !important;
    border-radius: inherit !important;
    background: #fff !important;
}

body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled .woocommerce-product-gallery__image img {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body.retail-route-product .retail-v174-gallery-thumbs {
    display: grid !important;
    grid-auto-rows: 76px !important;
    gap: .65rem !important;
    align-content: start !important;
    width: 84px !important;
    max-height: min(650px, calc(100vh - 210px)) !important;
    margin: 0 !important;
    padding: 2px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
}

body.retail-route-product .retail-v174-gallery-thumb {
    display: grid !important;
    box-sizing: border-box !important;
    width: 76px !important;
    height: 76px !important;
    place-items: center !important;
    margin: 0 !important;
    padding: .35rem !important;
    overflow: hidden !important;
    border: 1px solid rgba(23, 25, 41, .14) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

body.retail-route-product .retail-v174-gallery-thumb[aria-current="true"] {
    border-color: var(--retail-primary, #2023a9) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--retail-primary, #2023a9) 18%, transparent) !important;
}

body.retail-route-product .retail-v174-gallery-thumb:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--retail-primary, #2023a9) 30%, transparent) !important;
    outline-offset: 2px !important;
}

body.retail-route-product .retail-v174-gallery-thumb img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body.retail-route-product .retail-v174-gallery-controls {
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 5 !important;
}

body.retail-route-product .retail-v174-gallery-arrow {
    position: absolute !important;
    top: 50% !important;
    display: grid !important;
    width: 44px !important;
    height: 44px !important;
    place-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(23, 25, 41, .13) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .96) !important;
    color: var(--retail-ink, #171929) !important;
    box-shadow: 0 10px 28px rgba(17, 20, 43, .12) !important;
    font: inherit !important;
    font-size: 2rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    transform: translateY(-50%) !important;
}

body.retail-route-product .retail-v174-gallery-arrow--previous { left: .75rem !important; }
body.retail-route-product .retail-v174-gallery-arrow--next { right: .75rem !important; }
body.retail-route-product .retail-v174-gallery-arrow:hover,
body.retail-route-product .retail-v174-gallery-arrow:focus-visible {
    border-color: var(--retail-primary, #2023a9) !important;
    color: var(--retail-primary, #2023a9) !important;
    outline: none !important;
}

body.retail-route-product .retail-v174-gallery-counter {
    position: absolute !important;
    right: .75rem !important;
    bottom: .75rem !important;
    min-width: 54px !important;
    padding: .42rem .7rem !important;
    border: 1px solid rgba(23, 25, 41, .1) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .94) !important;
    color: var(--retail-ink, #171929) !important;
    font-size: .72rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-align: center !important;
    pointer-events: none !important;
}

body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-controlled .woocommerce-product-gallery__trigger {
    top: .75rem !important;
    right: .75rem !important;
    z-index: 8 !important;
}

body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-single .retail-v174-gallery-thumbs,
body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-single .retail-v174-gallery-controls {
    display: none !important;
}

body.retail-route-product .woocommerce-product-gallery.retail-v174-gallery-single .retail-v174-gallery-layout {
    grid-template-columns: minmax(0, 1fr) !important;
}

@media (max-width: 980px) {
    body.retail-route-product .retail-v174-gallery-layout {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: .8rem !important;
    }

    body.retail-route-product .retail-v174-gallery-stage {
        grid-row: 1 !important;
    }

    body.retail-route-product .retail-v174-gallery-thumbs {
        grid-row: 2 !important;
        grid-auto-flow: column !important;
        grid-auto-columns: 72px !important;
        grid-auto-rows: 72px !important;
        width: 100% !important;
        max-height: none !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 2px 2px .35rem !important;
    }

    body.retail-route-product .retail-v174-gallery-thumb {
        width: 72px !important;
        height: 72px !important;
    }
}

@media (max-width: 700px) {
    body.retail-route-product .retail-v174-gallery-stage {
        min-height: 320px !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 16px !important;
    }

    body.retail-route-product .retail-v174-gallery-arrow {
        width: 40px !important;
        height: 40px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.retail-route-product .retail-v174-gallery-arrow,
    body.retail-route-product .retail-v174-gallery-thumb {
        transition: none !important;
    }
}
