/* =========================================================
   Bloom's Café - estilos
   Base visual: acolhedora, foto em destaque, uma cor de destaque (terracota da marca).
   Regra de cantos: botões em pílula, fotos e blocos com 16px.
   ========================================================= */

/* ---------- Fontes (arquivos locais em /fontes) ---------- */
@font-face { font-family: "Figtree"; src: url("../fontes/figtree-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fontes/figtree-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fontes/figtree-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fontes/cormorant-garamond-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fontes/cormorant-garamond-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fontes/cormorant-garamond-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }

/* ---------- Cores e medidas (modo claro) ---------- */
:root {
  --fundo: #fdfcfb;
  --superficie: #f7efee;      /* rosa bem claro, da sacola */
  --rosa: #f1dfe0;
  --tinta: #2b2321;           /* títulos */
  --texto: #4f4542;           /* texto corrido */
  --texto-suave: #6b605c;
  --linha: #ebe3e1;
  --acento: #a9633d;          /* terracota da logo */
  --acento-forte: #8c4f2f;
  --acento-texto: #9a5634;    /* terracota para texto pequeno (contraste AA) */
  --sobre-acento: #ffffff;
  --sombra: 0 1px 2px rgb(80 45 30 / 0.06), 0 8px 24px rgb(80 45 30 / 0.08);

  --raio: 16px;
  --largura: 1200px;
  --margem: 16px;
  --topo-altura: 64px;

  --serifa: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topo-altura) + 16px); }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { color: var(--tinta); margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }


:focus-visible { outline: 3px solid var(--acento-texto); outline-offset: 3px; border-radius: 6px; }

.pular {
  position: absolute; left: 12px; top: -48px; z-index: 30;
  background: var(--tinta); color: var(--fundo);
  padding: 10px 16px; border-radius: 999px; text-decoration: none; font-weight: 600;
}
.pular:focus { top: 12px; }

