/* =========================================================
   SLICE & FLAME — CARRINHO PREMIUM
   ========================================================= */

:root {
    --fundo: #0f0b0a;
    --fundo-2: #161110;
    --cartao: #1c1614;
    --cartao-2: #241c19;
    --campo: #120e0d;
    --linha: rgba(255, 255, 255, .08);

    --ouro: #f2b84b;
    --ouro-escuro: #d99a2b;
    --brasa: #ff6a2b;
    --whats: #25d366;
    --erro: #ff6b6b;

    --texto: #f6eee6;
    --texto-suave: #a8988c;

    --raio: 20px;

    --fonte-titulo: "Fraunces", Georgia, "Times New Roman", serif;
    --fonte-texto: "Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* ========================= */
/* RESET */
/* ========================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background:
        radial-gradient(60% 40% at 50% 0%, rgba(255, 106, 43, .12), transparent 70%),
        var(--fundo);
    background-attachment: fixed;
    color: var(--texto);
    font-family: var(--fonte-texto);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 110px; /* espaço da barra fixa */
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ========================= */
/* BOTÕES */
/* ========================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 54px;
    padding: 0 24px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.btn:active { transform: scale(.97); }

.btn-largo { width: 100%; }

.btn-ouro {
    background: linear-gradient(180deg, #f7c662, var(--ouro-escuro));
    color: #1a1209;
    box-shadow: 0 10px 30px rgba(242, 184, 75, .25), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.btn-whats {
    background: linear-gradient(180deg, #34e07a, #1fb457);
    color: #fff;
    box-shadow: 0 10px 30px rgba(37, 211, 102, .25), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.btn-whats i { font-size: 20px; }

.btn-whats:hover, .btn-ouro:hover { filter: brightness(1.06); }

.btn-whats.enviando { pointer-events: none; opacity: .8; }

.icone-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--linha);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: background .2s ease;
}

.icone-btn:hover { background: rgba(255, 255, 255, .12); }

.link-ouro {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ouro);
    white-space: nowrap;
}

/* ========================= */
/* TOPO */
/* ========================= */

.topo {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 11, 10, .85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--linha);
}

.topo-inner {
    max-width: 1100px;
    margin: 0 auto;
    height: 64px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.topo-titulo { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topo-titulo strong { font-family: var(--fonte-titulo); font-size: 20px; line-height: 1.1; }

.topo-titulo span { font-size: 12px; color: var(--texto-suave); }

.topo-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(242, 184, 75, .5);
    background: var(--cartao);
}

/* ========================= */
/* LAYOUT DO CHECKOUT */
/* ========================= */

.checkout { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; }

.checkout-principal { display: flex; flex-direction: column; gap: 16px; }

.bloco {
    background: linear-gradient(160deg, var(--cartao-2), var(--cartao));
    border: 1px solid var(--linha);
    border-radius: var(--raio);
    padding: 20px 16px;
    animation: subir .5s ease both;
}

.bloco:nth-child(2) { animation-delay: .05s; }
.bloco:nth-child(3) { animation-delay: .1s; }
.bloco:nth-child(4) { animation-delay: .15s; }

@keyframes subir {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.bloco-cabeca {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.bloco-cabeca h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--fonte-titulo);
    font-size: 20px;
    font-weight: 700;
}

.bloco-num {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgba(242, 184, 75, .12);
    border: 1px solid rgba(242, 184, 75, .35);
    color: var(--ouro);
    font-family: var(--fonte-texto);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ========================= */
/* ITENS */
/* ========================= */

.item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--linha);
    transition: opacity .25s ease, transform .25s ease;
}

.item:first-child { border-top: none; padding-top: 0; }

.item.saindo { opacity: 0; transform: translateX(30px); }

.item-foto {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    background: #2a201c;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .45);
}

.item-info { flex: 1; min-width: 0; }

.item-info strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-info small { display: block; font-size: 12px; color: var(--texto-suave); }

.item-info .item-total { font-size: 15px; font-weight: 600; color: var(--ouro); margin-top: 2px; }

.stepper {
    display: flex;
    align-items: center;
    height: 40px;
    border-radius: 12px;
    background: rgba(242, 184, 75, .1);
    border: 1px solid rgba(242, 184, 75, .3);
    flex-shrink: 0;
}

