/* ============================================================
   AG.STOREEZ — HERO CAROUSEL PREMIUM
   VERSÃO FINAL CORRIGIDA
   ============================================================ */


/* ============================================================
   BASE
   ============================================================ */

.hero-showcase {
    isolation: isolate;
    position: relative;
}

.hero-showcase.carousel-ready {
    cursor: default;
}


/* ============================================================
   CARD
   ============================================================ */

.hero-showcase .showcase-card {
    cursor: pointer;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    transform-style: preserve-3d;
}


/*
 * Durante a troca impedimos cliques,
 * mas NÃO desaparecemos com o card inteiro.
 */
.hero-showcase
.showcase-card
.hero-carousel-card-transitioning {
    pointer-events: none;
}


/* ============================================================
   IMAGEM
   ============================================================ */

.hero-showcase .showcase-image {
    position: relative;
    overflow: hidden;

    isolation: isolate;

    transform:
        translate3d(
            0,
            0,
            0
        );
}


.hero-showcase .showcase-image::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: 2;

    background:
        linear-gradient(
            to top,
            rgba(5, 5, 7, 0.24),
            transparent 46%
        );

    pointer-events: none;
}


/*
 * Estado normal da imagem.
 *
 * Sem blur.
 * Sem filter.
 * Isso é importante no mobile.
 */
#heroProductImage {
    display: block;

    width: 100%;
    height: 100%;

    opacity: 1;

    transform:
        translate3d(
            0,
            0,
            0
        )
        scale(1);

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    will-change:
        opacity,
        transform;

    transition:
        opacity 180ms ease,
        transform 260ms
        cubic-bezier(
            0.22,
            0.8,
            0.3,
            1
        );
}


/*
 * Imagem atual saindo.
 *
 * É um único fade curto.
 */
#heroProductImage.hero-carousel-image-leaving {
    opacity: 0;

    transform:
        translate3d(
            0,
            4px,
            0
        )
        scale(0.99);
}


/*
 * Nova imagem entrando.
 */
#heroProductImage.hero-carousel-image-entering {
    animation:
        agHeroImageEnter
        300ms
        cubic-bezier(
            0.22,
            0.8,
            0.3,
            1
        )
        both;
}


@keyframes agHeroImageEnter {

    from {
        opacity: 0;

        transform:
            translate3d(
                0,
                4px,
                0
            )
            scale(0.99);
    }

    to {
        opacity: 1;

        transform:
            translate3d(
                0,
                0,
                0
            )
            scale(1);
    }
}


/* ============================================================
   SETAS LATERAIS
   ============================================================ */

.hero-carousel-arrow {
    position: absolute;

    top: 50%;

    z-index: 20;

    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    padding: 0;
    margin: 0;

    background:
        rgba(
            11,
            11,
            16,
            0.76
        );

    color: #ffffff;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.11
        );

    border-radius: 15px;

    box-shadow:
        0 16px 38px
        rgba(
            0,
            0,
            0,
            0.3
        );

    cursor: pointer;

    font-size: 12px;

    opacity: 0;

    -webkit-backdrop-filter:
        blur(10px);

    backdrop-filter:
        blur(10px);

    transform:
        translateY(-50%)
        scale(0.92);

    transition:
        opacity 180ms ease,
        transform 200ms ease,
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 200ms ease;
}


/*
 * Desktop.
 */
.hero-carousel-arrow.previous {
    left: -12px;
}

.hero-carousel-arrow.next {
    right: -12px;
}


.hero-showcase:hover
.hero-carousel-arrow,
.hero-carousel-arrow:focus-visible {
    opacity: 1;

    transform:
        translateY(-50%)
        scale(1);
}


.hero-carousel-arrow:hover {
    background:
        linear-gradient(
            135deg,
            #6f22d7,
            #9b4dff
        );

    color: #ffffff;

    border-color:
        rgba(
            183,
            108,
            255,
            0.5
        );

    box-shadow:
        0 18px 42px
        rgba(
            111,
            34,
            215,
            0.28
        );

    transform:
        translateY(-50%)
        scale(1.07);
}


.hero-carousel-arrow:active {
    transform:
        translateY(-50%)
        scale(0.94);
}


/* ============================================================
   NAVEGAÇÃO INFERIOR
   BOLINHAS + PAUSA
   ============================================================ */

.hero-carousel-navigation {
    position: absolute;

    left: 50%;
    right: auto;

    bottom: 1%;

    z-index: 30;

    width: max-content;

    max-width:
        calc(
            100% - 30px
        );

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 13px;

    margin: 0;

    padding: 0;

    pointer-events: none;

    transform:
        translateX(-50%);
}


