/*
 * Cardápio público - folha de estilo própria.
 *
 * Antes as telas do cliente emprestavam o admin.css, que é feito para uma
 * sidebar de desktop e para tabelas de gestão. O cliente chega pelo celular,
 * por um link, e precisa ver a loja inteira de cara: capa, status, tempo de
 * entrega, categorias e produtos, sem clicar em nada. Separar o CSS deixa o
 * cardápio evoluir sem risco de quebrar o painel (e vice-versa).
 *
 * Tudo é self-hosted por causa da CSP (`default-src 'self'`, ver
 * public_html/.htaccess): nenhuma fonte de CDN, nenhum ícone de pacote externo.
 */

:root {
    --brand: #b8402b;
    --brand-dark: #953221;
    --brand-wash: #fbf0ed;
    --ink: #171717;
    --ink-2: #57534f;
    --ink-3: #8c8781;
    --surface: #ffffff;
    --bg: #f4f2f0;
    --line: #ebe7e3;
    --ok-bg: #e7f6ec;
    --ok-text: #14672f;
    --err-bg: #fdecea;
    --err-text: #b42318;
    --warn-bg: #fef4e6;
    --warn-text: #96590f;
    --radius: 16px;
    --radius-sm: 12px;
    --pill: 999px;
    --shell: 560px;
    --dock-height: 68px;
    --shadow-sm: 0 1px 2px rgba(23, 23, 23, 0.05);
    --shadow-md: 0 8px 28px rgba(23, 23, 23, 0.10);
    --shadow-lg: 0 -10px 40px rgba(23, 23, 23, 0.16);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.menu-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.45;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

/* Só reserva o espaço da barra do carrinho quando ela realmente está na tela -
   senão toda página ficaria com um vão morto de 68px embaixo. */
body.menu-body.has-dock {
    padding-bottom: calc(var(--dock-height) + 24px + env(safe-area-inset-bottom, 0px));
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.shell {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 16px;
}

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Acessível a leitor de tela, invisível na tela. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ============ Cabeçalho da loja (só na home do cardápio) ============ */

.store-hero {
    background: var(--surface);
}

.store-cover {
    height: 150px;
    background-color: var(--brand-dark);
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Sem foto de capa configurada, a capa é um degradê da marca em vez de um
   retângulo cinza "faltando imagem" - a loja nunca parece incompleta. */
.store-cover--blank {
    background-image: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 55%, #6d2417 100%);
}

.store-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.34) 100%);
}

.store-card {
    position: relative;
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 16px 18px;
}

.store-logo {
    width: 78px;
    height: 78px;
    border-radius: 20px;
    margin-top: -34px;
    position: relative;
    z-index: 1;
    background: var(--surface);
    border: 3px solid var(--surface);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sem logo enviada: monograma com as iniciais, na cor da marca. */
.store-logo-mono {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.store-name {
    font-size: 1.4rem;
    font-weight: 800;
    margin-top: 12px;
}

.store-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--pill);
    font-size: 0.76rem;
    font-weight: 700;
}

.pill--open {
    background: var(--ok-bg);
    color: var(--ok-text);
}

.pill--closed {
    background: var(--err-bg);
    color: var(--err-text);
}

/* O ponto é redundante com o texto de propósito: quem não distingue as cores
   lê "Aberto agora" do mesmo jeito. */
.pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.store-hours {
    font-size: 0.82rem;
    color: var(--ink-2);
}

.store-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.store-fact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: var(--pill);
    background: var(--bg);
    font-size: 0.78rem;
    color: var(--ink-2);
    font-weight: 600;
}

.store-fact .icon {
    width: 15px;
    height: 15px;
    color: var(--ink-3);
}

.store-fact strong {
    color: var(--ink);
    font-weight: 700;
}

.store-more {
    margin-top: 12px;
}

.store-more>summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand);
    cursor: pointer;
    list-style: none;
}

.store-more>summary::-webkit-details-marker {
    display: none;
}

.store-more[open]>summary .icon {
    transform: rotate(90deg);
}

.store-more>summary .icon {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}

.store-more-body {
    margin-top: 12px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 0.84rem;
    color: var(--ink-2);
}

.hours-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
}

.hours-row.is-today {
    color: var(--ink);
    font-weight: 700;
}

