:root {
  --bg: #f7f2ea;
  --paper: #fffdf9;
  --text: #2b211b;
  --muted: #715e50;
  --wine: #641821;
  --wine-light: #8b2732;
  --gold: #c29a55;
  --line: #e7ddcf;
  --green: #17683c;
  --danger: #a32231;
  --shadow: 0 16px 45px rgb(48 29 17 / 8%);
  --radius: 24px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #eee0c6 0, transparent 32%),
    var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}

body.modal-open { overflow: hidden; }

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.container {
  width: min(1320px, calc(100% - 32px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 30;
  padding: 12px;
  background: white;
}

.skip-link:focus { top: 12px; }

.hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 36px;
  margin-top: 20px;
  padding: clamp(24px, 4vw, 48px);
  border-radius: 32px;
  color: #fff8ed;
  background:
    radial-gradient(circle at top right, #a1763b55, transparent 45%),
    linear-gradient(135deg, #361015, var(--wine));
  box-shadow: var(--shadow);
}

.logo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  color: #282828;
  background: #f7f0e4;
  text-align: center;
}

.logo strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 64px;
}

.logo span { letter-spacing: 3px; font-size: 12px; }

.logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f7f0e4;
}

.eyebrow {
  margin-bottom: 10px;
  color: #e6c58f;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.eyebrow.dark { color: #896632; }

h1 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4.7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.tagline { max-width: 650px; font-size: 1.1rem; }

.hero-details { display: grid; gap: 7px; font-size: .94rem; }
.hero-details p { margin: 0; }
#statusLoja { font-weight: 750; }
#statusLoja.aberta { color: #bdffd4; }
#statusLoja.fechada { color: #ffe0b5; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.tags span {
  padding: 7px 12px;
  border: 1px solid #ffffff35;
  border-radius: 999px;
  background: #ffffff0b;
  font-size: .82rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-block: 20px;
}

.info-box, .panel {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.info-box strong { display: block; color: var(--wine); }
.info-box span { color: var(--muted); font-size: .9rem; }

summary { cursor: pointer; color: var(--wine); font-weight: 750; }
.details-content { padding-top: 16px; }
.details-content p { color: var(--muted); font-size: .9rem; }
.details-content p:last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }

th, td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th:last-child, td:last-child { text-align: right; white-space: nowrap; }

.menu-heading { margin: 36px 0 18px; }
.menu-heading h2 { margin-bottom: 8px; color: var(--wine); font-size: 2rem; }
.menu-heading > p:last-child { color: var(--muted); }

.controls { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.search { flex: 1 1 300px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }

.filter {
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper);
  font-weight: 750;
}

.filter[aria-pressed="true"] {
  border-color: var(--wine);
  color: white;
  background: var(--wine);
}

.category { margin-top: 30px; }
.category h2 { margin-bottom: 8px; color: var(--wine); }
.category-description { max-width: 1000px; margin-bottom: 22px; color: var(--muted); }

.items-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: transform .18s ease;
}

@media (hover: hover) {
  .card:hover { transform: translateY(-3px); }
}

.photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #eee0cb, #f8f1e6);
}

.photo-placeholder { text-align: center; color: #866b48; }
.photo-placeholder span { display: block; font-size: 2.5rem; }
.photo-placeholder small { font-size: .78rem; }

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo.drink img {
  padding: 16px;
  object-fit: contain;
  background: #f9f5ee;
}

.card-content { display: flex; flex: 1; flex-direction: column; padding: 20px; }
.product-code { margin-bottom: 7px; color: #896632; font-size: .75rem; font-weight: 800; letter-spacing: 1px; }
.card h3 { margin-bottom: 11px; font-size: 1.15rem; line-height: 1.3; }
.description { color: var(--muted); font-size: .9rem; }

.prices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: auto 0 16px;
  padding-top: 8px;
}

.prices span { color: var(--muted); font-size: .82rem; }
.prices strong { display: block; color: var(--wine); font-size: 1.05rem; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--wine);
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.btn:hover { background: var(--wine-light); }
.btn.secondary { color: #513b2c; background: #eee5d8; }
.btn.whatsapp { background: var(--green); }
button:disabled { cursor: not-allowed; opacity: .5; }
.full { width: 100%; }
.space-top { margin-top: 16px; }
.space-bottom { margin-bottom: 16px; }

.empty {
  padding: 30px 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: var(--paper);
  text-align: center;
}

.legal { display: grid; gap: 12px; margin-top: 40px; }
.legal details { scroll-margin-top: 20px; }

footer { padding: 34px 16px 120px; color: var(--muted); font-size: .9rem; text-align: center; }
footer p { margin-bottom: 6px; }
footer strong { color: var(--wine); }

.cart-fab {
  position: fixed;
  right: 20px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 10;
  border-radius: 999px;
  box-shadow: 0 12px 35px #39101744;
}

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  padding-inline: 6px;
  border-radius: 50%;
  color: #422713;
  background: #e7c58b;
}

dialog {
  max-height: 92vh;
  max-height: 92dvh;
  padding: 0;
  border: 0;
  color: var(--text);
  background: var(--paper);
  box-shadow: 0 24px 80px #0005;
  overscroll-behavior: contain;
}

dialog::backdrop { background: #21120dbb; }
.product-dialog { width: min(560px, calc(100% - 24px)); border-radius: 24px; }

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: #fbf4e8;
}

.dialog-head h2 { margin: 0; color: var(--wine); font-size: 1.25rem; }
.dialog-content { padding: 20px; }

.icon-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--wine);
  background: white;
  font-size: 1.35rem;
}

