﻿/* ============================================================
   Components — quiet, image-led, minimal.
   The photography carries the colour; the interface stays out
   of its way. Saffron is an accent here, not a field.
   ============================================================ */

/* ------------------------------------------------ section head */

.eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--saffron-dark);
  direction: ltr;
  margin-bottom: 0.5rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.section-head h2 {
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--ink-faint);
  font-size: var(--text-sm);
  max-width: 46ch;
  margin-top: 0.2rem;
}

.section-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--forest);
  white-space: nowrap;
}

.section-link:hover { color: var(--saffron-dark); }

/* The brand's printed-menu motif, kept but quietened right down. */
.label-bar {
  display: inline-block;
  background: var(--forest);
  color: var(--saffron-soft);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  padding: 0.28em 0.85em 0.34em;
  border-radius: 6px;
  line-height: 1.5;
}

/* --------------------------------------------------- buttons */

.btn {
  --btn-bg: var(--forest);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 46px;
  padding: 0.6em 1.3em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-pill);
  transition: background-color 0.18s var(--ease), transform 0.14s var(--ease),
    opacity 0.18s var(--ease);
  text-align: center;
}

.btn:hover { color: var(--btn-fg); background: var(--forest-soft); }
.btn:active { transform: scale(0.98); }

.btn[disabled],
.btn[aria-disabled='true'] { opacity: 0.5; pointer-events: none; }

.btn--primary { --btn-bg: var(--saffron); --btn-fg: var(--forest-deep); }
.btn--primary:hover { background: var(--saffron-deep); }

.btn--whatsapp { --btn-bg: var(--whatsapp); --btn-fg: #fff; }
.btn--whatsapp:hover { background: var(--whatsapp-deep); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--forest);
  border: 1.5px solid var(--line);
}
.btn--ghost:hover { background: var(--cream-deep); color: var(--forest); }

.btn--soft {
  --btn-bg: var(--cream-deep);
  --btn-fg: var(--forest);
}
.btn--soft:hover { background: var(--line-soft); color: var(--forest); }

.btn--danger { --btn-bg: var(--danger); --btn-fg: #fff; }
.btn--sm { min-height: 36px; padding: 0.3em 0.9em; font-size: var(--text-xs); }
.btn--block { width: 100%; }

/* ----------------------------------------------------- cards */

.card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}

/* ------------------------------------------------- dish card */

/* Compact list row: square photo, then name, unit, price, add. */
.dish {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: var(--sp-3);
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: var(--sp-2);
  transition: border-color 0.2s var(--ease);
}

.dish:hover { border-color: var(--line); }
.dish--out { opacity: 0.55; }

/* Wrapper exists so the offer flag can be positioned over the photo. */
.dish__media {
  position: relative;
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
}

.dish__photo {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--cream-deep);
  flex: 0 0 auto;
}

.dish__offer {
  position: absolute;
  top: 4px;
  inset-inline-start: 4px;
  background: var(--terracotta);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.12em 0.45em;
  border-radius: 5px;
  line-height: 1.5;
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price__was {
  display: inline-block;
  margin-inline-start: 0.4em;
  font-size: 0.62em;
  font-weight: 500;
  color: var(--ink-faint);
  text-decoration: line-through;
}

.dish__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.dish__name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.dish__unit { font-size: var(--text-xs); color: var(--ink-faint); }

.dish__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: 4px;
  padding-inline-end: var(--sp-2);
}

.price {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--forest);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.price small { font-size: 0.62em; font-weight: 500; color: var(--ink-faint); margin-inline-start: 0.2em; }
.price--quote { font-size: var(--text-sm); font-weight: 600; color: var(--fresh-deep); }

/* Tall variant used on the home page, photo on top. */
.dish--tall {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.dish--tall .dish__media { width: 100%; height: 165px; }

.dish--tall .dish__photo {
  width: 100%;
  height: 165px;
  border-radius: 0;
}

.dish--tall .dish__body { padding: var(--sp-3); gap: 3px; }
.dish--tall .dish__foot { padding-inline-end: 0; margin-top: var(--sp-2); }

/* ------------------------------------------------- add button */

.add-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  flex: 0 0 auto;
  transition: background 0.18s var(--ease), transform 0.14s var(--ease-bounce);
}

.add-btn:hover { background: var(--saffron); color: var(--forest-deep); transform: scale(1.08); }

.qty {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--cream-deep);
  border-radius: var(--radius-pill);
  padding: 2px;
}

.qty button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 600;
  color: var(--forest);
  transition: background 0.15s var(--ease);
}

.qty button:hover { background: var(--paper); }
.qty button[disabled] { opacity: 0.3; pointer-events: none; }

.qty output {
  min-width: 2ch;
  text-align: center;
  font-weight: 700;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--forest);
}