.stepper button {
    width: 36px;
    height: 100%;
    color: var(--ouro);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper span { min-width: 20px; text-align: center; font-weight: 600; font-size: 15px; }

/* ========================= */
/* OPÇÕES (entrega e pagamento) */
/* ========================= */

.opcoes { display: grid; gap: 10px; }

.opcoes-2 { grid-template-columns: 1fr 1fr; }

.opcoes-4 { grid-template-columns: 1fr 1fr; margin-bottom: 16px; }

.opcao { position: relative; cursor: pointer; }

.opcao input { position: absolute; opacity: 0; pointer-events: none; }

.opcao-caixa {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 14px 12px;
    border-radius: 16px;
    background: var(--campo);
    border: 1.5px solid var(--linha);
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.opcao-caixa--col {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 16px 8px;
    text-align: center;
}

.opcao-caixa strong { font-size: 14px; font-weight: 600; }

.opcao-texto { display: flex; flex-direction: column; min-width: 0; }

.opcao-texto small { font-size: 12px; color: var(--texto-suave); }

.opcao-icone {
    font-size: 22px;
    line-height: 1;
    color: var(--texto-suave);
    transition: color .2s ease, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}

.opcao:hover .opcao-caixa { border-color: rgba(242, 184, 75, .35); }

.opcao input:checked + .opcao-caixa {
    border-color: var(--ouro);
    background: rgba(242, 184, 75, .08);
    box-shadow: 0 0 0 4px rgba(242, 184, 75, .08);
}

.opcao input:checked + .opcao-caixa .opcao-icone { color: var(--ouro); transform: scale(1.12); }

.opcao input:focus-visible + .opcao-caixa { outline: 2px solid var(--ouro); outline-offset: 2px; }

/* ========================= */
/* CAMPOS */
/* ========================= */

.endereco {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--linha);
}

.linha-campos { display: flex; flex-direction: column; gap: 14px; }

.campo { display: flex; flex-direction: column; gap: 6px; }

.bloco .campo + .campo { margin-top: 14px; }

.linha-campos .campo + .campo,
.endereco > .campo + .campo { margin-top: 0; }

.campo label { font-size: 13px; font-weight: 500; color: var(--texto-suave); }

.campo label em { font-style: normal; opacity: .7; }

.campo input,
.campo textarea {
    width: 100%;
    font-family: inherit;
    font-size: 16px; /* evita zoom no iPhone */
    color: var(--texto);
    background: var(--campo);
    border: 1.5px solid var(--linha);
    border-radius: 14px;
    padding: 0 14px;
    height: 52px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.campo textarea { height: auto; padding: 14px; resize: vertical; min-height: 90px; }

.campo input::placeholder,
.campo textarea::placeholder { color: #6e625a; }

.campo input:focus,
.campo textarea:focus {
    border-color: var(--ouro);
    box-shadow: 0 0 0 4px rgba(242, 184, 75, .1);
}

.entrada { display: flex; align-items: center; position: relative; }

.entrada input { flex: 1; }

.entrada-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    margin-left: -44px;
    font-size: 15px;
    color: var(--texto-suave);
    pointer-events: none;
}

.entrada-icone.ok { color: var(--whats); }

.entrada-icone.carregando::after {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(242, 184, 75, .25);
    border-top-color: var(--ouro);
    animation: girar .7s linear infinite;
}

@keyframes girar { to { transform: rotate(360deg); } }

.entrada--prefixo .prefixo {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 12px 0 14px;
    background: var(--campo);
    border: 1.5px solid var(--linha);
    border-right: none;
    border-radius: 14px 0 0 14px;
    color: var(--texto-suave);
    font-size: 15px;
}

.entrada--prefixo input { border-radius: 0 14px 14px 0; padding-left: 4px; border-left: none; }

.ajuda { font-size: 12px; color: #6e625a; }

.erro { display: none; font-size: 12px; color: var(--erro); }

.campo.invalido input { border-color: var(--erro); box-shadow: 0 0 0 4px rgba(255, 107, 107, .1); }

.campo.invalido .erro { display: block; }

.campo.invalido .ajuda { display: none; }

.campo-troco { margin-bottom: 14px; animation: subir .3s ease both; }

/* ========================= */
/* RESUMO */
/* ========================= */

.resumo {
    background: linear-gradient(160deg, var(--cartao-2), var(--cartao));
    border: 1px solid rgba(242, 184, 75, .25);
    border-radius: var(--raio);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.resumo::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(242, 184, 75, .18), transparent);
    pointer-events: none;
}

.resumo h2 { font-family: var(--fonte-titulo); font-size: 20px; margin-bottom: 4px; }

.resumo-linha { display: flex; justify-content: space-between; font-size: 15px; color: var(--texto-suave); }

.resumo-linha strong { color: var(--texto); font-weight: 500; }

.resumo-total {
    padding-top: 14px;
    margin-top: 4px;
    border-top: 1px solid var(--linha);
    align-items: baseline;
    color: var(--texto);
}

.resumo-total strong { font-size: 26px; font-weight: 600; color: var(--ouro); }

.resumo .btn-whats { display: none; margin-top: 6px; }

.resumo-nota { font-size: 12px; color: var(--texto-suave); text-align: center; }

.resumo-nota i { color: var(--ouro); margin-right: 4px; }

/* ========================= */
/* BARRA FIXA (celular) */
/* ========================= */

.barra-final {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--fundo-2);
    border-top: 1px solid var(--linha);
    box-shadow: 0 -14px 40px rgba(0, 0, 0, .5);
}

.barra-final-total { display: flex; flex-direction: column; line-height: 1.2; }

.barra-final-total small { font-size: 12px; color: var(--texto-suave); }

.barra-final-total strong { font-size: 20px; color: var(--ouro); white-space: nowrap; }

.barra-final .btn { flex: 1; }

/* ========================= */
/* CARRINHO VAZIO */
/* ========================= */

.vazio {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    padding: 40px 0;
}

.vazio-pizza {
    font-size: 96px;
    line-height: 1;
    filter: drop-shadow(0 30px 30px rgba(0, 0, 0, .6));
    animation: flutuar 4s ease-in-out infinite;
    margin-bottom: 8px;
}

@keyframes flutuar {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50% { transform: translateY(-14px) rotate(6deg); }
}

.vazio h1 { font-family: var(--fonte-titulo); font-size: 30px; font-weight: 700; }

.vazio p { color: var(--texto-suave); max-width: 320px; margin-bottom: 8px; }

body.carrinho-vazio .barra-final,
body.carrinho-vazio .checkout { display: none; }

body.carrinho-vazio { padding-bottom: 0; }

/* ========================= */
/* AVISO (TOAST) */
/* ========================= */

.toast {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 80px;
    z-index: 300;
    max-width: 380px;
    margin: 0 auto;
    transform: translate(0, -20px);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--cartao-2);
    border: 1px solid var(--linha);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .5);
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, transform .3s ease, visibility .3s;
}

