.single-product .indufort-gallery-column {
    min-width: 0;
    position: relative;
}

.single-product .indufort-gallery-column > .woocommerce-product-gallery {
    float: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
}

/* Native gallery and native thumbnails remain available until JS is ready. */
.single-product .indufort-gallery-column .indufort-gallery-thumbnails,
.single-product .indufort-gallery-column .indufort-gallery-arrows {
    display: none;
}

.single-product .indufort-gallery-column.indufort-gallery-ready {
    --indufort-gallery-rail-width: 100px;
    --indufort-gallery-gap: 16px;
    display: grid;
    grid-template-columns: var(--indufort-gallery-rail-width) minmax(0, 1fr);
    column-gap: var(--indufort-gallery-gap);
    align-items: start;
}

.single-product .indufort-gallery-ready > .woocommerce-product-gallery {
    grid-column: 2;
    grid-row: 1;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

.single-product .indufort-gallery-ready .woocommerce-product-gallery .flex-control-thumbs,
.single-product .indufort-gallery-ready .woocommerce-product-gallery .flex-direction-nav {
    display: none !important;
}

.single-product .indufort-gallery-ready .indufort-gallery-thumbnails {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    width: 100%;
    max-height: none;
    min-height: 0;
    min-width: 0;
    /* Space around the larger buttons keeps focus rings and shadows visible. */
    padding: 6px 8px;
    overflow: visible;
}

.single-product .indufort-gallery-ready button[data-indufort-thumb-index] {
    display: block;
    box-sizing: border-box;
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    min-width: 0;
    padding: 5px;
    border: 1px solid #dce2e8;
    border-radius: 9px;
    background: #fff;
    color: inherit;
    line-height: 1;
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.single-product .indufort-gallery-ready button[data-indufort-thumb-index][hidden] {
    display: none;
}

.single-product .indufort-gallery-ready button[data-indufort-thumb-index] img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.single-product .indufort-gallery-ready button[data-indufort-thumb-index]:hover {
    border-color: var(--indufort-accent, #102a54);
}

.single-product .indufort-gallery-ready button[data-indufort-thumb-index][aria-pressed="true"] {
    border-color: var(--indufort-accent, #102a54);
    box-shadow: 0 0 0 1px var(--indufort-accent, #102a54);
}

.single-product .indufort-gallery-ready button[data-indufort-thumb-index]:focus-visible,
.single-product .indufort-gallery-ready .indufort-gallery-arrows button:focus-visible {
    outline: 2px solid var(--indufort-accent, #102a54);
    outline-offset: 3px;
}

.single-product .indufort-gallery-ready .indufort-gallery-arrows {
    position: absolute;
    z-index: 3;
    top: calc(var(--indufort-gallery-main-height, 0px) / 2);
    inset-inline-start: calc(var(--indufort-gallery-rail-width) + var(--indufort-gallery-gap) + 10px);
    inset-inline-end: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.single-product .indufort-gallery-ready .indufort-gallery-arrows button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(16, 42, 84, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    color: #102a54;
    font-size: 24px;
    line-height: 1;
    box-shadow: none;
    transition: background-color 150ms ease, border-color 150ms ease;
    cursor: pointer;
    pointer-events: auto;
}

.single-product .indufort-gallery-ready .indufort-gallery-arrows button:disabled {
    opacity: 0.2;
    cursor: default;
}

.single-product .indufort-gallery-ready .indufort-gallery-arrows button:not(:disabled):hover,
.single-product .indufort-gallery-ready .indufort-gallery-arrows button:focus-visible {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(16, 42, 84, 0.25);
}

body.single-product .indufort-product-layout .indufort-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(16, 42, 84, 0.12);
    box-shadow: none;
    transition: background-color 150ms ease, border-color 150ms ease;
}

body.single-product .indufort-product-layout .indufort-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__trigger::before {
    border-color: #102a54;
}

body.single-product .indufort-product-layout .indufort-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__trigger::after {
    background-color: #102a54;
}

body.single-product .indufort-product-layout .indufort-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__trigger:hover,
body.single-product .indufort-product-layout .indufort-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__trigger:focus-visible {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(16, 42, 84, 0.25);
}

body.single-product .indufort-product-layout .indufort-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__trigger:focus-visible {
    outline: 2px solid #102a54;
    outline-offset: 3px;
}

@media (max-width: 600px) {
    .single-product .indufort-gallery-column.indufort-gallery-ready {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .single-product .indufort-gallery-ready > .woocommerce-product-gallery {
        grid-column: 1;
        grid-row: 1;
    }

    .single-product .indufort-gallery-ready .indufort-gallery-thumbnails {
        grid-column: 1;
        grid-row: 2;
        display: grid;
        grid-template-columns: repeat(auto-fit, 72px);
        justify-content: start;
        align-items: start;
        max-height: none;
        padding: 6px;
        overflow: visible;
    }

    .single-product .indufort-gallery-ready button[data-indufort-thumb-index] {
        width: 72px;
        height: 72px;
    }

    .single-product .indufort-gallery-ready .indufort-gallery-arrows {
        inset-inline-start: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .single-product .indufort-gallery-ready button[data-indufort-thumb-index],
    .single-product .indufort-gallery-ready .indufort-gallery-arrows button,
    body.single-product .indufort-product-layout .indufort-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
        transition: none;
    }
}