.hero-carousel-navigation > * {
    pointer-events: auto;
}


/* ============================================================
   BOLINHAS / INDICADORES
   ============================================================ */

.hero-carousel-dots {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    padding:
        8px 10px;

    background:
        rgba(
            10,
            10,
            15,
            0.64
        );

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.085
        );

    border-radius:
        999px;

    box-shadow:
        0 14px 35px
        rgba(
            0,
            0,
            0,
            0.25
        );

    -webkit-backdrop-filter:
        blur(10px);

    backdrop-filter:
        blur(10px);
}


.hero-carousel-dot {
    position: relative;

    flex:
        0 0 auto;

    width: 8px;
    height: 8px;

    overflow: hidden;

    padding: 0;

    background:
        rgba(
            255,
            255,
            255,
            0.2
        );

    border: 0;

    border-radius:
        999px;

    cursor: pointer;

    transition:
        width 300ms
        cubic-bezier(
            0.16,
            1,
            0.3,
            1
        ),
        background-color 180ms ease,
        transform 180ms ease;
}


.hero-carousel-dot:hover {
    background:
        rgba(
            183,
            108,
            255,
            0.55
        );

    transform:
        scale(1.12);
}


.hero-carousel-dot.active {
    width: 31px;

    background:
        rgba(
            155,
            77,
            255,
            0.27
        );
}


.hero-carousel-dot-progress {
    position: absolute;

    inset: 0;

    width: 0;

    background:
        linear-gradient(
            90deg,
            #7c3aed,
            #c084fc
        );

    border-radius: inherit;
}


.hero-carousel-dot.active
.hero-carousel-dot-progress.running {
    animation:
        heroCarouselProgress
        var(
            --hero-carousel-duration,
            5200ms
        )
        linear
        forwards;
}


@keyframes heroCarouselProgress {

    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}


/* ============================================================
   CONTADOR
   ============================================================ */

.hero-carousel-counter {
    min-width: 62px;
    height: 34px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 4px;

    padding:
        0 10px;

    background:
        rgba(
            10,
            10,
            15,
            0.64
        );

    color:
        #73737f;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.085
        );

    border-radius:
        999px;

    font-size: 8px;

    font-weight: 750;

    -webkit-backdrop-filter:
        blur(10px);

    backdrop-filter:
        blur(10px);
}


.hero-carousel-counter strong {
    color:
        #c084fc;

    font-size:
        10px;
}


/* ============================================================
   BOTÃO PAUSA
   ============================================================ */

.hero-carousel-pause {
    flex:
        0 0 auto;

    width: 34px;
    height: 34px;

    display: grid;

    place-items: center;

    padding: 0;
    margin: 0;

    background:
        rgba(
            10,
            10,
            15,
            0.64
        );

    color:
        #858591;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.085
        );

    border-radius:
        50%;

    cursor: pointer;

    font-size: 8px;

    -webkit-backdrop-filter:
        blur(10px);

    backdrop-filter:
        blur(10px);

    transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        transform 180ms ease;
}


.hero-carousel-pause:hover {
    background:
        rgba(
            155,
            77,
            255,
            0.14
        );

    color:
        #c084fc;

    border-color:
        rgba(
            183,
            108,
            255,
            0.28
        );

    transform:
        scale(1.06);
}


/* ============================================================
   SELO DESTAQUE
   ============================================================ */

.hero-carousel-position {
    position: absolute;

    top: 14px;

    right: 14px;

    z-index: 5;

    min-height: 27px;

    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding:
        0 8px;

    background:
        rgba(
            5,
            5,
            7,
            0.72
        );

    color:
        #ffffff;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.11
        );

    border-radius: 8px;

    font-size: 7px;

    font-weight: 850;

    letter-spacing:
        0.5px;

    -webkit-backdrop-filter:
        blur(8px);

    backdrop-filter:
        blur(8px);
}


.hero-carousel-position i {
    color:
        #c084fc;
}


/* ============================================================
   GLOW DINÂMICO
   ============================================================ */

.hero-showcase
.showcase-glow {
    transition:
        opacity 400ms ease,
        transform 500ms ease,
        background-color 400ms ease;
}


/*
 * Não fazemos mais o glow saltar durante
 * a troca das imagens.
 */
.hero-showcase.hero-carousel-transitioning
.showcase-glow {
    opacity: 0.82;
}


/* ============================================================
   APENAS UM PRODUTO
   ============================================================ */

.hero-showcase.single-product
.hero-carousel-arrow,