.store-more-contact {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.store-more-contact p {
    margin: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.store-more-contact .icon {
    width: 15px;
    height: 15px;
    color: var(--ink-3);
}

/* ============ Barra compacta (fixa no topo) ============ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--surface);
    border-bottom: 1px solid transparent;
}

/* Na home a barra fica INVISÍVEL por cima da capa e só aparece depois que a
   capa sai da tela. Aqui ela é `fixed`, não `sticky`, de propósito: como sticky
   ela ocuparia espaço no fluxo e, ao ganhar altura na hora de grudar, empurraria
   a página inteira 54px para baixo - um solavanco bem no meio da rolagem.
   Enquanto está invisível também não recebe toque, para não roubar o clique de
   nada que esteja embaixo. */
.topbar--floating {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    border-bottom-color: transparent;
    pointer-events: none;
}

.topbar--floating.is-stuck {
    background: var(--surface);
    border-bottom-color: var(--line);
    pointer-events: auto;
}

.topbar:not(.topbar--floating) {
    border-bottom-color: var(--line);
}

.topbar-inner {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
}

.topbar-title {
    font-weight: 700;
    font-size: 0.95rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar--floating .topbar-title,
.topbar--floating .topbar-back {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.topbar--floating.is-stuck .topbar-title,
.topbar--floating.is-stuck .topbar-back {
    opacity: 1;
}

.topbar-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ink-2);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 8px 6px 0;
}

.topbar-back:hover {
    color: var(--ink);
}

/* ============ Ferramentas do cardápio: busca + categorias ============ */

.menu-tools {
    position: sticky;
    top: 54px;
    z-index: 20;
    background: var(--bg);
    padding-top: 12px;
}

/* Sem a barra compacta com corpo (páginas internas), a régua de categorias
   gruda logo abaixo do topo. */
.menu-tools--top {
    top: 0;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--pill);
    padding: 0 14px;
    height: 44px;
    box-shadow: var(--shadow-sm);
}

.search-field .icon {
    color: var(--ink-3);
}

.search-field input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 0.92rem;
    color: var(--ink);
    height: 100%;
}

.search-field input::placeholder {
    color: var(--ink-3);
}

.search-clear {
    border: none;
    background: none;
    color: var(--ink-3);
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.search-clear:hover {
    color: var(--ink);
}

.menu-cats {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0;
    /* Esconde a barra de rolagem sem impedir o gesto de arrastar. */
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
}

.menu-cats::-webkit-scrollbar {
    display: none;
}

.menu-cat {
    flex-shrink: 0;
    scroll-snap-align: start;
    padding: 8px 15px;
    border-radius: var(--pill);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 0.83rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.menu-cat:hover {
    border-color: var(--ink-3);
    color: var(--ink);
}

.menu-cat.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

/* ============ Lista de produtos ============ */

.menu-main {
    padding-top: 4px;
}

.menu-section {
    padding-top: 18px;
}

/* A régua de categorias é fixa: sem esse recuo, o clique num chip levaria o
   título da seção para debaixo dela. */
.menu-section {
    scroll-margin-top: 132px;
}

.menu-section-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.menu-section-count {
    color: var(--ink-3);
    font-weight: 600;
    font-size: 0.8rem;
    margin-left: 6px;
}

.menu-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    font: inherit;
    color: inherit;
    transition: border-color 0.12s ease, transform 0.12s ease;
}

/* Alvo de toque do card: um botão de submit transparente por cima de tudo.
   O conteúdo do card não é interativo, então nada fica inacessível embaixo. */
.menu-item-hit {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0;
}

.menu-item:has(.menu-item-hit:hover) {
    border-color: var(--ink-3);
}

.menu-item:has(.menu-item-hit:active) {
    transform: scale(0.995);
}

.menu-item:has(.menu-item-hit:focus-visible) {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

/* Navegadores sem :has() ainda mostram o foco, só que no próprio botão. */
.menu-item-hit:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: -2px;
}

.menu-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.menu-item-name {
    font-size: 0.95rem;
    font-weight: 700;
}

/* Descrição em no máximo duas linhas: cardápio de celular precisa de ritmo,
   e o texto inteiro aparece ao abrir o produto. */
.menu-item-desc {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--ink-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-item-price {
    margin-top: auto;
    padding-top: 8px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--brand);
}

.menu-item-stock-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--err-bg);
    color: var(--err-text);
    width: fit-content;
}

.menu-item-media {
    width: 92px;
    height: 92px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
    position: relative;
}

