/* ==========================================================================
   Sections — signature, menu, place, branches, visit, footer.
   Mobile-first: these are the phone styles; wider screens live in responsive.css.
   ========================================================================== */

/* English visitors: keep the page hidden until i18n.js swaps the text (see boot.js) */
.i18n-pending body {
  visibility: hidden;
}

/* Mobile menu open: stop the page behind it from scrolling */
body.is-locked {
  overflow: hidden;
}

/* ---------- Shared section heading ---------- */
.section-head {
  display: grid;
  gap: var(--space-4);
  margin-block-end: var(--space-7);
  max-width: 40rem;
}

/* English titles are longer and use forced line breaks; 40rem is tuned for Arabic */
:lang(en) .section-head {
  max-width: 48rem;
}

.section-head--center {
  margin-inline: auto;
  justify-items: center;
  text-align: center;
}

.section-head__title {
  font-size: var(--fs-xl);
}

/* ==========================================================================
   Signature — three large photo cards that jump to a menu tab
   ========================================================================== */
.signature__grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  padding-block-end: var(--space-2);
}

.signature__grid::-webkit-scrollbar {
  display: none;
}
.signature__grid > li {
  scroll-snap-align: center;
}

.sig-card {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  color: var(--on-photo);
}

.sig-card__media {
  aspect-ratio: 3 / 4;
  --photo-shade: linear-gradient(180deg, rgb(18 11 8 / 0) 35%, rgb(18 11 8 / 0.92) 100%);
}

.sig-card__media img {
  transition: transform 1.4s var(--ease-out);
}
.sig-card:hover .sig-card__media img {
  transform: scale(1.06);
}

.sig-card__body {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: var(--z-base);
  display: grid;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-5);
}

.sig-card__num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-md);
  color: var(--kraft);
}

.sig-card__title {
  font-size: var(--fs-lg);
}
.sig-card .link-arrow {
  color: var(--kraft-light);
}

/* ==========================================================================
   Menu — styled like a printed menu card: double gold frame, centered
   category titles, dotted leaders and gold prices
   ========================================================================== */
.menu-book {
  position: relative;
  max-width: 68rem;
  margin-inline: auto;
  padding: var(--space-6) var(--space-4) var(--space-7);
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  isolation: isolate;
}

/* Inner hairline — the second line of the printed double frame */
.menu-book::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: 3px;
  pointer-events: none;
}

.menu-book__fallback {
  max-width: 34rem;
  margin-inline: auto;
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
}

.menu-book__fallback a {
  color: var(--accent);
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---------- Tabs ---------- */
.menu-tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  padding-block-end: var(--space-2);
  margin-block-end: var(--space-6);
  border-block-end: 1px solid var(--line);
  /* soft fade at both edges hints that the row scrolls on phones */
  mask-image: linear-gradient(90deg, transparent 0, #000 1.25rem, #000 calc(100% - 1.25rem), transparent 100%);
}

.menu-tabs::-webkit-scrollbar {
  display: none;
}

/* Auto margins center the row when every tab fits; when it overflows they collapse to 0, so the first tab starts at the inline-start edge and is never clipped */
.menu-tabs > :first-child {
  margin-inline-start: auto;
}
.menu-tabs > :last-child {
  margin-inline-end: auto;
}

.menu-tab {
  position: relative;
  flex-shrink: 0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--dur-fast);
}

.menu-tab::after {
  content: "";
  position: absolute;
  inset-inline: var(--space-4);
  inset-block-end: calc(var(--space-2) * -1 - 1px);
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--dur) var(--ease-out);
}

.menu-tab:hover {
  color: var(--text);
}
.menu-tab[aria-selected="true"] {
  color: var(--accent);
  font-weight: 600;
}
.menu-tab[aria-selected="true"]::after {
  transform: scaleX(1);
}

.menu-tab__count {
  margin-inline-start: 0.3em;
  font-size: 0.65em;
  color: var(--text-faint);
}

/* ---------- Panel ---------- */
.menu-panel:focus-visible {
  outline-offset: 8px;
}
.menu-panel.is-entering {
  animation: menu-enter var(--dur-slow) var(--ease-out);
}

.menu-panel__head {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  margin-block-end: var(--space-6);
  text-align: center;
}

.menu-panel__title {
  font-size: var(--fs-xl);
}