.hero-showcase.single-product
.hero-carousel-navigation {
    display: none;
}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 1100px) {

    /*
     * Não deixa as setas laterais
     * saírem do card.
     */
    .hero-carousel-arrow.previous {
        left: 10px;
    }

    .hero-carousel-arrow.next {
        right: 10px;
    }
}


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

@media (max-width: 760px) {

    /*
     * SETAS LATERAIS
     */
    .hero-carousel-arrow {
        top: 43%;

        width: 40px;

        height: 40px;

        opacity: 0.94;

        font-size: 11px;

        border-radius: 13px;

        transform:
            translateY(-50%)
            scale(1);

        -webkit-backdrop-filter:
            blur(6px);

        backdrop-filter:
            blur(6px);
    }


    .hero-carousel-arrow.previous {
        left: 12px;
    }


    .hero-carousel-arrow.next {
        right: 12px;
    }


    /*
     * Mobile não depende de :hover.
     */
    .hero-showcase
    .hero-carousel-arrow {
        opacity: 0.94;
    }


    /*
     * CONTROLE INFERIOR
     *
     * Esta é a correção das "setinhas/bolinhas"
     * que estavam saindo para a esquerda.
     */
    .hero-carousel-navigation {
        left: 50%;

        right: auto;

        bottom: 10px;

        width: max-content;

        max-width:
            calc(
                100% - 28px
            );

        gap: 8px;

        margin: 0;

        transform:
            translateX(-50%);
    }


    .hero-carousel-counter {
        display: none;
    }


    .hero-carousel-dots {
        flex:
            0 1 auto;

        max-width:
            calc(
                100vw - 105px
            );

        justify-content: center;

        overflow: hidden;

        padding:
            7px 9px;
    }


    .hero-carousel-pause {
        flex:
            0 0 32px;

        width: 32px;

        height: 32px;
    }


    /*
     * Mobile:
     * evita trabalho gráfico desnecessário.
     */
    #heroProductImage {
        backface-visibility: hidden;

        -webkit-backface-visibility:
            hidden;

        transform:
            translate3d(
                0,
                0,
                0
            );

        -webkit-transform:
            translate3d(
                0,
                0,
                0
            );
    }
}


/* ============================================================
   CELULAR PEQUENO
   ============================================================ */

@media (max-width: 480px) {

    .hero-carousel-arrow {
        top: 42%;

        width: 38px;

        height: 38px;

        border-radius:
            12px;
    }


    .hero-carousel-arrow.previous {
        left: 10px;
    }


    .hero-carousel-arrow.next {
        right: 10px;
    }


    /*
     * Mantém TODO o controle inferior
     * centralizado dentro do card.
     */
    .hero-carousel-navigation {
        left: 50%;

        right: auto;

        bottom: 9px;

        gap: 7px;

        width: max-content;

        max-width:
            calc(
                100% - 22px
            );

        transform:
            translateX(-50%);
    }


    .hero-carousel-dots {
        max-width:
            190px;

        overflow: hidden;

        justify-content: center;

        gap: 6px;

        scrollbar-width:
            none;
    }


    .hero-carousel-dots::-webkit-scrollbar {
        display: none;
    }


    .hero-carousel-dot.active {
        width: 27px;
    }


    .hero-carousel-pause {
        width: 32px;

        height: 32px;
    }


    .hero-carousel-position {
        top: 10px;

        right: 10px;
    }
}


/* ============================================================
   CELULARES MUITO ESTREITOS
   ============================================================ */

@media (max-width: 370px) {

    .hero-carousel-navigation {
        max-width:
            calc(
                100% - 16px
            );

        gap: 6px;
    }


    .hero-carousel-dots {
        max-width: 165px;

        padding:
            7px 8px;

        gap: 5px;
    }


    .hero-carousel-dot {
        width: 7px;

        height: 7px;
    }


    .hero-carousel-dot.active {
        width: 23px;
    }


    .hero-carousel-pause {
        width: 30px;

        height: 30px;
    }
}


/* ============================================================
   ACESSIBILIDADE
   ============================================================ */

@media (
    prefers-reduced-motion:
    reduce
) {

    #heroProductImage,

    #heroProductImage.hero-carousel-image-entering,

    .hero-carousel-arrow,

    .hero-carousel-dot,

    .hero-carousel-pause,

    .showcase-glow {

        animation:
            none !important;

        transition:
            none !important;
    }


    .hero-carousel-dot.active
    .hero-carousel-dot-progress.running {

        animation:
            heroCarouselProgress
            var(
                --hero-carousel-duration,
                5200ms
            )
            linear
            forwards !important;
    }
}