/* -------------------------------------------- item detail sheet */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 720px) { .sheet { align-items: center; padding: var(--gutter); } }

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 28, 17, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in 0.2s var(--ease);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet__panel {
  position: relative;
  width: min(100%, 560px);
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--paper);
  /* Bottom sheet on phones, centred dialog from tablet up. */
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding-bottom: var(--safe-bottom);
  animation: sheet-up 0.3s var(--ease);
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 720px) {
  .sheet__panel { border-radius: var(--radius-xl); animation: sheet-in 0.24s var(--ease); }
}

@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }

.sheet__close {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 252, 247, 0.92);
  color: var(--ink);
  font-size: 0.95rem;
  backdrop-filter: blur(6px);
}

.sheet__close:hover { background: var(--paper); color: var(--danger); }

.sheet__photo {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--cream-deep);
  display: block;
}

.sheet__photo--empty { aspect-ratio: 3 / 1; }

.sheet__thumbs {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4) 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.sheet__thumbs::-webkit-scrollbar { display: none; }

.sheet__thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 2px solid transparent;
  transition: border-color 0.16s var(--ease), opacity 0.16s var(--ease);
  opacity: 0.65;
}

.sheet__thumb:hover { opacity: 1; }
.sheet__thumb.is-active { border-color: var(--forest); opacity: 1; }

.sheet__content { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }

.sheet__title { font-size: var(--text-xl); color: var(--ink); line-height: 1.3; }
.sheet__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.sheet__desc { color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.8; }
.sheet__desc--muted { color: var(--ink-faint); }

.sheet__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--line-soft);
}

.sheet__price .price { font-size: var(--text-xl); }

.sheet__actions { display: flex; align-items: center; gap: var(--sp-3); }
.sheet__actions .btn { flex: 1; }

.qty--lg button { width: 38px; height: 38px; font-size: 1.15rem; }
.qty--lg output { font-size: var(--text-md); }

/* Stops the page scrolling behind an open sheet. */
body.is-locked { overflow: hidden; }

/* Photo and title act as the "open details" affordance. */
.dish__photo,
.dish__name {
  cursor: pointer;
}

/* ------------------------------------------------------ tags */

.tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.15em 0.55em;
  border-radius: 5px;
  background: var(--cream-deep);
  color: var(--ink-soft);
  white-space: nowrap;
}

.tag--fresh { background: var(--fresh-mist); color: var(--fresh-deep); }
.tag--out { background: var(--danger-mist); color: var(--danger); }
.tag--offer { background: var(--terracotta); color: #fff; }

/* --------------------------------------------------- chips */

.chips {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-block: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.3em 0.95em;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1.5px solid var(--line-soft);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all 0.16s var(--ease);
  white-space: nowrap;
}

.chip:hover { border-color: var(--line); color: var(--ink); }

.chip[aria-pressed='true'] {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

/* ------------------------------------------------- header */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 252, 247, 0.9);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.header__inner {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.brand { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }

.brand__logo {
  width: 44px;
  height: 44px;
  max-height: calc(var(--header-h) - 16px);
  display: block;
  object-fit: contain;
}

.brand__name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--forest);
  letter-spacing: -0.01em;
}

.brand__sub {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  direction: ltr;
  font-weight: 600;
}

.nav-desktop { display: none; }

@media (min-width: 900px) {
  .nav-desktop { display: flex; align-items: center; gap: 0.25rem; }
  .nav-desktop a {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ink-faint);
    transition: color 0.16s var(--ease);
  }
  .nav-desktop a:hover { color: var(--forest); }
  .nav-desktop a[aria-current='page'] { color: var(--forest); background: var(--cream-deep); }
}

.header__cart {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cream-deep);
  color: var(--forest);
  transition: background 0.18s var(--ease);
}

.header__cart:hover { background: var(--saffron); color: var(--forest-deep); }

.cart-count {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  min-width: 19px;
  height: 19px;
  padding-inline: 5px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--forest);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 700;
  border: 2px solid var(--cream);
  font-variant-numeric: tabular-nums;
}

.cart-count.is-bumping { animation: bump 0.4s var(--ease-bounce); }

@keyframes bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* --------------------------------------------- bottom nav */

.bottom-nav {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 100;
  display: grid;
  /* One row whatever the destination count. A fixed `repeat(N, 1fr)` has to
     be kept in sync with the markup by hand, and the moment it falls behind —
     or the browser serves a cached copy of it — the grid silently wraps the
     extra link onto a second row. */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: rgba(255, 252, 247, 0.95);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line-soft);
  padding-bottom: var(--safe-bottom);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: var(--bottom-nav-h);
  /* Scales with the viewport so six labels stay on one line from 320px up. */
  font-size: clamp(0.5rem, 2.4vw, 0.64rem);
  font-weight: 600;
  color: var(--ink-faint);
  position: relative;
  /* Grid items default to min-width:auto, which lets the longest label push
     its track wider than an equal share and squeeze the others. */
  min-width: 0;
  white-space: nowrap;
  transition: color 0.16s var(--ease);
}