.menu-panel__meta {
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.menu-list {
  display: grid;
  column-gap: var(--space-8);
}

.menu-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-block-end: 1px solid var(--line);
  break-inside: avoid;
}

.menu-item__names {
  display: grid;
  min-width: 0;
}

.menu-item__name {
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.5;
}

.menu-item__alt {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  line-height: 1.5;
}

.menu-item__alt:lang(en) {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

/* Dotted line between name and price, like a printed menu */
.menu-item__leader {
  flex: 1;
  min-width: var(--space-4);
  border-block-end: 1px dotted var(--line-strong);
  transform: translateY(-0.35em);
}

.menu-item__price {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  direction: ltr;
}

.menu-item__slash {
  color: var(--text-faint);
  font-size: 0.85em;
}

/* "New" badge and the ingredients line, shared by every item that has them */
.menu-item__badge {
  justify-self: start;
  margin-block-end: var(--space-1);
  padding: 0.15em 0.7em;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--bg);
  background: var(--accent);
  border-radius: var(--radius-pill);
}

/* Outlined, so "Bestseller" does not read like the filled "New" badge */
.menu-item__badge--best {
  position: absolute; /* out of flow: a badge in flow would take over the row's baseline and push the price off the name's line */
  inset-block-start: 0;
  inset-inline-start: 0;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
}

/* Room above the name for the badge, only in rows that have one */
.menu-item__names:has(> .menu-item__badge--best) {
  position: relative;
  padding-block-start: 1.75rem;
}

.menu-item__desc {
  margin-block-start: var(--space-1);
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--text-muted);
}

/* ---------- Summer showcase: photo cards in a grid ---------- */
.menu-list.menu-list--cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-4);
}

.menu-item--card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.menu-item__media {
  margin: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
}

.menu-item__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.menu-item--card .menu-item__price {
  justify-self: start;
}

@keyframes menu-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   The Place — intro, stats and a horizontal gallery
   ========================================================================== */
.place__head {
  display: grid;
  gap: var(--space-7);
  margin-block-end: var(--space-7);
}

.place__head .section-head {
  margin-block-end: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
}

.stats__item {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-3);
  text-align: center;
}

.stats__item + .stats__item {
  border-inline-start: 1px solid var(--line);
}

.stats__value {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 500;
  line-height: 1;
  color: var(--accent);
}

.stats dd {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.gallery__track {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* first photo lines up with the container edge, the rest bleed off-screen */
  padding-inline: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
}

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

.gallery__item {
  flex: 0 0 clamp(15rem, 68vw, 22rem);
  scroll-snap-align: start;
}

.gallery__item figure {
  display: grid;
  gap: var(--space-3);
}

.gallery__photo {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  --photo-shade: linear-gradient(180deg, rgb(18 11 8 / 0) 70%, rgb(18 11 8 / 0.35) 100%);
}

/* The arch — Bellissimo's brand motif */
.gallery__item--arch .gallery__photo {
  border-radius: var(--radius-arch);
}

.gallery__item figcaption {
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.gallery__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.gallery__controls {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-block-start: var(--space-5);
}

/* The chevron points "forward" in the reading direction */
.gallery__btn[data-gallery-prev] svg {
  transform: scaleX(-1);
}
[dir="rtl"] .gallery__btn[data-gallery-prev] svg {
  transform: none;
}
[dir="rtl"] .gallery__btn[data-gallery-next] svg {
  transform: scaleX(-1);
}

/* ==========================================================================
   Branches — cards from data, or an elegant Instagram fallback
   ========================================================================== */
/* minmax(0, 1fr) keeps a long child from widening the track past the container */
.branches__list {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr);
}

.cities {
  max-width: 44rem;
  width: 100%;
  margin-inline: auto;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.city-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  text-align: center;
}

.city-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-chip svg {
  width: 1rem;
  height: 1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.branches__cards {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr);
}

.branches__cards:empty {
  display: none;
}

.branch-empty {
  max-width: 34rem;
  margin-inline: auto;
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  padding: var(--space-7) var(--space-5);
  text-align: center;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-arch);
  border-end-start-radius: var(--radius-lg);
  border-end-end-radius: var(--radius-lg);
}

.branch-empty__arch {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 5.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-arch);
  color: var(--accent);
}

