/* ============================================================================
   CAFE MODERN — a warm, editorial café look layered over the Bistro theme.

   Loaded AFTER theme.css and the merchant accent (see layout/theme.liquid), so
   it only has to re-point the design tokens and refine a handful of surfaces.
   Delete the <link> to this file in layout/theme.liquid to go back to the
   original look instantly.

   Palette   oat paper · latte surfaces · espresso ink · terracotta accent
   Type      Fraunces (soft editorial serif) for headings,
             DM Sans for everything you read or tap
   Shape     big soft radii, pill buttons, quiet warm shadows

   Arabic / RTL pages keep their own Cairo + Tajawal faces and get no letter
   spacing (tracking breaks Arabic joins) — every type rule below is scoped
   with :root:not([dir="rtl"]) for that reason.
   ========================================================================== */

:root {
  /* Neutrals — oat, latte and espresso */
  --ink: #2b1d16;
  --ink-soft: #54443a;
  --muted: #7a6a5d;
  --paper: #f7f1e8;
  --surface: #fffdf9;
  --surface-2: #efe6d8;
  --surface-3: #e4d8c5;
  --line: #e6dccb;
  --line-2: #d4c5ac;

  /* Dark blocks: footer, header band */
  --dark: #231712;
  --dark-2: #31211a;
  --on-dark: #f6eee2;
  --on-dark-muted: #bba997;

  --danger: #b0372b;
  --success: #3d7a4f;

  /* Shape */
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 30px;

  /* Warm, low-contrast shadows */
  --shadow-sm: 0 1px 2px rgba(43, 29, 22, 0.05), 0 2px 8px -2px rgba(43, 29, 22, 0.06);
  --shadow: 0 14px 34px -16px rgba(43, 29, 22, 0.28), 0 3px 8px -3px rgba(43, 29, 22, 0.08);
  --shadow-lg: 0 34px 64px -30px rgba(43, 29, 22, 0.38), 0 12px 24px -14px rgba(43, 29, 22, 0.16);
  --scrim-warm: linear-gradient(180deg, rgba(35, 23, 18, 0) 45%, rgba(35, 23, 18, 0.5) 82%, rgba(35, 23, 18, 0.82) 100%);

  --maxw: 78rem;
}

/* ---- Type (Latin pages only) ---------------------------------------------- */
:root:not([dir="rtl"]) {
  --font-display: "DM Sans", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: "DM Sans", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

:root:not([dir="rtl"]) :is(h1, h2, h3, h4),
:root:not([dir="rtl"]) :is(.brand__text, .cover__title, .section__title, .menu-section__title, .listing__title,
  .account-page__title, .auth-card__title, .dish__title, .qty-offer-card__title, .order-card__title,
  .cart-bar__title, .stories__title, .story-view__title, .meal-side__title, .footer__brand) {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
}

:root:not([dir="rtl"]) h1 { font-weight: 500; letter-spacing: -0.03em; }

:root:not([dir="rtl"]) h2 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.9rem); line-height: 1.08; }

:root:not([dir="rtl"]) h3 { font-size: 1.3rem; }

/* The wordmark: an italic serif, with the brand word picked out in the accent */
:root:not([dir="rtl"]) .brand__text { font-size: 1.5rem; font-weight: 600; font-style: italic; letter-spacing: -0.02em; }

body { background: var(--paper); }

::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

/* ---- Buttons: soft pills ---------------------------------------------------- */
body .btn {
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.005em;
  padding: 0.9rem 1.7rem;
}

body .btn--sm { padding: 0.55rem 1.15rem; }

body .btn--lg { padding: 1.05rem 2.3rem; font-size: 1.02rem; }

body .btn--primary {
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--accent-ink) 80%, transparent);
}

body .btn--primary:hover { box-shadow: 0 14px 26px -12px color-mix(in srgb, var(--accent-ink) 85%, transparent); }

body .btn--ghost { --btn-bd: var(--ink); --btn-fg: var(--ink); }

body .btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--paper); }

body .btn--dark { --btn-bg: var(--dark); }

