/* ============================================================
   CARRINHO COMPARTILHADO — LOJA + PRODUTO
============================================================ */

:root {
    --carrinho-dourado: #D4AF37;
    --carrinho-champagne: #F5E6C8;
}

/* ============================================================
   CARRINHO VAZIO — PRESENÇA DE LOJA / ESTOQUE TEMPORARIAMENTE ZERO
============================================================ */

.loja-carrinho-flutuante {
    position: fixed;
    right: 28px;
    bottom: 96px;
    z-index: 2180;

    width: 176px;
    min-height: 58px;
    padding: 7px 12px 7px 8px;

    display: flex;
    align-items: center;
    gap: 10px;

    border: 1px solid rgba(212, 175, 55, .50);
    border-radius: 999px;
    background: rgba(16, 17, 19, .96);
    color: #fff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;

    transition:
        opacity .25s ease,
        visibility .25s ease,
        transform .25s ease,
        border-color .25s ease,
        background .25s ease;
}

.loja-carrinho-flutuante:hover {
    transform: translateY(-3px);
    border-color: var(--carrinho-dourado);
    background: #191a1c;
}

body.carrinho-aberto .loja-carrinho-flutuante {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(15px);
}

.loja-carrinho-icone {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--carrinho-dourado);
}

.loja-carrinho-icone svg {
    width: 23px;
    height: 23px;
    display: block;
}

.loja-carrinho-label {
    flex: 1;
    text-align: left;
    font-size: 13px;
    font-weight: 800;
}

.loja-carrinho-flutuante > strong {
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--carrinho-dourado);
    color: #090909;
    font-size: 11px;
    font-weight: 900;
}

.loja-carrinho-overlay {
    position: fixed;
    inset: 0;
    z-index: 2298;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.loja-carrinho {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 2299;

    width: min(92vw, 430px);
    height: 100dvh;
    padding: 26px;

    display: flex;
    flex-direction: column;

    border-left: 1px solid rgba(212, 175, 55, .22);
    background: #101113;
    box-shadow: -25px 0 70px rgba(0, 0, 0, .45);

    transform: translateX(102%);
    transition: transform .3s ease;
}

.loja-carrinho.aberto {
    transform: translateX(0);
}

.loja-carrinho-topo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, .12);
}

.loja-carrinho-topo h2 {
    margin: 5px 0 0;
    color: var(--carrinho-champagne);
    font-size: 34px;
    font-weight: 500;
    line-height: 1.05;
}

.loja-carrinho-topo button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(212, 175, 55, .22);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 25px;
    cursor: pointer;
}

.loja-carrinho-itens {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    display: grid;
    place-items: center;
    padding: 26px 0;
}

.loja-carrinho-vazio {
    width: min(100%, 330px);
    padding: 22px 8px;
    text-align: center;
    color: rgba(255, 255, 255, .60);
}

.loja-carrinho-vazio-icone {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(212, 175, 55, .28);
    border-radius: 50%;
    color: var(--carrinho-dourado);
    font-size: 25px;
}

.loja-carrinho-vazio strong {
    display: block;
    margin-bottom: 10px;
    color: var(--carrinho-champagne);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

.loja-carrinho-vazio p {
    margin: 0;
    font-size: 13px;
    line-height: 1.65;
}

.loja-carrinho-ver-produtos {
    min-height: 46px;
    margin-top: 22px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212, 175, 55, .42);
    border-radius: 999px;
    color: var(--carrinho-champagne);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.loja-carrinho-rodape {
    padding-top: 20px;
    border-top: 1px solid rgba(212, 175, 55, .14);
}

.loja-carrinho-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.loja-carrinho-total span {
    color: rgba(255, 255, 255, .53);
}

.loja-carrinho-total strong {
    color: var(--carrinho-champagne);
    font-size: 22px;
}

.loja-checkout {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 999px;
    background: var(--carrinho-dourado);
    color: #080809;
    font-weight: 900;
}

.loja-checkout:disabled {
    opacity: .36;
    cursor: not-allowed;
}

.loja-carrinho-rodape small {
    display: block;
    margin-top: 11px;
    color: rgba(255, 255, 255, .36);
    font-size: 10px;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 768px) {

    .loja-carrinho-flutuante {
        right: 16px;
        bottom:
            calc(
                var(--mobile-nav-altura)
                + var(--mobile-safe-bottom)
                + 22px
            );
        width: 52px;
        height: 52px;
        min-height: 52px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .loja-carrinho-icone {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .loja-carrinho-icone svg {
        width: 21px;
        height: 21px;
    }

    .loja-carrinho-label {
        display: none;
    }

    .loja-carrinho-flutuante > strong {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 21px;
        height: 21px;
        font-size: 9px;
        border: 2px solid #080809;
    }

    .loja-carrinho {
        width: min(94vw, 430px);
        padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    }
}


/* O carrinho existe na Loja e na página de produto. */
@media (max-width: 768px) {
    body.pagina-loja:not(.carrinho-aberto) .whatsapp-widget,
    body.pagina-produto:not(.carrinho-aberto) .whatsapp-widget {
        right: 82px;
    }
}


body.carrinho-aberto {
    overflow: hidden;
}