.branch-empty__arch svg {
  width: 1.6rem;
  height: 1.6rem;
}
.branch-empty__title {
  font-size: var(--fs-lg);
}
.branch-empty__text {
  color: var(--text-muted);
  max-width: 30ch;
  margin-block-end: var(--space-3);
}

.branch-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition:
    border-color var(--dur-fast),
    transform var(--dur) var(--ease-out);
}

.branch-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}
.branch-card__title {
  font-size: var(--fs-lg);
}

.branch-card__row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.branch-card__row svg {
  width: 1.1rem;
  height: 1.1rem;
  margin-block-start: 0.2rem;
  color: var(--accent);
  flex-shrink: 0;
}
.branch-card .link-arrow {
  margin-block-start: var(--space-2);
}

/* ---------- Pointer tilt + glare (tilt.js adds .tilt-ready on fine pointers only) ---------- */
.tilt-ready .menu-item--card,
.tilt-ready .branch-card {
  position: relative;
}

.tilt-ready .menu-item--card {
  transition: transform var(--dur) var(--ease-out);
}

/* Branch cards are faded in by reveal.js first; only after that does tilt own the transition */
.tilt-ready .branch-card.is-visible {
  transition:
    transform var(--dur) var(--ease-out),
    border-color var(--dur-fast);
  transition-delay: 0ms;
}

.tilt-ready .menu-item--card.is-tilting {
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

/* The hover lift is folded into the tilt so the card does not jump when the pointer enters */
.tilt-ready .branch-card.is-tilting {
  transform: perspective(900px) translateY(-3px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.tilt-ready .menu-item--card::after,
.tilt-ready .branch-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none; /* the add (+) button underneath must stay clickable */
  background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), var(--glare), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
}

.tilt-ready .menu-item--card.is-tilting::after,
.tilt-ready .branch-card.is-tilting::after {
  opacity: 1;
}

/* ==========================================================================
   Visit / Order — full-bleed closing scene
   ========================================================================== */
.visit {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding-block: var(--section-pad);
  color: var(--on-photo);
  overflow: hidden;
  isolation: isolate;
}

.visit__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  --photo-shade:
    radial-gradient(ellipse at center, rgb(18 11 8 / 0.35) 0%, rgb(18 11 8 / 0.85) 75%),
    linear-gradient(180deg, var(--bg) 0%, rgb(18 11 8 / 0) 22%, rgb(18 11 8 / 0) 78%, var(--bg-raised) 100%);
}

.visit__content {
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  text-align: center;
}

.visit .eyebrow {
  color: var(--kraft);
}
.visit__mark {
  width: 2.8rem;
  height: 2.8rem;
  color: var(--mark);
  fill: currentColor;
  margin-block-end: var(--space-3);
}
.visit__title {
  font-size: var(--fs-2xl);
}
.visit__text {
  color: var(--on-photo-muted);
  font-size: var(--fs-md);
  max-width: 34ch;
}

.visit__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-block-start: var(--space-5);
}

.visit__number {
  padding-inline-start: var(--space-3);
  border-inline-start: 1px solid rgb(244 238 230 / 0.3);
  font-weight: 300;
  opacity: 0.85;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-raised);
  border-block-start: 1px solid var(--line);
  padding-block: var(--space-8) var(--space-6);
}

.site-footer__inner {
  display: grid;
  gap: var(--space-6);
  justify-items: center;
  text-align: center;
}

.site-footer__brand {
  display: grid;
  gap: var(--space-3);
  justify-items: center;
}
.site-footer .brand__mark {
  color: var(--mark);
}
.site-footer__tagline {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3) var(--space-6);
  font-size: var(--fs-sm);
}

.site-footer__nav a {
  color: var(--text-muted);
  transition: color var(--dur-fast);
}
.site-footer__nav a:hover {
  color: var(--accent);
}

.site-footer__bottom {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  margin-block-start: var(--space-7);
  padding-block-end: var(--space-8); /* room for the floating WhatsApp button */
  padding-block-start: var(--space-5);
  border-block-start: 1px solid var(--line);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-faint);
}
.site-footer__credit {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.site-footer__credit-name {
  font-weight: 500;
  color: var(--text);
}

@media (min-width: 768px) {
  .site-footer__bottom {
    grid-template-columns: auto auto;
    justify-content: space-between;
    align-items: baseline;
    text-align: start;
  }
}