/* ---- Top strip + hours bar -------------------------------------------------- */
body .topbar { background: var(--paper); border-bottom: 1px solid var(--line); }

body .subbar { background: var(--surface-2); border-bottom: 0; }

body .subbar__hours { color: var(--ink-soft); font-weight: 600; }

body .subbar__hours .sep { color: var(--accent); }

:root:not([dir="rtl"]) .subbar { letter-spacing: 0.14em; font-size: 0.7rem; }

/* ---- Header ----------------------------------------------------------------- */
body .site-header { background: var(--paper); border-bottom: 1px solid var(--line); }

:root:not([dir="rtl"]) .nav__link {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body .nav__link::after { height: 2px; bottom: -2px; }

/* The stacked header's accent band becomes an espresso bar with a terracotta rule */
@media (min-width: 60.01rem) {
  body .hdr-band {
    background: var(--dark);
    color: var(--on-dark);
    border-bottom: 3px solid var(--accent);
  }

  body .hdr-band__brand {
    background: var(--paper);
    border-radius: var(--radius-lg);
  }

  body .hdr-search__input { background: var(--paper); }

  body .hdr-navrow { background: var(--paper); border-bottom: 1px solid var(--line); }

  body .hdr-phone__num { font-weight: 700; }
}

body .hdr-svc { background: var(--surface); }

body .service-tab { background: var(--paper); }

body .service-tab.is-active { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }

/* ---- Hero ------------------------------------------------------------------- */
body .cover {
  min-height: clamp(32rem, 84svh, 56rem);
  padding-block: clamp(4rem, 10vw, 8rem);
}

/* One warm gradient instead of a flat tint: lighter through the middle so the
   photo breathes, darker at the foot where the buttons and the next section meet */
body .cover__overlay {
  background: linear-gradient(180deg, rgba(35, 23, 18, 0.5) 0%, rgba(35, 23, 18, 0.3) 42%, rgba(35, 23, 18, 0.78) 100%);
  opacity: 1;
}

:root:not([dir="rtl"]) .cover__title {
  max-width: 14ch;
  font-size: clamp(2.7rem, 1.2rem + 6vw, 6rem);
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

:root:not([dir="rtl"]) .cover__title em {
  font-style: italic;
  font-weight: 500;
  color: color-mix(in srgb, var(--accent) 42%, #fff1df);
}

body .cover__sub {
  max-width: 46ch;
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.25rem);
  line-height: 1.65;
  opacity: 0.94;
}

body .cover__cta { gap: 0.9rem; margin-top: 2.25rem; }

body .cover .btn--light { --btn-bg: var(--paper); --btn-fg: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  @keyframes cafe-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
  }

  .cover__inner > * { animation: cafe-rise 0.9s var(--ease) both; }

  .cover__inner > :nth-child(2) { animation-delay: 0.12s; }

  .cover__inner > :nth-child(3) { animation-delay: 0.24s; }
}

/* ---- Sections --------------------------------------------------------------- */
body .section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }

body .section--tint { background: var(--surface-2); }

body .menu-rail {
  background: var(--paper);
  border-color: var(--line);
}

/* ---- Menu / dish cards ------------------------------------------------------ */
body .dish {
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(43, 29, 22, 0.04), 0 14px 32px -22px rgba(43, 29, 22, 0.4);
}

body .dish__media {
  aspect-ratio: 1 / 1;
  margin-bottom: 0.9rem;
}

body .dish__img { transition: transform 0.7s var(--ease); }

body .dish__text { padding-inline: calc(var(--dish-pad) + 0.15rem); }

:root:not([dir="rtl"]) .dish__title { font-size: 1.15rem; font-weight: 600; }

body .dish__desc { font-size: 0.88rem; line-height: 1.55; }

body .dish__actions { padding-inline: calc(var(--dish-pad) + 0.15rem); }

/* The price: a cream pill resting on the photograph, not a dark token */
body .dish__badge {
  background: rgba(255, 253, 249, 0.94);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 4px 14px -6px rgba(43, 29, 22, 0.35);
}

@media (hover: hover) and (min-width: 48.01rem) {
  body .dish:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
  }

  body .dish:hover .dish__img { transform: scale(1.06); }
}

