/* Layout 3.0 — segue a proposta aprovada (quadro "Gestão de Entregas – novo layout").
   Trabalha junto com js/layout.js, que move os elementos para o menu lateral (computador)
   ou para o menu "Mais" e o botão da conta (celular). */

/* ================= tudo (celular e computador) ================= */

/* totais: rótulo em cima, número embaixo */
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; border: 1px solid var(--line); box-shadow: none; }
.stat span { font-weight: 600; }

/* ficha de pedido */
.card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); border-left-width: 1px; box-shadow: none; background: var(--paper); }
.card.late { border-color: color-mix(in srgb, var(--late) 45%, var(--line)); }
.card.today, .card.soon { border-color: color-mix(in srgb, var(--soon) 45%, var(--line)); }
.card .meta { margin-top: 0; }
.ctop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctop .pills { justify-content: flex-start; }
.ctop .due { margin-left: auto; font-size: 13px; color: var(--muted); }
.ctop .due.late { color: var(--late); }
.ctop .due.soon { color: var(--soon); }
.cmain { display: flex; gap: 12px; align-items: flex-start; }
.ctx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.card .cli { font-family: "Barlow Condensed", Barlow, sans-serif; font-weight: 700; font-size: 22px; line-height: 1.1; }
.card .prod { font-size: 15px; margin-top: 0; color: var(--ink); }
.card .thumb { width: 64px; height: 64px; flex: none; border-radius: 10px; }
.card .thumb svg { width: 32px; height: 32px; }
.cpag { display: grid; gap: 6px; padding-top: 10px; margin-top: 2px; border-top: 1px dashed var(--line); }
.cpagl { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.cpagl span { color: var(--muted); }
.cpagl .falta { color: var(--late); }
.cpagl .quit { color: light-dark(#3d6b2c, #8cc072); }
.cbar { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--line) 80%, transparent); overflow: hidden; }
.cbar i { display: block; height: 100%; border-radius: 99px; background: light-dark(#4f7a3a, #8cc072); }
.cpaga { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card .adv { margin-top: 2px; }

/* elementos criados pelo layout.js: escondidos até a largura certa pedir */
.lateral, .cab, .maisbtn, .maisfolha[hidden], .msec, .mav { display: none; }

/* ================= celular e tablet (até 1023 px) ================= */
@media (max-width: 1023px) {
  .top { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
  .brand { flex-wrap: nowrap; gap: 10px; }
  .brand > svg, .brand h1, .brand .ver, .brand .me { display: none; }
  .brand > div:not(.me) { flex: 1 1 0; min-width: 0; }
  .brand p { font-size: 13px; margin: 0; }
  .msec { display: block; font-family: "Barlow Condensed", Barlow, sans-serif; font-weight: 700; font-size: 24px; line-height: 1.05; color: #f6ead9; }
  .brand .lojasel { position: static; flex: 0 1 auto; max-width: 42%; min-height: 44px; margin: 0; border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 14px; }
  .mav { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--wal2); color: #f6ead9; font: 700 16px Barlow, sans-serif; cursor: pointer; }

  /* barra de baixo clara, com até 5 itens */
  .tabs { background: var(--paper); border-top: 1px solid var(--line); }
  .tabs button { color: var(--muted); font-weight: 600; }
  .tabs button.on { color: var(--prod); box-shadow: inset 0 3px 0 var(--prod); }
  .tabs.commais { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tabs button.extra { display: none !important; }
  .maisbtn:not([hidden]) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: fixed; right: 0; bottom: 0; z-index: 7; width: 20%; min-height: 64px; padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box; border: 0; background: none; color: var(--muted); font: 600 12px Barlow, sans-serif; cursor: pointer; }
  .maisbtn svg { width: 24px; height: 24px; }
  .maisbtn.on { color: var(--prod); box-shadow: inset 0 3px 0 var(--prod); }

  /* menu "Mais" e conta */
  .maisfolha:not([hidden]) { display: flex; align-items: flex-end; position: fixed; inset: 0; z-index: 25; background: rgba(20, 12, 6, .55); }
  .mfpainel { width: 100%; background: var(--paper); color: var(--ink); border-radius: 18px 18px 0 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
  .mfabas { display: grid; gap: 4px; }
  .mfabas[hidden] { display: none; }
  .mfaba, .mfbtns button { min-height: 48px; border: 0; border-radius: 12px; background: var(--bg); color: var(--ink); font: 600 16px Barlow, sans-serif; text-align: left; padding: 0 16px; cursor: pointer; }
  .mfaba.on { background: var(--prodbg); color: var(--prod); }
  .mfconta { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
  .mfme { font-size: 14px; color: var(--muted); }
  .mfbtns { display: grid; gap: 6px; }
  .mfbtns .sairBtn { margin: 0; }
  .mfconta .temaBtn { min-height: 48px; margin: 0; border: 0; border-radius: 12px; background: var(--bg); color: var(--ink); font: 600 16px Barlow, sans-serif; text-align: left; padding: 0 16px; cursor: pointer; }
  .mffechar { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--ink); font: 600 15px Barlow, sans-serif; cursor: pointer; }
}

/* ================= computador (a partir de 1024 px) ================= */
@media (min-width: 1024px) {
  body.computador {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    align-items: start;
    padding-bottom: 0;
    min-height: 100vh;
  }
  body.computador > .top { display: none; }

  /* menu lateral */
  body.computador .lateral {
    grid-column: 1; grid-row: 1;
    position: sticky; top: 0;
    height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 22px;
    padding: 24px 16px; box-sizing: border-box;
    background: var(--wal); color: #f6ead9;
  }
  .lmarca { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
  .llogo { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--wal2); display: flex; align-items: center; justify-content: center; }
  .llogo svg { width: 30px; height: 30px; }
  .lmarca b { display: block; font-family: "Barlow Condensed", Barlow, sans-serif; font-size: 20px; line-height: 1.05; letter-spacing: .02em; }
  .lmarca span { font-size: 13px; color: #e2cdb4; }
  .lloja { display: grid; gap: 6px; padding: 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #e2cdb4; }
  .lloja:not(:has(select:not([hidden]))) { display: none; }
  body.computador .lloja .lojasel { position: static; max-width: 100%; width: 100%; min-height: 44px; margin: 0; border-radius: 10px; background: #fffcf7; color: #2a1c12; font: 500 15px Barlow, sans-serif; text-transform: none; letter-spacing: 0; }
  body.computador .lateral .tabs { position: static; display: flex; flex-direction: column; gap: 2px; padding: 0; background: none; border: 0; }
  body.computador .lateral .tabs[hidden] { display: none; }
  body.computador .lateral .tabs button { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 10px; font-size: 15px !important; font-weight: 600; color: #f6ead9; text-align: left; box-shadow: none; }
  body.computador .lateral .tabs button[hidden] { display: none; }
  body.computador .lateral .tabs button svg { width: 20px; height: 20px; flex: none; }
  body.computador .lateral .tabs button:hover { background: rgba(255, 255, 255, .08); }
  body.computador .lateral .tabs button.on { background: #f6ead9; color: #2a1c12; }
  .luser { margin-top: auto; display: grid; gap: 10px; padding: 14px 8px 0; border-top: 1px solid rgba(246, 234, 217, .18); }
  .lid { display: flex; align-items: center; gap: 10px; }
  .lav { width: 36px; height: 36px; flex: none; border-radius: 999px; background: var(--wal2); display: flex; align-items: center; justify-content: center; font-weight: 700; }
  .lme { font-size: 14px; line-height: 1.3; color: #f6ead9; }
  .lbtns { display: flex; gap: 8px; }
  body.computador .luser .temaBtn { justify-self: start; margin: 0; min-height: 36px; padding: 0 12px; border-radius: 8px; background: transparent; border: 1px solid rgba(246, 234, 217, .35); color: #f6ead9; font: 600 13px Barlow, sans-serif; cursor: pointer; }
  body.computador .lbtns .sairBtn { margin: 0; min-height: 40px; padding: 0 12px; border-radius: 8px; background: transparent; border: 1px solid rgba(246, 234, 217, .35); }

  /* conteúdo */
  body.computador > main {
    grid-column: 2; grid-row: 1;
    width: 100%; max-width: 1280px; margin: 0;
    padding: 28px clamp(20px, 3vw, 44px) 64px; box-sizing: border-box;
  }
  body.computador .cab { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 20px; }
  .cabt { flex: 1 1 280px; }
  .cabd { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .cabh { font-family: "Barlow Condensed", Barlow, sans-serif; font-size: 44px; line-height: 1; margin: 0; }
  .caba { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  body.computador .caba #btnRel { width: auto !important; margin: 0 !important; min-height: 44px; }
  body.computador:not([data-aba="pedidos"]) .caba #btnRel, body.computador .caba #btnRel[hidden] { display: none; }
  body.computador .caba .fab { position: static; height: 44px; border-radius: 10px; font-size: 15px; padding: 0 18px; box-shadow: none; }
  body.computador .caba .fab[hidden] { display: none; }
  body.computador .sectionh h2 { display: none; }
  body.computador .sectionh { justify-content: flex-end; margin-top: -8px; }
  body.computador .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  body.computador .stat { padding: 14px 16px 12px; }
  body.computador .list.grid2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
  body.computador .chips { flex-wrap: wrap; overflow: visible; }
  body.computador .toast { bottom: 32px; left: calc(50% + 132px); }
}

/* faixa do ambiente de teste (só aparece no site de teste) */
.faixaTeste { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 50; padding: 3px 12px; border-radius: 0 0 8px 8px; background: #7a1f87; color: #fff; font: 700 11px Barlow, sans-serif; letter-spacing: .06em; pointer-events: none; }