.secao { max-width: var(--largura); margin-inline: auto; padding: 64px var(--margem); }
.titulo-secao {
  font-family: var(--serifa);
  font-weight: 500;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.icone { width: 20px; height: 20px; fill: currentColor; flex: none; }


/* ---------- Botões ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 26px;
  border-radius: 999px;
  font: 600 1rem/1 var(--sans);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
  touch-action: manipulation;
}
.botao:active { transform: scale(0.97); }
.botao--primario { background: var(--acento); color: var(--sobre-acento); }
.botao--primario:hover { background: var(--acento-forte); }
.botao--secundario { background: transparent; color: var(--tinta); border-color: currentColor; }
.botao--secundario:hover { background: var(--superficie); }
.botao--pequeno { min-height: 44px; padding: 10px 20px; font-size: .9375rem; }
.botao--icone { padding: 0; width: 52px; }

/* ---------- Topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--fundo) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--linha);
}
.topo__interno {
  max-width: var(--largura); margin-inline: auto;
  height: var(--topo-altura); padding-inline: var(--margem);
  display: flex; align-items: center; gap: 24px;
}
.topo__marca { display: block; margin-right: auto; }
.topo__marca .logo { height: 40px; width: auto; }
.topo__nav { display: flex; gap: 20px; }
.topo__nav a { text-decoration: none; font-weight: 500; color: var(--tinta); padding: 10px 2px; }
.topo__nav a:hover { color: var(--acento-texto); }
.topo__pedir { display: none; }

/* ---------- Abertura (hero) ---------- */
.hero {
  max-width: var(--largura); margin-inline: auto;
  padding: 40px var(--margem) 24px;
  display: grid; gap: 32px;
}
.hero__titulo {
  font-family: var(--serifa);
  font-weight: 500;
  font-size: clamp(2.5rem, 1.6rem + 4vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
}
.hero__sub { margin-top: 20px; font-size: 1.125rem; max-width: 34ch; color: var(--texto); }
.hero__acoes { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero__foto { margin: 0; }
.hero__foto img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 62%;
  border-radius: var(--raio);
  background: var(--superficie);
}

/* ---------- Destaques (grade de fotos) ---------- */
.destaques__grade {
  margin-top: 28px;
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
.destaques__grade figure { margin: 0; }
.destaques__grade img {
  width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--raio); background: var(--superficie);
}
.destaques__grade figure:first-child { grid-column: span 2; }

/* ---------- Cardápio ---------- */
.cardapio__cabeca { display: grid; gap: 8px; }
.cardapio__nota { color: var(--texto-suave); font-size: .9375rem; }
.cardapio__nota a { color: var(--acento-texto); }

.abas {
  margin: 24px calc(var(--margem) * -1) 0;
  padding: 4px var(--margem);
  display: flex; gap: 8px;
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--margem);
  scrollbar-width: none;
}
.abas::-webkit-scrollbar { display: none; }
.aba {
  flex: none; scroll-snap-align: start;
  min-height: 44px; padding: 10px 18px;
  border-radius: 999px; border: 1.5px solid var(--linha);
  background: transparent; color: var(--tinta);
  font: 500 .9375rem/1 var(--sans); cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
  touch-action: manipulation;
}
.aba:hover { border-color: var(--texto-suave); }
.aba[aria-selected="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--fundo); }

.painel { margin-top: 28px; display: grid; gap: 28px; }
.painel[hidden] { display: none; }
.painel__foto img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: var(--raio); background: var(--superficie);
}
.painel__nota { color: var(--texto-suave); font-size: .9375rem; margin-bottom: 20px; }
.itens { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.item__topo { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.item__nome { font: 600 1.0625rem/1.3 var(--sans); color: var(--tinta); }
.item__preco { font-weight: 600; color: var(--tinta); font-variant-numeric: tabular-nums; white-space: nowrap; }
.item__desc { margin-top: 4px; font-size: .9375rem; line-height: 1.5; color: var(--texto-suave); }
.painel__pedir { margin-top: 28px; }
.painel__pedir a { color: var(--acento-texto); font-weight: 600; text-underline-offset: 4px; }

/* ---------- Sobre ---------- */
.sobre { text-align: center; }
.sobre__monograma { width: 64px; height: auto; margin: 0 auto 20px; }
.sobre__texto { margin: 20px auto 0; max-width: 56ch; font-size: 1.125rem; }
.sobre__info {
  margin: 40px auto 0; max-width: 880px;
  display: grid; gap: 12px;
  text-align: left;
}
.sobre__info div { background: var(--superficie); border-radius: var(--raio); padding: 20px 22px; }
.sobre__info dt { font-size: .875rem; font-weight: 600; color: var(--acento-texto); }
.sobre__info dd { margin: 6px 0 0; color: var(--tinta); }

/* ---------- Chamada final ---------- */
.final { padding: 0 var(--margem) 64px; }
.final__interno {
  max-width: calc(var(--largura) - 2 * var(--margem)); margin-inline: auto;
  background: var(--rosa); border-radius: var(--raio);
  padding: 48px 24px; text-align: center;
  display: grid; justify-items: center; gap: 14px;
}
.final__titulo { font-family: var(--serifa); font-weight: 500; font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem); line-height: 1.05; }
.final__acoes { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.final__insta {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding-inline: 8px;
  color: var(--tinta); font-weight: 500; text-underline-offset: 4px;
}

/* ---------- Rodapé ---------- */
.rodape { border-top: 1px solid var(--linha); padding: 40px var(--margem) 120px; }
.rodape__interno { max-width: calc(var(--largura) - 2 * var(--margem)); margin-inline: auto; display: grid; gap: 20px; }
.rodape__logo { height: 40px; width: auto; }
.rodape__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rodape__links a { display: inline-block; padding: 8px 0; text-decoration: none; color: var(--tinta); }
.rodape__links a:hover { color: var(--acento-texto); text-decoration: underline; text-underline-offset: 4px; }
.rodape__links span { color: var(--texto-suave); }
.rodape__legal { font-size: .875rem; color: var(--texto-suave); }

/* ---------- Barra de pedido (só celular) ---------- */
.barra-pedido {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: flex; gap: 10px;
  padding: 12px var(--margem) calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--fundo) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--linha);
  transform: translateY(110%);
  transition: transform .35s var(--ease);
}
.barra-pedido .botao--primario { flex: 1; }
.barra-pedido.visivel { transform: none; }

/* ---------- Entrada suave ao rolar ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .revelar { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js .revelar.visto { opacity: 1; transform: none; }
  .hero__texto > * { animation: subir .8s var(--ease) both; }
  .hero__texto > :nth-child(2) { animation-delay: .08s; }
  .hero__texto > :nth-child(3) { animation-delay: .16s; }
  .hero__foto { animation: aparecer 1s var(--ease) .1s both; }
}
@keyframes subir { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes aparecer { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .botao, .aba, .barra-pedido { transition: none; }
}

/* =========================================================
   Telas maiores
   ========================================================= */
@media (min-width: 640px) {
  :root { --margem: 24px; }
  .destaques__grade { grid-template-columns: repeat(4, 1fr); }
  .destaques__grade figure:first-child { grid-column: span 2; grid-row: span 2; }
  .sobre__info { grid-auto-flow: column; grid-auto-columns: minmax(0, 285px); justify-content: center; }
  .rodape__interno { grid-template-columns: auto 1fr; align-items: start; column-gap: 64px; }
  .rodape__legal { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  :root { --margem: 40px; --topo-altura: 72px; }
  .topo__pedir { display: inline-flex; }
  .barra-pedido { display: none; }
  .rodape { padding-bottom: 48px; }

  .secao { padding-block: 96px; }
  .hero {
    grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 64px;
    padding-top: 48px; padding-bottom: 48px;
    min-height: min(760px, calc(100dvh - var(--topo-altura)));
  }
  .hero__foto img { max-height: calc(100dvh - var(--topo-altura) - 96px); aspect-ratio: 4 / 5; }

  .painel { grid-template-columns: 5fr 7fr; gap: 56px; align-items: start; }
  .painel__foto { position: sticky; top: calc(var(--topo-altura) + 24px); }
  .painel__foto img { aspect-ratio: 4 / 5; }
  .itens { grid-template-columns: 1fr 1fr; column-gap: 40px; row-gap: 28px; }

  .final__interno { padding: 72px 40px; }
}

/* Celular: botões da abertura ocupam a largura toda */
@media (max-width: 639px) {
  .hero__acoes .botao, .final__acoes .botao { flex: 1 1 100%; }
}

/* Celular: o foco do teclado não fica escondido atrás da barra de pedido */
@media (max-width: 899px) {
  html { scroll-padding-bottom: 96px; }
}

/* ---------- Cardápio: miniaturas e categorias sem foto ---------- */
.item--foto { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: start; }
.item__texto { min-width: 0; }
.item__mini {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 12px; background: var(--superficie);
}
@media (min-width: 900px) {
  .painel.painel--sem-foto { grid-template-columns: 1fr; }
  .painel--sem-foto .itens { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Cardápio: clicar no item mostra a foto dele no lugar da foto grande ---------- */
@media (max-width: 899px) { .painel__foto { position: relative; } } /* no desktop ela já é sticky */
.painel__foto img { transition: opacity .25s var(--ease); }
.painel__foto img.trocando { opacity: .35; }
.painel__legenda {
  position: absolute; left: 12px; bottom: 12px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--fundo); color: var(--tinta);
  font: 500 .875rem/1.3 var(--sans);
  box-shadow: 0 2px 10px rgb(0 0 0 / .12);
}
.painel__legenda[hidden] { display: none; }

.item--clicavel { position: relative; border-radius: 14px; }
.item__botao {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
/* a área de clique cobre o item inteiro (miniatura + texto) */
.item__botao::after { content: ""; position: absolute; inset: -6px; border-radius: 14px; }
.item__botao:focus-visible { outline: none; }
.item__botao:focus-visible::after { outline: 3px solid var(--acento-texto); outline-offset: 0; }
.item--clicavel .item__mini { transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
@media (hover: hover) {
  .item--clicavel:hover .item__mini { transform: scale(1.04); }
  .item--clicavel:hover .item__botao { color: var(--acento-texto); }
}
.item--clicavel:has(.item__botao[aria-pressed="true"]) .item__mini {
  box-shadow: 0 0 0 2px var(--fundo), 0 0 0 4px var(--acento);
}
.item__botao[aria-pressed="true"] { color: var(--acento-texto); }
@media (prefers-reduced-motion: reduce) {
  .painel__foto img, .item--clicavel .item__mini { transition: none; }
  .item--clicavel:hover .item__mini { transform: none; }
}
