/* Paleta tirada das artes da Salgaderia */
:root {
  --bege: #F5D6A0;
  --creme: #FCEFD6;
  --marrom: #7B440E;
  --marrom-esc: #3B2209;
  --juta: #A8875C;
  --juta-esc: #8E6F47;
  --laranja: #F48C2A;
  --laranja-esc: #D9701A;
  --wa: #1F8F4E;
  --serif: 'Bitter', Georgia, serif;
  --sans: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); color: var(--marrom-esc);
  background: var(--bege); line-height: 1.45; overflow-x: hidden;
}
body.has-bar { padding-bottom: 76px; }
body.lock { overflow: hidden; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0; }
a { color: inherit; }

/* trama de juta, como no fundo das artes */
.menu, .encomenda, .card__img, .zoom {
  background: var(--juta) url(../img/juta.jpg) 0 0 / 260px auto repeat;
}

/* ---------- topo / hero ---------- */
.top { background: var(--bege); padding: 18px 16px 6px; }
.top__logo { width: min(300px, 76%); height: auto; margin: 0 auto; }

.hero { background: var(--bege); position: relative; padding: 0 16px 0; }
.hero__text { text-align: center; max-width: 560px; margin: 0 auto; padding-bottom: 14px; }
.hero h1 { font-size: 1.5rem; font-weight: 800; color: var(--marrom); margin-top: 6px; }
.hero p { margin: 8px 0 14px; font-size: 1rem; }
.hero__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero__photo { margin: 0 -16px; position: relative; }
.hero__photo img { width: 100%; height: 34vh; min-height: 210px; max-height: 360px; object-fit: cover; object-position: center 35%; }
.hero__photo::before { /* onda marrom das artes */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 26px; z-index: 1;
  background: var(--bege);
  -webkit-mask: radial-gradient(28px 18px at 50% 0, #000 98%, transparent) 0 0/56px 26px repeat-x;
          mask: radial-gradient(28px 18px at 50% 0, #000 98%, transparent) 0 0/56px 26px repeat-x;
}
.hero__photo figcaption {
  position: absolute; left: 12px; bottom: 12px; z-index: 1;
  background: var(--marrom); color: var(--creme); font-weight: 700; font-size: .85rem;
  padding: 6px 10px; border-radius: 4px;
}
.hero__photo figcaption::after { content: " ↓"; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 6px; border: 2px solid transparent;
  font: 800 1rem var(--sans); text-decoration: none; cursor: pointer;
}
.btn--main { background: var(--marrom); color: var(--creme); }
.btn--main:active { background: var(--marrom-esc); }
.btn--line { border-color: var(--marrom); color: var(--marrom); background: transparent; }
.btn--wa { background: var(--wa); color: #fff; width: 100%; }
.btn--wa:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--laranja); outline-offset: 2px; }

/* ---------- cardápio ---------- */
.menu { padding: 0 0 24px; }
.chips {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 16px; background: var(--marrom); scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips a {
  flex: none; color: var(--bege); text-decoration: none; font-weight: 800; font-size: .92rem;
  padding: 8px 14px; border: 1.5px solid rgba(245,214,160,.5); border-radius: 999px;
}
.cat { padding: 20px 16px 4px; scroll-margin-top: 56px; max-width: 1100px; margin: 0 auto; }
.cat h2 { color: var(--creme); font-size: 1.35rem; margin-bottom: 12px; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.grid { display: grid; gap: 14px; }

.card { background: var(--creme); border-radius: 8px; overflow: hidden; box-shadow: 0 3px 0 var(--juta-esc); display: flex; flex-direction: column; }
.card__img {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 10px; border: 0; cursor: zoom-in;
  border-bottom: 4px solid var(--marrom);
}
.card__img img { width: 100%; height: 100%; object-fit: contain; }
.card__img.noimg img { display: none; }
.card__img.noimg::after { content: "foto em breve"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--creme); font-weight: 700; font-size: .9rem; }
.zoomhint { position: absolute; right: 8px; bottom: 8px; background: rgba(59,34,9,.82); color: var(--creme); font: 700 .75rem var(--sans); padding: 4px 8px; border-radius: 4px; }
.tag { position: absolute; top: 10px; left: 10px; background: var(--laranja); color: #fff; font-weight: 800; font-size: .74rem; padding: 4px 8px; border-radius: 3px; }
.card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card h3 { font-size: 1.2rem; color: var(--marrom); }
.price { font-family: var(--serif); font-size: 1.3rem; color: var(--marrom-esc); white-space: nowrap; }
.card__items { list-style: none; margin: 0 0 4px; padding: 0; font-size: .86rem; color: #5a3a17; columns: 2; column-gap: 14px; }
.card__items li { padding: 1px 0 1px 10px; position: relative; break-inside: avoid; }
.card__items li::before { content: ""; position: absolute; left: 0; top: .62em; width: 4px; height: 4px; border-radius: 50%; background: var(--laranja); }
.card__ctl { margin-top: auto; }
.card__ctl .add { width: 100%; }
.card__ctl .step { width: 100%; justify-content: space-between; }

.add {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 6px; background: var(--laranja); color: #fff;
  font: 800 .95rem var(--sans); cursor: pointer;
}
.add:active { background: var(--laranja-esc); }
.step { display: inline-flex; flex: none; align-items: center; border: 2px solid var(--laranja); border-radius: 6px; overflow: hidden; background: #fff; }
.step button { width: 42px; height: 42px; border: 0; background: transparent; font: 800 1.3rem var(--sans); color: var(--laranja-esc); cursor: pointer; }
.step span { min-width: 26px; text-align: center; font-weight: 800; }
.step--sm button { width: 38px; height: 38px; }

/* ---------- encomenda ---------- */
.encomenda { padding: 8px 16px 28px; }
.encomenda > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.encomenda h2 { color: var(--creme); font-size: 1.35rem; padding-top: 18px; border-top: 2px dashed rgba(252,239,214,.45); }
.encomenda__lead { color: var(--creme); margin: 6px auto 14px; }
#encForm { background: var(--creme); border-radius: 8px; padding: 16px; display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 800; font-size: .92rem; }
.opt { font-weight: 400; color: #7a5a35; }
input, textarea {
  font: 400 1rem var(--sans); color: var(--marrom-esc); width: 100%;
  border: 1.5px solid #d3b585; border-radius: 6px; padding: 11px 12px; background: #fff; min-height: 46px;
}
textarea { resize: vertical; }
input[type=date], input[type=time] { position: relative; cursor: pointer; -webkit-appearance: none; appearance: none; text-align: left; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator {
  position: absolute; inset: 0; width: auto; height: auto; margin: 0; opacity: 0; cursor: pointer;
}
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
input[type=date], input[type=time] { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%237B440E' stroke-width='2'%3E%3Crect x='2' y='3.5' width='14' height='12.5' rx='2'/%3E%3Cpath d='M2 7.5h14M6 1.5v4M12 1.5v4'/%3E%3C/svg%3E") right 12px center no-repeat; padding-right: 38px; }
input[type=time] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%237B440E' stroke-width='2'%3E%3Ccircle cx='9' cy='9' r='7'/%3E%3Cpath d='M9 5v4l3 2'/%3E%3C/svg%3E"); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.enc__items { margin: 0; font-size: .9rem; background: var(--bege); padding: 10px 12px; border-radius: 6px; }
.form-err { margin: 0; color: #b3261e; font-weight: 700; min-height: 0; }
.form-err:empty { display: none; }
.hint { margin: 0; font-size: .82rem; color: #6b4c28; text-align: center; }
.hint--left { text-align: left; }
.opt { display: inline; }
label .opt { margin-left: 4px; }

/* ---------- contato ---------- */
.contato { background: var(--marrom); color: var(--creme); padding: 22px 16px 26px; }
.contato > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.contato h2 { font-size: 1.35rem; color: var(--bege); }
.info { margin: 12px auto 14px; display: grid; gap: 8px; }
.info div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; }
.info dt { font-weight: 800; color: var(--bege); }
.info dd { margin: 0; }
.todo { border: 1px dashed rgba(252,239,214,.6); padding: 1px 6px; border-radius: 3px; font-size: .85rem; opacity: .85; }
.contato__links { display: grid; gap: 8px; }
.clink { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 6px; background: rgba(252,239,214,.12); text-decoration: none; font-weight: 800; }
.clink::after { content: "↗"; margin-left: auto; opacity: .7; }
.foot { text-align: center; font-size: .8rem; color: var(--marrom); background: var(--bege); padding: 14px; }
body.has-bar .foot { padding-bottom: 14px; }

/* ---------- barra do pedido ---------- */
.bar {
  position: fixed; z-index: 20; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px;
  background: var(--marrom-esc); color: var(--creme); border: 0; border-radius: 8px;
  font: 800 1rem var(--sans); cursor: pointer; box-shadow: 0 6px 18px rgba(40,20,0,.35);
  max-width: 560px; margin: 0 auto;
}
.bar[hidden] { display: none; }
.bar__count { background: var(--laranja); color: #fff; min-width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; font-size: .9rem; padding: 0 6px; }
.bar__total { margin-left: auto; font-family: var(--serif); font-size: 1.1rem; }

/* ---------- resumo ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet[hidden] { display: none; }
.sheet__bg { position: absolute; inset: 0; background: rgba(30,15,0,.55); }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
  background: var(--creme); border-radius: 12px 12px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  display: grid; gap: 12px; max-width: 600px; margin: 0 auto;
}
.sheet__head { display: flex; align-items: center; justify-content: space-between; }
.sheet__head h2 { color: var(--marrom); font-size: 1.3rem; }
.x { width: 44px; height: 44px; border: 0; background: var(--bege); border-radius: 50%; font-size: 1.5rem; color: var(--marrom); cursor: pointer; }
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.empty { color: #7a5a35; padding: 8px 0; }
.line { display: grid; grid-template-columns: 52px 1fr auto; grid-template-areas: "img info info" "img step rm"; gap: 4px 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid #ecd6ae; }
.line img { grid-area: img; width: 52px; height: 52px; object-fit: cover; border-radius: 6px; align-self: start; }
.line__info { grid-area: info; display: grid; }
.line__info small { color: #6b4c28; font-size: .86rem; }
.line__info em { font-style: normal; font-weight: 800; color: var(--marrom-esc); }
.line .step { grid-area: step; justify-self: start; }
.rm { grid-area: rm; border: 0; background: none; color: #a1361b; font: 700 .88rem var(--sans); text-decoration: underline; min-height: 44px; padding: 0 4px; cursor: pointer; }
.sheet__total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.sheet__total strong { font-family: var(--serif); font-size: 1.5rem; color: var(--marrom-esc); }
.linkbtn { border: 0; background: none; color: var(--marrom); font: 700 .92rem var(--sans); text-decoration: underline; min-height: 44px; cursor: pointer; }

/* ---------- telas maiores ---------- */
@media (min-width: 720px) {
  .top { padding-top: 22px; }
  .hero { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 28px; padding: 0 max(24px, calc((100vw - 1100px)/2)); }
  .hero__text { text-align: left; padding-bottom: 40px; }
  .hero h1 { font-size: 2rem; }
  .hero__actions { justify-content: flex-start; }
  .hero__photo { margin: 0; }
  .hero__photo img { height: 380px; max-height: none; border-radius: 8px 8px 0 0; }
  .hero__photo::before { display: none; }
  .chips { justify-content: center; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 360px) {
  .card__items { columns: 1; }
  .row2 { grid-template-columns: 1fr; }
  .info div { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- modo do pedido (carrinho) ---------- */
.mode { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode legend { font-weight: 800; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.mode label { display: block; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 6px 8px;
  border: 2px solid #d3b585; border-radius: 6px; background: #fff; font-weight: 800; font-size: .92rem; cursor: pointer;
}
.mode input:checked + span { border-color: var(--marrom); background: var(--marrom); color: var(--creme); }
.mode input:focus-visible + span { outline: 3px solid var(--laranja); outline-offset: 2px; }
.sched { display: grid; gap: 10px; background: var(--bege); padding: 12px; border-radius: 6px; }
.sched[hidden] { display: none; }

/* ---------- foto ampliada ---------- */
.zoom { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 12px 24px; }
.zoom[hidden] { display: none; }
.zoom::before { content: ""; position: absolute; inset: 0; background: rgba(30,15,0,.55); }
.zoom img { position: relative; max-width: 100%; max-height: 78vh; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(0,0,0,.4)); }
.zoom p { position: relative; color: var(--creme); font: 800 1.05rem var(--sans); margin: 14px 0 0; text-align: center; }
.x--zoom { position: absolute; top: 12px; right: 12px; z-index: 1; }