.bottom-nav a svg {
  width: clamp(18px, 5.4vw, 21px);
  height: clamp(18px, 5.4vw, 21px);
  flex: 0 0 auto;
}

.bottom-nav a[aria-current='page'] { color: var(--forest); }

.bottom-nav .nav-badge {
  position: absolute;
  top: 7px;
  inset-inline-end: calc(50% - 18px);
  min-width: 17px;
  height: 17px;
  padding-inline: 4px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--forest);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
}


@media (min-width: 900px) { .bottom-nav { display: none; } }

/* -------------------------------------------------- FAB */

.fab {
  position: fixed;
  inset-inline-end: 14px;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 14px);
  z-index: 90;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s var(--ease-bounce);
}

.fab:hover { transform: scale(1.07); color: #fff; }
.fab svg { width: 25px; height: 25px; }

/* ------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 0.35rem; }

.field label {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--ink);
}

.field label .req { color: var(--danger); }

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  /* 16px minimum stops iOS Safari zooming the viewport on focus. */
  font-size: max(16px, var(--text-sm));
  background: var(--paper);
  border: 1.5px solid var(--line-soft);
  border-radius: 10px;
  transition: border-color 0.16s var(--ease);
}

.field textarea { resize: vertical; min-height: 88px; line-height: 1.65; }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--forest);
}

.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'] { border-color: var(--danger); }

.field__hint { font-size: var(--text-xs); color: var(--ink-faint); }
.field__error { font-size: var(--text-xs); color: var(--danger); font-weight: 600; min-height: 1em; }

/* ------------------------------------------------ alerts */

.alert {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
  padding: var(--sp-3);
  border-radius: 10px;
  font-size: var(--text-sm);
  line-height: 1.65;
  background: var(--cream-deep);
  color: var(--ink-soft);
}

.alert__icon { flex: 0 0 auto; }
.alert--info { background: var(--saffron-mist); color: var(--saffron-dark); }
.alert--success { background: var(--success-mist); color: var(--success); }
.alert--error { background: var(--danger-mist); color: var(--danger); }
.alert--warn { background: var(--warning-mist); color: var(--warning); }

/* -------------------------------------------------- stars */

.stars { display: inline-flex; gap: 1px; color: var(--saffron); font-size: 0.85rem; line-height: 1; }
.stars--lg { font-size: 1.3rem; }
.stars .off { color: var(--line-soft); }

.star-input { display: inline-flex; flex-direction: row-reverse; gap: 3px; justify-content: flex-end; }
.star-input input { position: absolute; opacity: 0; width: 0; height: 0; }

.star-input label {
  font-size: 1.7rem;
  line-height: 1;
  color: var(--line);
  cursor: pointer;
  transition: color 0.14s var(--ease);
}

.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label { color: var(--saffron); }

.star-input input:focus-visible + label { outline: 2px solid var(--forest); outline-offset: 2px; }

/* ------------------------------------------------- toast */

.toast-host {
  position: fixed;
  inset-inline: 0;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 74px);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  pointer-events: none;
  padding-inline: var(--gutter);
}

.toast {
  max-width: 400px;
  width: fit-content;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--forest-deep);
  color: var(--cream);
  font-weight: 500;
  font-size: var(--text-sm);
  animation: toast-in 0.28s var(--ease);
}

.toast--error { background: var(--danger); }
.toast--success { background: var(--success); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.toast.is-leaving { animation: toast-out 0.22s var(--ease) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* --------------------------------------------- skeletons */

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--cream-deep) 25%, #fff8ec 50%, var(--cream-deep) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  min-height: 96px;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------ reveal on scroll */

/* Scoped under .js-reveal, added by the script only once the observer is
   live, so content is never stranded at opacity 0 when JS fails. */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* -------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--line-soft);
  padding-block: var(--sp-6) var(--sp-5);
  margin-top: var(--sp-7);
  font-size: var(--text-sm);
}

.footer h4 {
  font-size: var(--text-sm);
  color: var(--ink);
  margin-bottom: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 700;
}

.footer a { color: var(--ink-soft); }
.footer a:hover { color: var(--forest); }

.footer__grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
}

@media (min-width: 700px) { .footer__grid { grid-template-columns: 1.6fr 1fr 1fr; } }

.footer__bottom {
  margin-top: var(--sp-5);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.social-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); }

.social-row a {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream-deep);
  color: var(--ink-soft);
  transition: all 0.18s var(--ease);
}

.social-row a:hover { background: var(--forest); color: #fff; }
.social-row svg { width: 17px; height: 17px; }
