/* ============================================================
   Cardápio Digital — "Forno" · editorial quente, padrão mercado
   Estrutura: iFood/Goomer · Identidade: pizzaria artesanal
   Fontes locais: Fraunces (display) + Schibsted Grotesk (corpo)
   ============================================================ */
@import url('../fonts/fonts.css');

/* ── Design tokens ───────────────────────────────────────── */
:root {
    --bg:        #f6f2ec;                 /* papel quente */
    --card:      #ffffff;
    --border:    #e9e2d8;
    --hairline:  #efe9e0;
    --text:      #251d15;                 /* espresso */
    --text-2:    #857767;
    --primary:   #ea1d2c;                 /* sobrescrito pelo config da loja */
    --primary-08: color-mix(in srgb, var(--primary) 8%, white);
    --primary-12: color-mix(in srgb, var(--primary) 12%, white);
    --primary-soft: color-mix(in srgb, var(--primary) 5%, white);
    --ok:        #2e7d4f;
    --ok-bg:     #e8f4ec;
    --warn:      #b3541e;
    --warn-bg:   #fdf3e7;
    --danger:    #b02a37;
    --danger-bg: #fbeaea;
    --sh:        0 1px 3px rgba(37,29,21,.07);
    --sh-card:   0 2px 10px rgba(37,29,21,.06);
    --sh-float:  0 12px 40px rgba(37,29,21,.18);
    --r:         14px;
    --r-sm:      10px;
    --display:   "Fraunces", Georgia, serif;
    --sans:      "Schibsted Grotesk", system-ui, sans-serif;
}

/* ── Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--sans); background: var(--bg); color: var(--text);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    margin: 0;
}
a      { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
img    { display: block; }
.wrap  { max-width: 680px; margin: 0 auto; }
.muted { color: var(--text-2); }

/* ── Hero da loja ────────────────────────────────────────── */
.store-hero {
    background:
        radial-gradient(140% 90% at 50% -20%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%),
        var(--card);
    border-bottom: 1px solid var(--border);
    text-align: center;
    padding: 34px 18px 26px;
    animation: heroIn .5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes heroIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.store-hero .logo-img {
    /* Quadrado arredondado, não círculo: a arte da logo tem texto até as bordas
       e o recorte circular cortava "PIZZARIA" / "GLORIA MAR" nos cantos. */
    width: 92px; height: 92px; border-radius: 20px;
    object-fit: contain; background: #14100c;
    border: 3px solid var(--card);
    box-shadow: 0 4px 18px rgba(37,29,21,.16);
    margin: 0 auto 14px;
}
.logo-placeholder {
    width: 88px; height: 88px; border-radius: 50%;
    background: var(--primary); color: white;
    font-family: var(--display); font-size: 2.1rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px; box-shadow: 0 4px 18px rgba(37,29,21,.16);
}
.store-name {
    font-family: var(--display); font-size: 1.75rem; font-weight: 700;
    letter-spacing: -.01em; color: var(--text); margin: 0 0 4px; line-height: 1.15;
}
.store-tag {
    font-size: .74rem; color: var(--text-2);
    letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
}
.store-tag::before, .store-tag::after { content: "—"; margin: 0 8px; color: var(--border); }
.store-meta {
    display: flex; gap: 10px; flex-wrap: wrap;
    align-items: center; justify-content: center;
    margin-top: 16px; font-size: .84rem;
}
.store-meta .item { color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.status-pill {
    padding: 5px 14px; border-radius: 999px;
    font-weight: 600; font-size: .78rem;
    display: inline-flex; align-items: center; gap: 6px;
}
.status-aberto  { background: var(--ok-bg); color: var(--ok); }
.status-fechado { background: var(--danger-bg); color: var(--danger); }

/* ── Nav de categorias (sticky) ──────────────────────────── */
.cat-nav {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.cat-nav .wrap {
    display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 6px;
}
.cat-nav .wrap::-webkit-scrollbar { display: none; }
.cat-nav a {
    white-space: nowrap; padding: 14px 14px 12px;
    font-size: .88rem; font-weight: 500; color: var(--text-2);
    border-bottom: 2px solid transparent; flex-shrink: 0;
    transition: color .15s, border-color .15s;
}
.cat-nav a:hover  { color: var(--text); }
.cat-nav a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

/* ── Conteúdo ────────────────────────────────────────────── */
/* Coluna central: no desktop o conteúdo não estica — mesma largura do .wrap (680px + margens). */
main { padding-bottom: 110px; max-width: 700px; margin: 0 auto; }
.closed-banner {
    background: var(--warn-bg); border-left: 3px solid var(--warn);
    padding: 12px 18px; font-size: .86rem; color: var(--warn);
}

.cat-section { margin: 14px 10px 0; }
.cat-header  { padding: 14px 10px 10px; }
.cat-title {
    font-family: var(--display); font-size: 1.25rem; font-weight: 700;
    letter-spacing: -.01em; margin: 0; color: var(--text);
    display: flex; align-items: baseline; gap: 12px;
}
.cat-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ── Lista de produtos ───────────────────────────────────── */
.prod-list {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--r); overflow: hidden; box-shadow: var(--sh);
}
.prod {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 16px; border-bottom: 1px solid var(--hairline);
    cursor: pointer; transition: background .12s;
    -webkit-tap-highlight-color: transparent;
}
.prod:last-child { border-bottom: none; }
.prod:active { background: var(--primary-soft); }
@media (hover: hover) { .prod:hover { background: #fdfbf8; } }

.prod .info { flex: 1; min-width: 0; }
.prod .nome { font-weight: 700; font-size: .96rem; line-height: 1.3; margin-bottom: 3px; letter-spacing: -.005em; }
.prod .desc {
    color: var(--text-2); font-size: .82rem; line-height: 1.5; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.prod .preco { font-family: var(--display); font-weight: 600; font-size: 1rem; color: var(--text); }
.prod .preco small { font-family: var(--sans); font-weight: 400; font-size: .74rem; color: var(--text-2); margin-right: 3px; }

.prod-media { position: relative; flex-shrink: 0; }
.prod .thumb {
    width: 88px; height: 88px; border-radius: var(--r-sm);
    object-fit: cover; border: 1px solid var(--hairline);
}
.prod-add {
    width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.25rem; font-weight: 400; line-height: 1; flex-shrink: 0;
    transition: transform .15s;
}
.prod:active .prod-add { transform: scale(.9); }
.prod-media .prod-add {
    position: absolute; bottom: -7px; right: -7px;
    background: var(--primary); color: white;
    box-shadow: 0 3px 10px rgba(37,29,21,.25);
}
.prod-add-plain { background: var(--card); color: var(--primary); border: 1.5px solid var(--primary); }

.pizza-icon-wrap {
    flex-shrink: 0; width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
}

/* ── Barra do carrinho ───────────────────────────────────── */
.cart-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    padding: 0 14px 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateY(130%); transition: transform .32s cubic-bezier(.2,.8,.2,1);
}
.cart-bar.show { transform: translateY(0); }
.cart-bar .inner {
    max-width: 680px; margin: 0 auto;
    background: var(--text); color: #f6f2ec;
    border-radius: var(--r); display: flex; align-items: center;
    justify-content: space-between; padding: 15px 20px;
    box-shadow: var(--sh-float); font-weight: 600; font-size: .93rem;
}
.cart-bar .q {
    background: var(--primary); color: white;
    border-radius: 8px; padding: 2px 10px; margin-right: 10px; font-size: .86rem;
}
.cart-bar a { color: inherit; display: flex; align-items: center; gap: 6px; font-weight: 700; }

/* ── Bottom sheet ────────────────────────────────────────── */
.sheet-bg {
    position: fixed; inset: 0; background: rgba(28,21,14,.5);
    display: none; z-index: 60;
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.sheet-bg.open { display: block; animation: fadeIn .2s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
    position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 100%; max-width: 560px; max-height: 92vh;
    background: var(--card); border-radius: 22px 22px 0 0;
    z-index: 61; display: flex; flex-direction: column;
    box-shadow: var(--sh-float); animation: slideUp .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }

.sheet header {
    position: relative; padding: 22px 20px 14px;
    border-bottom: 1px solid var(--hairline);
    display: flex; justify-content: space-between; align-items: center;
}
.sheet header::before {
    content: ""; position: absolute; top: 9px; left: 50%;
    transform: translateX(-50%); width: 38px; height: 4px;
    border-radius: 2px; background: var(--border);
}
.sheet header h3 { margin: 0; font-family: var(--display); font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.sheet .body { padding: 18px 20px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.sheet .foot {
    padding: 14px 20px; border-top: 1px solid var(--hairline);
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    display: flex; gap: 12px; align-items: center; background: var(--card);
}

/* ── Grupos de opções ────────────────────────────────────── */
.opt-group { margin-bottom: 20px; }
.opt-group .gtitle {
    font-weight: 700; font-size: .92rem; margin-bottom: 10px;
    display: flex; justify-content: space-between; align-items: baseline;
}
.opt-group .ghint {
    font-size: .68rem; color: var(--primary); font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    background: var(--primary-08); padding: 3px 9px; border-radius: 999px;
}
.opt {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border: 1.5px solid var(--border);
    border-radius: var(--r-sm); margin-bottom: 7px; cursor: pointer;
    transition: border-color .12s, background .12s;
    background: var(--card);
}
.opt:hover { border-color: #cfc4b5; }
.opt.sel   { border-color: var(--primary); background: var(--primary-soft); }
.opt .opt-nome  { flex: 1; font-size: .88rem; font-weight: 500; }
.opt .opt-preco { font-family: var(--display); color: var(--text); font-weight: 600; font-size: .88rem; }
.opt.sel .opt-preco { color: var(--primary); }
.opt input { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }

/* Steppers de combo */
.combo-pick {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px; border: 1.5px solid var(--border);
    border-radius: var(--r-sm); margin-bottom: 7px; background: var(--card);
    transition: border-color .12s, background .12s;
}
.combo-pick.sel { border-color: var(--primary); background: var(--primary-soft); }
.combo-pick .opt-nome { flex: 1; font-size: .88rem; font-weight: 500; }
.combo-step { display: flex; align-items: center; gap: 10px; }
.combo-step button {
    width: 30px; height: 30px; border-radius: 50%; background: var(--card);
    border: 1.5px solid var(--border); color: var(--text); font-size: 1rem;
    display: flex; align-items: center; justify-content: center; transition: .12s;
}
.combo-step button:active { background: var(--primary-08); border-color: var(--primary); }

/* Stepper de quantidade */
.qty { display: flex; align-items: center; gap: 12px; }
.qty button {
    width: 36px; height: 36px; border-radius: 50%; background: var(--card);
    border: 1.5px solid var(--border); color: var(--text); font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center; transition: .12s;
}
.qty button:active { background: var(--primary-08); border-color: var(--primary); color: var(--primary); }
.qty span { font-weight: 700; min-width: 22px; text-align: center; font-size: 1rem; }

/* ── Botões ──────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--card); color: var(--text); border: 1.5px solid var(--border);
    padding: 11px 18px; border-radius: var(--r-sm); font-weight: 600;
    font-size: .9rem; font-family: inherit; cursor: pointer; transition: .15s;
}
.btn:hover { border-color: #cfc4b5; }
.btn-primary {
    background: var(--primary); color: white; border-color: var(--primary); flex: 1;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 30%, transparent);
    font-weight: 700;
}
.btn-primary:not([disabled]):hover  { filter: brightness(.93); }
.btn-primary:not([disabled]):active { transform: translateY(1px); }
.btn-block { width: 100%; display: flex; }
.btn[disabled] { opacity: .38; cursor: not-allowed; box-shadow: none; }

/* ── Busca + inputs ──────────────────────────────────────── */
.search-field { position: relative; display: block; }
.search-field > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.search-field .input { padding-left: 40px; }

.field { margin-bottom: 14px; }
.field label {
    display: block; font-size: .78rem; color: var(--text-2);
    margin-bottom: 6px; font-weight: 600; letter-spacing: .02em;
}
.input, select, textarea {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
    border-radius: var(--r-sm); font-size: .9rem; font-family: inherit;
    background: var(--card); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-08);
}
select option { background: var(--card); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Tabs de sabor ───────────────────────────────────────── */
.sabor-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 10px; padding-bottom: 2px; }
.sabor-tabs::-webkit-scrollbar { display: none; }
.sabor-tab {
    white-space: nowrap; padding: 7px 15px; border-radius: 999px;
    font-size: .8rem; font-weight: 500; border: 1.5px solid var(--border);
    background: var(--card); color: var(--text-2); font-family: inherit;
    cursor: pointer; transition: .15s;
}
.sabor-tab.active { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

/* Botão "Trocar sabor(es)" */
.sabor-toggle-btn {
    display: none; width: 100%; margin-top: 4px;
    padding: 12px 16px; border: 1.5px dashed var(--primary);
    border-radius: var(--r-sm); background: var(--primary-soft);
    color: var(--primary); font-weight: 700; font-size: .86rem;
    font-family: inherit; cursor: pointer; text-align: center;
    transition: background .15s;
}
.sabor-toggle-btn:hover { background: var(--primary-08); }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
    position: fixed; top: 20px; left: 50%; z-index: 200;
    transform: translateX(-50%) translateY(-90px);
    background: var(--text); color: var(--bg); padding: 12px 22px; border-radius: var(--r-sm);
    font-size: .88rem; font-weight: 500; box-shadow: var(--sh-float);
    max-width: calc(100vw - 32px); text-align: center; pointer-events: none;
    transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.toast.show       { transform: translateX(-50%) translateY(0); }
.toast.toast-erro  { background: var(--danger); color: white; }
.toast.toast-ok    { background: var(--ok); color: white; }
.toast.toast-aviso { background: var(--warn); color: white; }

/* ── Checkout ────────────────────────────────────────────── */
.page-head {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    padding: 14px 18px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 31;
}
.back-link { color: var(--primary); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 4px; }
.page-head h1 { margin: 0; font-family: var(--display); font-size: 1.05rem; font-weight: 700; flex: 1; text-align: center; letter-spacing: -.01em; }

.co-section {
    background: var(--card); padding: 20px 18px; margin: 10px 10px 0;
    border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh);
}
.co-section-title {
    font-size: .7rem; font-weight: 700; color: var(--text-2);
    letter-spacing: .14em; text-transform: uppercase; margin: 0 0 16px;
}

/* Tipo de entrega */
.tipo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tipo-card { border: 1.5px solid var(--border); border-radius: var(--r-sm); cursor: pointer; transition: border-color .15s, background .15s; background: var(--card); }
.tipo-card input { display: none; }
.tipo-card .tipo-body {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 18px 12px; font-size: .88rem; font-weight: 600; color: var(--text-2);
}
.tipo-card .tipo-body small { font-size: .75rem; font-weight: 400; }
.tipo-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.tipo-card:has(input:checked) .tipo-body { color: var(--primary); }

/* Itens do pedido */
.co-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--hairline); gap: 12px; }
.co-item:last-child { border-bottom: none; padding-bottom: 0; }
.co-item-body { display: flex; gap: 12px; flex: 1; min-width: 0; }
.co-qtd { font-family: var(--display); font-weight: 700; color: var(--primary); font-size: .95rem; flex-shrink: 0; min-width: 24px; }
.co-nome { font-weight: 700; font-size: .92rem; line-height: 1.3; }
.co-item .q { color: var(--text-2); font-size: .82rem; margin-top: 2px; }
.co-preco { text-align: right; flex-shrink: 0; }
.co-preco span { font-family: var(--display); font-weight: 600; font-size: .95rem; }
.co-remover {
    display: block; margin-top: 5px; margin-left: auto; background: none; border: none;
    color: var(--text-2); font-size: .76rem; padding: 0;
    text-decoration: underline; cursor: pointer; font-family: inherit;
}
.co-remover:hover { color: var(--danger); }

/* Pagamento */
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-card { border: 1.5px solid var(--border); border-radius: var(--r-sm); cursor: pointer; transition: border-color .15s, background .15s; background: var(--card); }
.pay-card input { display: none; }
.pay-card .pay-body { display: flex; align-items: center; gap: 10px; padding: 14px; font-size: .88rem; font-weight: 500; color: var(--text-2); }
.pay-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pay-card:has(input:checked) .pay-body { color: var(--primary); font-weight: 700; }

/* Endereços salvos */
.end-opt {
    display: flex; align-items: center; gap: 10px;
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    padding: 11px 13px; cursor: pointer; font-size: .86rem; margin-bottom: 6px;
    background: var(--card); transition: .12s;
}
.end-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.end-opt input { accent-color: var(--primary); flex-shrink: 0; }

/* Resumo */
.summary-line  { display: flex; justify-content: space-between; padding: 5px 0; font-size: .88rem; }
.summary-total { font-family: var(--display); font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }

/* Rodapé fixo do checkout */
.co-sticky {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--card); border-top: 1px solid var(--border);
    padding: 14px 18px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    box-shadow: 0 -6px 28px rgba(37,29,21,.1);
}
.co-sticky-inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.co-total { flex: 1; }
.co-total small { display: block; font-size: .68rem; color: var(--text-2); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1px; }
.co-total strong { font-family: var(--display); font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; }
.co-submit { padding: 14px 28px; font-size: .95rem; flex: none; border-radius: var(--r-sm); }

/* Painéis (confirmação) */
.panel { background: var(--card); padding: 18px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); }
.panel h2 { font-family: var(--display); font-size: 1rem; font-weight: 700; margin: 0 0 14px; }

/* ── Confirmação ─────────────────────────────────────────── */
.confirm-box { text-align: center; padding: 34px 20px 22px; }
.confirm-box .check {
    width: 70px; height: 70px; border-radius: 50%;
    background: var(--ok-bg); color: var(--ok); font-size: 2rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; animation: pop .4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm-box h2 { font-family: var(--display); font-size: 1.35rem; font-weight: 700; margin: 0 0 6px; letter-spacing: -.01em; }

/* ── Rodapé ──────────────────────────────────────────────── */
footer.site-foot {
    text-align: center; padding: 30px 18px 40px;
    color: var(--text-2); font-size: .8rem;
}
footer.site-foot strong { color: var(--text); font-family: var(--display); font-size: .95rem; }

/* ── Responsivo ──────────────────────────────────────────── */
@media (max-width: 560px) {
    .grid-2 { grid-template-columns: 1fr; }
    .cat-section { margin: 12px 8px 0; }
    .co-section { margin: 8px 8px 0; }
}