.field { margin-bottom: 15px; }
.field label { display: block; margin-bottom: 6px; font-size: .92rem; font-weight: 750; }

input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px;
  border: 1px solid #cfbfa9;
  border-radius: 12px;
  color: var(--text);
  background: white;
  font-size: 16px;
}

input[readonly], textarea[readonly] { background: #f4f0e9; }
textarea { min-height: 84px; resize: vertical; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.helper { margin: 7px 0 0; color: var(--muted); font-size: .85rem; }
.helper.space-bottom { margin-bottom: 16px; }

.notice, .error, .delivery-result, .ready {
  padding: 13px 14px;
  border: 1px solid #e3d3b5;
  border-radius: 12px;
  color: #624b2d;
  background: #f6ecd9;
  font-size: .9rem;
}

.error, .delivery-result.fail {
  border-color: #e9bdc2;
  color: var(--danger);
  background: #fff0f1;
}

.delivery-result { margin: 12px 0 16px; }
.delivery-result.ok, .ready { border-color: #badcc4; color: var(--green); background: #edf8ef; }
.ready h3 { margin-bottom: 8px; }

.maps-credit { margin: 7px 0 0; color: #444; font-size: .8rem; }
.maps-credit span { white-space: nowrap; font-family: Arial, sans-serif; font-weight: 600; }

.check-label { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; }
.check-label input { flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px; margin-top: 3px; }

.product-total { display: flex; justify-content: space-between; gap: 12px; margin: 20px 0; color: var(--wine); font-size: 1.15rem; }

.cart-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(560px, 100%);
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0;
}

.cart-dialog .dialog-head { position: sticky; top: 0; z-index: 2; }
.cart-dialog .dialog-content { padding-bottom: calc(26px + env(safe-area-inset-bottom)); }

.cart-item { padding: 15px 0; border-bottom: 1px solid var(--line); }
.cart-item strong { display: block; }
.cart-item small { display: block; margin-top: 5px; color: var(--muted); }
.cart-item-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.quantity-controls { display: flex; align-items: center; gap: 9px; }

.quantity-controls button {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--wine);
  background: #f7efe4;
}

.remove { min-height: 40px; border: 0; color: var(--danger); background: transparent; text-decoration: underline; }
.checkout-title { margin: 26px 0 16px; color: var(--wine); font-size: 1.1rem; }
.summary { margin: 20px 0 14px; padding: 16px; border-radius: 16px; background: #f7efe3; }
.summary-row { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.summary-row.total { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid #dcccb5; color: var(--wine); font-size: 1.15rem; }
.message-box { min-height: 260px; margin-top: 12px; font-size: .9rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 95px;
  z-index: 15;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 14px;
  color: white;
  background: #263a2c;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1000px) {
  .hero { grid-template-columns: 180px 1fr; gap: 24px; }
  .items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 22px); }
  .hero { grid-template-columns: 1fr; margin-top: 11px; border-radius: 24px; }
  .logo { width: 160px; }
  .info-grid { grid-template-columns: 1fr; gap: 8px; }
  .info-box { padding: 13px 16px; }
  .items-grid { grid-template-columns: 1fr; }
  .controls { flex-direction: column; }
  .search { flex: auto; }
  .filters { display: grid; grid-template-columns: repeat(4, 1fr); }
  .filter { padding: 9px 5px; font-size: .84rem; }
  .card-content { padding: 18px; }
  .cart-fab { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .two-columns { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}