:root {
  --cream: #F7F1E6;
  --espresso: #3E2A1F;
  --leaf: #5E7B4F;
  --lantern: #E0A24A;
  --lantern-dark: #C98A33;
  --danger: #A63A2B;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
img, svg, video { max-width: 100%; }
img { height: auto; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--lantern);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- Navigation ---------- */
.nav-link {
  padding: 0.5rem 0.875rem;
  border-radius: 0.75rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: rgba(62, 42, 31, 0.85);
  transition: background-color 150ms, color 150ms;
}
.nav-link:hover { background: rgba(62, 42, 31, 0.06); color: var(--espresso); }

.mobile-nav { display: none; }
.mobile-nav.is-open { display: block; }
.mobile-link {
  padding: 0.85rem 0.5rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(62, 42, 31, 0.08);
  transition: color 150ms;
}
.mobile-link:last-child { border-bottom: 0; }
.mobile-link:hover { color: var(--leaf); }

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 150ms, transform 150ms, box-shadow 150ms, border-color 150ms;
  cursor: pointer;
}
.btn-primary {
  background: var(--lantern);
  color: var(--espresso);
  box-shadow: 0 6px 18px -8px rgba(224, 162, 74, 0.9);
}
.btn-primary:hover { background: var(--lantern-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--espresso);
  border: 1.5px solid rgba(62, 42, 31, 0.25);
}
.btn-secondary:hover { border-color: var(--espresso); background: rgba(62, 42, 31, 0.04); }
.btn-secondary:active { transform: translateY(1px); }
.btn-lg { padding: 0.9rem 1.75rem; font-size: 1rem; }

.spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(62, 42, 31, 0.3);
  border-top-color: var(--espresso);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards / content ---------- */
.card {
  background: #fff;
  border: 1px solid rgba(62, 42, 31, 0.08);
  border-radius: 1.5rem;
  padding: 1.75rem;
  box-shadow: 0 10px 30px -18px rgba(62, 42, 31, 0.35);
}
@media (min-width: 768px) { .card { padding: 2rem; } }

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--leaf);
  margin-bottom: 0.75rem;
}
.icon-chip {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(94, 123, 79, 0.12);
  color: var(--leaf);
}
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
}
.price {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.15rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hours-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: var(--cream);
  transition: background-color 200ms;
}
.hours-row.is-today {
  background: rgba(224, 162, 74, 0.18);
  box-shadow: inset 0 0 0 1.5px rgba(224, 162, 74, 0.7);
}
.check-dot {
  flex: none;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(224, 162, 74, 0.2);
  color: var(--lantern);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------- Map placeholder ---------- */
.map-block {
  position: relative;
  height: 100%;
  min-height: 280px;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(62, 42, 31, 0.08);
  box-shadow: 0 10px 30px -18px rgba(62, 42, 31, 0.35);
}
.map-block > svg { position: absolute; inset: 0; height: 100%; }
.map-pin {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -85%);
  filter: drop-shadow(0 8px 10px rgba(62, 42, 31, 0.3));
}
.map-pin svg { position: relative; display: block; }
.map-pulse {
  position: absolute;
  left: 50%; bottom: -6px;
  width: 22px; height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: rgba(224, 162, 74, 0.5);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(3); opacity: 0; }
}

/* ---------- Forms ---------- */
.form-card {
  background: rgba(247, 241, 230, 0.06);
  border: 1px solid rgba(247, 241, 230, 0.15);
  border-radius: 1.5rem;
  padding: 1.5rem;
}
@media (min-width: 640px) { .form-card { padding: 2rem; } }
.form-card--light {
  background: #fff;
  border-color: rgba(62, 42, 31, 0.08);
  box-shadow: 0 10px 30px -18px rgba(62, 42, 31, 0.35);
}

.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field label { font-weight: 500; font-size: 0.95rem; }
.req { color: var(--lantern); margin-left: 2px; }
.field input, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.95rem;
  border-radius: 0.875rem;
  border: 1.5px solid rgba(62, 42, 31, 0.18);
  background: #fff;
  color: var(--espresso);
  font: inherit;
  transition: border-color 150ms, box-shadow 150ms;
}
.field textarea { resize: vertical; }
.field input:hover, .field textarea:hover { border-color: rgba(62, 42, 31, 0.35); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--leaf);
  box-shadow: 0 0 0 4px rgba(94, 123, 79, 0.2);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(166, 58, 43, 0.15);
}
.field-hint { font-size: 0.85rem; line-height: 1.4; opacity: 0.8; }
.field-error {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--danger);
  font-weight: 500;
}
.field-error::before { content: "⚠ "; }