.toast.ativo { opacity: 1; visibility: visible; transform: translate(0, 0); }

.toast-icone {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--whats);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.erro .toast-icone { background: var(--erro); }

/* ========================= */
/* RODAPÉ */
/* ========================= */

.rodape {
    margin-top: 40px;
    padding: 28px 16px;
    border-top: 1px solid var(--linha);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.rodape strong { font-family: var(--fonte-titulo); font-size: 20px; color: var(--ouro); }

.rodape span { font-size: 13px; color: var(--texto-suave); }

.rodape small { font-size: 12px; color: #6e625a; margin-top: 6px; }

/* ========================= */
/* TABLET (≥ 640px) */
/* ========================= */

@media (min-width: 640px) {

    .container { padding: 0 24px; }

    .topo-inner { padding: 0 24px; }

    .bloco, .resumo { padding: 24px; }

    .linha-campos { flex-direction: row; }

    .linha-campos .campo { flex: 1; }

    .linha-campos--num .campo:first-child { flex: 0 0 140px; }

    .campo-cep { flex: 0 0 200px !important; }

    .opcoes-4 { grid-template-columns: repeat(4, 1fr); }

    .item-foto { width: 72px; height: 72px; }
}

/* ========================= */
/* DESKTOP (≥ 1024px) */
/* ========================= */

@media (min-width: 1024px) {

    body { padding-bottom: 0; }

    .checkout {
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
        padding-top: 32px;
    }

    .checkout-principal { flex: 1; min-width: 0; }

    .resumo {
        flex: 0 0 340px;
        position: sticky;
        top: 96px;
    }

    .resumo .btn-whats { display: inline-flex; }

    .barra-final { display: none; }
}