body .dish__ribbon { background: var(--accent-ink); }

/* Cards from the retail side of the theme (shop, search, collections) */
body .product-card,
body .card { border-radius: var(--radius) !important; }

/* ---- Chips, switchers, popovers --------------------------------------------- */
body .switcher > summary { background: var(--surface); }

body .popover,
body .nav__submenu { border-radius: var(--radius); border-color: var(--line); }

/* ---- Forms ------------------------------------------------------------------ */
body .input,
body .select,
body .textarea { background: var(--surface); border-color: var(--line-2); }

body .search-field .input { background: var(--surface); }

/* ---- Cart and order screens --------------------------------------------------- */
:is(.cart-page, .thanks-page) .order-card,
.order-summary,
.account-card,
.auth-card { border-radius: 24px; border-color: var(--line); }

.cart-page,
.thanks-page { --cart-tint: var(--surface-2); }

/* ---- Footer ------------------------------------------------------------------ */
body .site-footer {
  background: var(--dark);
  border-radius: 40px 40px 0 0;
  padding-top: 1rem;
}

body .footer__brand { border-radius: var(--radius-lg); box-shadow: var(--shadow); }

:root:not([dir="rtl"]) .site-footer :is(h2, h3, h4) { color: var(--on-dark); font-weight: 500; }

:root:not([dir="rtl"]) .footer__nav {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body .footer__hours { color: var(--on-dark); }

body .footer__social a { border-color: rgba(246, 238, 226, 0.3); }

body .footer__social a:hover { background: var(--accent); border-color: var(--accent); }

/* ---- Small details ----------------------------------------------------------- */
body .story__ring { background: conic-gradient(from 210deg, var(--accent), #d9a441, var(--accent)); }

body .badge--open { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); }

body .qty-offer-card { border-radius: 20px; }

/* ---- Category cards (home "View Our Menu", menu categories) ------------------ */
body .cat-card {
  border-radius: 28px;
  background: var(--surface-3);
  box-shadow: 0 18px 36px -24px rgba(43, 29, 22, 0.5);
}

body .cat-card__img { transition: transform 0.8s var(--ease); }

body .cat-card__title {
  padding: 3.5rem 1.2rem 1.25rem;
  background: linear-gradient(180deg, transparent, rgba(35, 23, 18, 0.84));
}

:root:not([dir="rtl"]) .cat-card__title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

@media (hover: hover) {
  body .cat-card:hover .cat-card__img { transform: scale(1.07); }
}

/* ---- Menu page: section headings, view toggle, order panel -------------------- */
:root:not([dir="rtl"]) .menu-section__title { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); }

/* A short terracotta rule under each menu heading */
body .menu-section__title::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin: 0.85rem auto 0;
  border-radius: 3px;
  background: var(--accent);
}

body .view-toggle { background: var(--surface); border-color: var(--line); }

body .order-card { border-radius: 24px; border-color: var(--line); box-shadow: var(--shadow-sm); }

body .order-bar { border-radius: 22px; }

/* ---- Category / collection / search listing pages ----------------------------- */
body .listing-card { border-radius: 24px; border-color: var(--line); background: var(--surface); }

body .listing-card__link { border-radius: 14px; }

body .listing__empty--box { border-radius: 24px; }

:root:not([dir="rtl"]) .listing__title { font-size: clamp(2rem, 1.3rem + 2.4vw, 3.2rem); line-height: 1.05; }

/* Phones: slightly tighter radii so cards don't feel bubbly at 2-up */
@media (max-width: 48rem) {
  body .dish { border-radius: 18px; }

  body .site-footer { border-radius: 28px 28px 0 0; }

  body .cover { min-height: clamp(28rem, 78svh, 40rem); }

  :root:not([dir="rtl"]) .cover__title { max-width: 12ch; }

  body .cat-card { border-radius: 20px; }

  body .cat-card__title { padding: 1.8rem 0.8rem 0.75rem; }

  :root:not([dir="rtl"]) .cat-card__title { font-size: 0.98rem; }
}