.menu-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-item-media--blank {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cfc8c2;
    background: linear-gradient(135deg, #f7f5f3 0%, #eeeae6 100%);
}

.menu-item-media--blank .icon {
    width: 26px;
    height: 26px;
}

/* O "+" é só um afirmador visual: o alvo de toque é o card inteiro. */
.menu-item-add {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    border: 2px solid var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.menu-item-add .icon {
    width: 16px;
    height: 16px;
}

.menu-empty {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 36px 20px;
    text-align: center;
    color: var(--ink-2);
    margin-top: 16px;
}

.menu-empty-title {
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

/* ============ Ficha do produto (folha que sobe de baixo) ============ */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(23, 23, 23, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sheet-backdrop[hidden] {
    display: none;
}

.sheet {
    background: var(--surface);
    width: 100%;
    max-width: var(--shell);
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: sheet-up 0.22s ease;
}

@keyframes sheet-up {
    from {
        transform: translateY(18px);
        opacity: 0.6;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sheet {
        animation: none;
    }

    .menu-item {
        transition: none;
    }
}

.sheet-scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sheet-media {
    background: var(--bg);
}

.sheet-media img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
}

.sheet-media[hidden] {
    display: none;
}

.sheet-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.sheet-body {
    padding: 18px 18px 8px;
    position: relative;
}

.sheet-name {
    font-size: 1.15rem;
    font-weight: 800;
}

.sheet-desc {
    margin: 8px 0 0;
    font-size: 0.88rem;
    color: var(--ink-2);
    white-space: pre-line;
}

.sheet-desc[hidden] {
    display: none;
}

.sheet-price {
    margin-top: 12px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--brand);
}

.sheet-stock-note {
    margin: 8px 0 0;
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--err-bg);
    color: var(--err-text);
}

.sheet-foot {
    padding: 14px 18px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 12px;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--pill);
    padding: 3px;
    flex-shrink: 0;
}

.stepper button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper button:disabled {
    color: #cfc8c2;
    cursor: default;
}

.stepper button:hover:not(:disabled) {
    background: var(--line);
}

.stepper-value {
    min-width: 30px;
    text-align: center;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* ============ Barra fixa do carrinho ============ */

.cart-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    text-decoration: none;
}

.cart-dock-inner {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}

.cart-dock-btn {
    background: var(--ink);
    color: #fff;
    border-radius: var(--pill);
    padding: 13px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    font-weight: 700;
}

.cart-dock-count {
    background: rgba(255, 255, 255, 0.16);
    border-radius: var(--pill);
    padding: 3px 10px;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.cart-dock-label {
    flex: 1;
}

.cart-dock-total {
    font-variant-numeric: tabular-nums;
}

/* ============ Peças compartilhadas (carrinho, checkout, cadastro) ============ */

.page-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 18px 0 4px;
}

.page-lead {
    color: var(--ink-2);
    font-size: 0.88rem;
    margin: 0 0 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 14px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    border-radius: var(--pill);
    padding: 12px 20px;
    font: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: #000;
    border-color: #000;
}

.btn:disabled {
    background: var(--ink-3);
    border-color: var(--ink-3);
    cursor: not-allowed;
}

.btn--brand {
    background: var(--brand);
    border-color: var(--brand);
}

.btn--brand:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn--ghost {
    background: transparent;
    color: var(--ink-2);
    border-color: var(--line);
}

.btn--ghost:hover {
    background: var(--bg);
    color: var(--ink);
}

.btn--danger {
    background: transparent;
    color: var(--err-text);
    border-color: transparent;
    padding: 8px;
}

.btn--danger:hover {
    background: var(--err-bg);
}

.btn--block {
    width: 100%;
}

.btn--lg {
    padding: 15px 20px;
    font-size: 0.98rem;
}

.field {
    margin-top: 14px;
}

.field:first-child {
    margin-top: 0;
}

.field>label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 6px;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="email"],
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 12px 14px;
    font: inherit;
    font-size: 0.92rem;
    color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
    border-color: transparent;
}

textarea {
    resize: vertical;
    min-height: 76px;
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-top: 8px;
    cursor: pointer;
}

.choice:has(input:checked) {
    border-color: var(--ink);
    background: var(--bg);
}

.choice input {
    width: auto;
    margin-top: 2px;
    accent-color: var(--brand);
}

.choice-text {
    font-size: 0.88rem;
}