/* Dark form (reserve section) */
#reserve .field label { color: var(--cream); }
#reserve .field-hint { color: rgba(247, 241, 230, 0.8); opacity: 1; }
#reserve .field-error { color: #FFB4A6; }

.success-box {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  background: rgba(94, 123, 79, 0.28);
  border: 1px solid rgba(160, 200, 140, 0.5);
  color: var(--cream);
  line-height: 1.6;
  animation: fadeUp 300ms ease-out;
}
.success-box--light {
  background: rgba(94, 123, 79, 0.1);
  border-color: rgba(94, 123, 79, 0.35);
  color: var(--espresso);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Toasts ---------- */
.toast-region {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1.1rem;
  border-radius: 1rem;
  background: var(--espresso);
  color: var(--cream);
  box-shadow: 0 18px 40px -16px rgba(62, 42, 31, 0.6);
  line-height: 1.5;
  font-size: 0.95rem;
  animation: fadeUp 250ms ease-out;
  transition: opacity 250ms, transform 250ms;
}
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
.toast-icon {
  flex: none;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.toast--success .toast-icon { background: var(--leaf); color: #fff; }
.toast--error .toast-icon { background: var(--danger); color: #fff; }

/* ---------- Owner dashboard ---------- */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--cream);
}
.tab {
  min-height: 42px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(62, 42, 31, 0.75);
  transition: background-color 150ms, color 150ms;
}
.tab:hover { color: var(--espresso); }
.tab.is-active { background: #fff; color: var(--espresso); box-shadow: 0 2px 8px -3px rgba(62, 42, 31, 0.3); }

.res-day h3 { font-weight: 600; margin-bottom: 0.5rem; }
.res-row {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid rgba(62, 42, 31, 0.08);
  border-radius: 1rem;
}
.res-row + .res-row { margin-top: 0.5rem; }
.res-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.res-party {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(94, 123, 79, 0.12);
  color: var(--leaf);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .res-row { grid-template-columns: 1fr auto; }
  .res-time { grid-column: 1 / -1; }
}

.cat-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 1.15rem;
  background: #fff;
  border: 1px solid rgba(62, 42, 31, 0.08);
  border-radius: 1.15rem;
  transition: opacity 200ms, background-color 200ms;
}
.cat-item.is-done { opacity: 0.6; background: rgba(255, 255, 255, 0.55); }
.cat-item.is-done .cat-title { text-decoration: line-through; text-decoration-color: rgba(62, 42, 31, 0.5); }
.cat-body { min-width: 0; flex: 1; }
.cat-message { white-space: pre-wrap; overflow-wrap: anywhere; }

.done-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.5rem 0 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
}
.done-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.done-box {
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 2px solid rgba(62, 42, 31, 0.3);
  display: grid; place-items: center;
  background: #fff;
  transition: background-color 150ms, border-color 150ms, transform 150ms;
}
.done-box svg { opacity: 0; transform: scale(0.5); transition: opacity 150ms, transform 150ms; }
.done-toggle:hover .done-box { border-color: var(--leaf); }
.done-toggle input:checked + .done-box { background: var(--leaf); border-color: var(--leaf); }
.done-toggle input:checked + .done-box svg { opacity: 1; transform: scale(1); }
.done-toggle input:focus-visible + .done-box { outline: 3px solid var(--lantern); outline-offset: 2px; }
.done-toggle:active .done-box { transform: scale(0.92); }

.empty-state {
  padding: 2rem 1.25rem;
  text-align: center;
  border: 1.5px dashed rgba(62, 42, 31, 0.2);
  border-radius: 1.15rem;
  color: rgba(62, 42, 31, 0.75);
}
.skeleton {
  height: 64px;
  border-radius: 1rem;
  background: linear-gradient(90deg, rgba(62,42,31,0.06), rgba(62,42,31,0.12), rgba(62,42,31,0.06));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skeleton + .skeleton { margin-top: 0.5rem; }
@keyframes shimmer { to { background-position: -200% 0; } }

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