/* AFCMall v1.3.9 — Mobile Popup Navigation Controls Fix */

/* Desktop keeps the v1.3.8 floating placement. The wrapper does not
   introduce a layout box until the mobile breakpoint. */
.afc-promo-popup__navigation {
    display: contents;
}

.afc-promo-popup__arrow,
.afc-promo-popup__dot {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.afc-promo-popup__arrow > span {
    display: block;
    line-height: 1;
    transform: translateY(-2px);
}

.afc-promo-popup__dot > span {
    display: none;
}

@media (max-width: 820px) {
    .afc-promo-popup__dialog {
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) auto;
        width: min(100%, 640px);
        max-height: calc(100dvh - 20px);
        overflow: hidden !important;
    }

    .afc-promo-popup__viewport {
        min-height: 0;
        max-height: none !important;
        overflow: hidden;
    }

    .afc-promo-popup__slide {
        max-height: none !important;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0;
    }

    /* Dedicated bottom control bar. It no longer overlays the photo,
       video, title, CTA, or the mobile close button. */
    .afc-promo-popup__navigation {
        position: relative;
        z-index: 35;
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) auto 48px;
        grid-template-areas: "prev dots counter next";
        align-items: center;
        gap: 8px;
        width: 100%;
        min-height: 68px;
        padding:
            9px
            max(10px, env(safe-area-inset-right))
            calc(9px + env(safe-area-inset-bottom))
            max(10px, env(safe-area-inset-left));
        border-top: 1px solid rgba(255,255,255,.18);
        background:
            radial-gradient(circle at 50% -20%, rgba(201,162,39,.19), transparent 44%),
            linear-gradient(135deg, rgba(5,20,37,.985), rgba(17,45,73,.985));
        box-shadow: 0 -14px 38px rgba(2,12,25,.20);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .afc-promo-popup__navigation.no-arrows {
        grid-template-columns: 48px minmax(0, 1fr) auto 48px;
    }

    .afc-promo-popup__navigation.no-dots {
        grid-template-columns: 48px minmax(0, 1fr) auto 48px;
    }

    .afc-promo-popup__arrow {
        position: static !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        width: 48px !important;
        height: 48px !important;
        min-width: 48px;
        min-height: 48px;
        padding: 0;
        border: 1px solid rgba(255,255,255,.32);
        border-radius: 15px;
        font-size: 36px !important;
        transform: none !important;
        box-shadow:
            0 8px 22px rgba(0,0,0,.22),
            inset 0 1px 0 rgba(255,255,255,.22);
    }

    .afc-promo-popup__arrow--prev {
        grid-area: prev;
        justify-self: start;
    }

    .afc-promo-popup__arrow--next {
        grid-area: next;
        justify-self: end;
    }

    .afc-promo-popup__arrow:hover:not(:disabled),
    .afc-promo-popup__arrow:active:not(:disabled) {
        transform: scale(.97) !important;
    }

    .afc-promo-popup__arrow:focus-visible {
        outline: 3px solid rgba(239,210,119,.70);
        outline-offset: 2px;
    }

    .afc-promo-popup__dots {
        position: static !important;
        grid-area: dots;
        justify-self: center;
        display: flex;
        max-width: 100%;
        min-width: 0;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 0 !important;
        overflow-x: auto;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        transform: none !important;
        scrollbar-width: none;
    }

    .afc-promo-popup__dots::-webkit-scrollbar {
        display: none;
    }

    /* 44px touch target; the visual dot is drawn by the child span. */
    .afc-promo-popup__dot {
        position: relative;
        display: grid;
        place-items: center;
        flex: 0 0 34px;
        width: 34px !important;
        height: 44px !important;
        padding: 0 !important;
        border: 0;
        background: transparent !important;
    }

    .afc-promo-popup__dot > span {
        display: block;
        width: 9px;
        height: 9px;
        border-radius: 999px;
        background: rgba(255,255,255,.48);
        transition: width .22s ease, background .22s ease, box-shadow .22s ease;
    }

    .afc-promo-popup__dot.is-active {
        width: 34px !important;
        background: transparent !important;
    }

    .afc-promo-popup__dot.is-active > span {
        width: 25px;
        background: linear-gradient(90deg,#c49a27,#f1d982);
        box-shadow: 0 3px 12px rgba(201,162,39,.34);
    }

    .afc-promo-popup__dot:focus-visible {
        outline: 2px solid rgba(239,210,119,.72);
        outline-offset: -4px;
        border-radius: 12px;
    }

    .afc-promo-popup__counter {
        position: static !important;
        grid-area: counter;
        justify-self: end;
        min-width: 50px;
        margin: 0;
        padding: 6px 9px;
        transform: none !important;
    }

    /* Navigation now occupies its own row, so extra overlay padding is
       no longer needed inside every slide. */
    .afc-promo-popup__slide-inner .afc-promo-popup__content,
    .afc-popup-layout-minimal .afc-promo-popup__slide-inner .afc-promo-popup__content {
        padding-bottom: clamp(25px, 5vw, 34px) !important;
    }
}

@media (max-width: 480px) {
    .afc-promo-popup__navigation {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        grid-template-areas: "prev dots next";
        gap: 5px;
        min-height: 62px;
        padding-top: 7px;
    }

    .afc-promo-popup__arrow {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px;
        min-height: 44px;
        border-radius: 13px;
        font-size: 33px !important;
    }

    .afc-promo-popup__counter {
        display: none !important;
    }

    .afc-promo-popup__dot {
        flex-basis: 30px;
        width: 30px !important;
    }

    .afc-promo-popup__dot.is-active {
        width: 30px !important;
    }

    .afc-promo-popup__dot.is-active > span {
        width: 21px;
    }
}

@media (max-width: 350px) {
    .afc-promo-popup__navigation {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
    }

    .afc-promo-popup__arrow {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px;
        min-height: 42px;
    }

    .afc-promo-popup__dot {
        flex-basis: 26px;
        width: 26px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .afc-promo-popup__dot > span,
    .afc-promo-popup__arrow {
        transition: none !important;
    }
}