.choice-text small {
    display: block;
    color: var(--ink-2);
    font-size: 0.8rem;
}

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 0.86rem;
    margin-top: 14px;
}

.alert-error {
    background: var(--err-bg);
    color: var(--err-text);
}

.alert-success {
    background: var(--ok-bg);
    color: var(--ok-text);
}

.alert-warn {
    background: var(--warn-bg);
    color: var(--warn-text);
}

/* Aviso de item adicionado aparece flutuando e some sozinho: depois de
   adicionar, o cliente volta para o ponto do cardápio em que estava, e um
   alerta lá no topo da página não seria visto. */
.toast {
    position: fixed;
    left: 50%;
    /* Abaixo da .topbar (54px de altura mínima + z-index 30): um toast em
       cima do título/botão voltar escondia a navegação da página por até
       3.4s (ex.: sempre que o cliente salvava o endereço, no redirect direto
       para o checkout). */
    top: 110px;
    transform: translateX(-50%);
    z-index: 70;
    max-width: calc(100% - 32px);
    background: var(--ink);
    color: #fff;
    border-radius: var(--pill);
    padding: 11px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    animation: toast-in 0.2s ease, toast-out 0.35s ease 3.4s forwards;
}

.toast--error {
    background: var(--err-text);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translate(-50%, -12px);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translate(-50%, -12px);
        visibility: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
    }
}

/* ---- Linhas do carrinho ---- */

.cart-line {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.cart-line:first-child {
    padding-top: 0;
}

.cart-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cart-line-body {
    flex: 1;
    min-width: 0;
}

.cart-line-name {
    font-weight: 700;
    font-size: 0.92rem;
}

.cart-line-notes {
    font-size: 0.8rem;
    color: var(--ink-2);
    margin-top: 3px;
}

.cart-line-price {
    font-size: 0.85rem;
    color: var(--ink-2);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.cart-line-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.cart-line--off .cart-line-name {
    color: var(--err-text);
}

/* Passo de quantidade em formulários separados: funciona sem JavaScript. */
.qty-steps {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--pill);
    padding: 2px;
}

.qty-steps button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font: inherit;
}

.qty-steps button:hover {
    background: var(--bg);
}

.qty-steps .icon {
    width: 14px;
    height: 14px;
}

.qty-steps-value {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    font-size: 0.86rem;
    font-variant-numeric: tabular-nums;
}

.totals {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

/* No carrinho a última linha de produto já possui o separador inferior.
   Remover a segunda borda evita a "barrinha" duplicada antes dos totais. */
.cart-totals {
    margin-top: 0;
    border-top: 0;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    padding: 3px 0;
    color: var(--ink-2);
}

.totals-row--grand {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--ink);
    padding-top: 8px;
}

.totals-row span:last-child {
    font-variant-numeric: tabular-nums;
}

/* ---- Acompanhamento do pedido ---- */

.track-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.track-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 18px;
    position: relative;
    color: var(--ink-3);
}

.track-step:last-child {
    padding-bottom: 0;
}

/* O fio que liga os passos nasce do próprio passo, então some sozinho no último. */
.track-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 20px;
    bottom: 2px;
    width: 2px;
    background: var(--line);
}

.track-step.is-done {
    color: var(--ink);
}

.track-step.is-done:not(:last-child)::before {
    background: var(--ok-text);
}

.track-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--surface);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.track-step.is-done .track-dot {
    background: var(--ok-text);
    border-color: var(--ok-text);
}

.track-dot .icon {
    width: 11px;
    height: 11px;
    opacity: 0;
}

.track-step.is-done .track-dot .icon {
    opacity: 1;
}

.track-label {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 18px;
}

@media (min-width: 640px) {
    .store-cover {
        height: 190px;
    }

    .menu-item-media {
        width: 108px;
        height: 108px;
    }
}

/* A seta de "voltar" reaproveita o chevron do conjunto de ícones, virado. */
.topbar-back-icon {
    transform: rotate(180deg);
    width: 15px;
    height: 15px;
}

/* Remocao dos botoes de seta e marcadores feios da barra de rolagem */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 99px;
}

::-webkit-scrollbar-button,
::-webkit-scrollbar-button:single-button,
::-webkit-scrollbar-button:vertical,
::-webkit-scrollbar-button:horizontal,
::-webkit-scrollbar-button:start,
::-webkit-scrollbar-button:end {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

* {
    scrollbar-width: thin;
}
