:root {
    --afafka-fsg-bg: rgba(24, 16, 12, 0.96);
    --afafka-fsg-panel: rgba(255, 250, 247, 0.94);
    --afafka-fsg-text: #5a321f;
    --afafka-fsg-border: rgba(90, 50, 31, 0.16);
}

html.afafka-fsg-open,
body.afafka-fsg-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.afafka-fsg {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    width: 100vw;
    height: 100dvh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.afafka-fsg.is-open {
    display: block;
}

.afafka-fsg__backdrop {
    position: absolute;
    inset: 0;
    background: var(--afafka-fsg-bg);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.afafka-fsg__stage {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(54px, 7vw) minmax(0, 1fr) minmax(54px, 7vw);
    grid-template-rows: 66px minmax(0, 1fr);
    align-items: center;
}

.afafka-fsg__topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    pointer-events: none;
}

.afafka-fsg__counter,
.afafka-fsg__actions {
    pointer-events: auto;
}

.afafka-fsg__counter {
    min-width: 58px;
    padding: 8px 12px;
    border: 1px solid var(--afafka-fsg-border);
    border-radius: 999px;
    background: var(--afafka-fsg-panel);
    color: var(--afafka-fsg-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
}

.afafka-fsg__actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.afafka-fsg__button,
.afafka-fsg__nav {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--afafka-fsg-border);
    background: var(--afafka-fsg-panel);
    color: var(--afafka-fsg-text);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
    cursor: pointer;
    touch-action: manipulation;
}

.afafka-fsg__button {
    height: 42px;
    min-width: 42px;
    padding: 0 11px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

.afafka-fsg__button:disabled {
    opacity: 0.55;
    cursor: default;
}

.afafka-fsg__button-icon,
.afafka-fsg__nav svg {
    display: block;
    width: 21px;
    height: 21px;
}

.afafka-fsg__button-icon svg,
.afafka-fsg__nav svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.afafka-fsg__viewport {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    align-self: stretch;
    justify-self: stretch;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.afafka-fsg__image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 180ms ease;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
}

.afafka-fsg.is-dragging .afafka-fsg__image {
    transition: none !important;
}

.afafka-fsg__nav {
    position: relative;
    z-index: 4;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
}

.afafka-fsg__nav--prev {
    grid-column: 1;
    grid-row: 2;
}

.afafka-fsg__nav--next {
    grid-column: 3;
    grid-row: 2;
}

.afafka-fsg__nav.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

.afafka-fsg__loader {
    position: absolute;
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: afafka-fsg-spin 0.75s linear infinite;
    opacity: 0;
    pointer-events: none;
}

.afafka-fsg.is-loading .afafka-fsg__loader {
    opacity: 1;
}

.afafka-fsg.is-loading .afafka-fsg__image {
    opacity: 0.25;
}

@keyframes afafka-fsg-spin {
    to { transform: rotate(360deg); }
}

@media (hover: hover) and (pointer: fine) {
    .woocommerce-product-gallery img,
    .ct-product-gallery img,
    .ct-product-gallery-container img,
    .single-product .images img {
        cursor: zoom-in;
    }

    .afafka-fsg__button:hover:not(:disabled),
    .afafka-fsg__nav:hover {
        transform: translateY(-1px);
        background: #fffaf7;
    }
}

@media (max-width: 767px) {
    .afafka-fsg__stage {
        grid-template-columns: 50px minmax(0, 1fr) 50px;
        grid-template-rows: 58px minmax(0, 1fr);
    }

    .afafka-fsg__topbar {
        padding: 8px 9px;
    }

    .afafka-fsg__counter {
        min-width: 52px;
        padding: 7px 9px;
        font-size: 12px;
    }

    .afafka-fsg__actions {
        gap: 5px;
    }

    .afafka-fsg__button {
        height: 39px;
        min-width: 39px;
        padding: 0 9px;
    }

    .afafka-fsg__button-icon {
        width: 19px;
        height: 19px;
    }

    .afafka-fsg__nav {
        width: 42px;
        height: 42px;
    }

    .afafka-fsg__nav svg {
        width: 20px;
        height: 20px;
    }

    .afafka-fsg__viewport {
        padding: 0 2px 8px;
    }
}

/* ===== AFAFKA FSG ARROW COLOR MATCH START ===== */

/*
 * Make fullscreen gallery arrows use the same visual tone
 * as the collapsed round Try-On hanger button.
 */
.afafka-fsg__nav {
    background: rgba(243, 230, 219, 0.96) !important;
    border-color: rgba(90, 50, 31, 0.18) !important;
    color: #5a321f !important;
    box-shadow: 0 5px 20px rgba(72, 44, 30, 0.17) !important;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.afafka-fsg__nav svg,
.afafka-fsg__nav svg path {
    stroke: currentColor !important;
}

@media (hover: hover) and (pointer: fine) {
    .afafka-fsg__nav:hover {
        background: rgba(243, 230, 219, 0.98) !important;
        color: #5a321f !important;
        transform: translateY(-1px);
    }
}

/* ===== AFAFKA FSG ARROW COLOR MATCH END ===== */
