/* Minimal global styles for the default theme. Sections inline most of their
   own layout to keep the demo self-contained. */
@import url('fonts/google/fonts-local.css');

* {
  font-family: var(--font-body);
  box-sizing: border-box;
}

:root {
  color: #111;
  line-height: 1.5;
  --font-body: "Poppins", "Segoe UI", Tahoma, Georgia, "Times New Roman", serif;
  --font-display: "Poppins", "Segoe UI", Tahoma, Georgia, "Times New Roman", serif;
  --adi-black: #000000;
  --adi-white: #ffffff;
  --adi-gray-100: #f5f5f5;
  --adi-gray-200: #e5e5e5;
  --adi-gray-500: #767677;
  --adi-red: #e4002b;
}

/* ---- Restaurant display type system ----------------------------------
   Elegant serif type (title case, generous tracking) throughout the
   theme — headings, body copy, and buttons alike — replacing the old
   bold-condensed-uppercase sports-retail system. Matches the Deliciko
   reference. --font-body (used almost everywhere via the `*` rule
   above and each section's own text rules) and --font-display (used
   here for headings specifically) currently point at the same font;
   change either independently in the :root block above if headings
   and body text should ever diverge again. El Messiri covers Arabic
   natively, so it's used for RTL content too (see the [dir="rtl"]
   rule below) — no separate Arabic-only font is needed anymore. */
h1,
h2,
h3,
h4,
.heading,
.section-title,
.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

button,
.btn,
[class*="btn-"],
[class$="__cta"],
[class*="add-to-cart"],
input[type="submit"] {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.02em;
}

html {
  /* overflow-x: hidden here would implicitly force overflow-y to compute
     as "auto" (per spec, an axis set to a non-visible value forces the
     other to auto if it was visible), turning <html> into a scroll
     container. That breaks position: sticky for every descendant on the
     page (the menu page's sticky sidebar/section nav included), since a
     sticky element sticks to its nearest scrolling ancestor, not
     necessarily the viewport anymore. overflow-x: clip prevents the same
     horizontal overflow without creating that scroll container. */
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  max-width: 100%;
}

.container {
  max-width: 82rem;
  margin: 0 auto;
  padding: 0 1rem;
}

a {
  color: inherit;
}

/* RTL — grid + flexbox mirror automatically. Body text alignment is
   the one detail the user always notices, so set it here. */
[dir="rtl"] body {
  text-align: right;
  font-family: Poppins, sans-serif;
}

/* ---- Directional icon mirroring -------------------------------------
   Any arrow/chevron glyph that encodes a left-right direction (view-all
   arrows, continue/checkout arrows, carousel prev/next controls, picker
   chevrons, etc.) should point the opposite way in Arabic/RTL layouts.
   Add class="icon-flip-rtl" to the <svg> itself — not to icons that
   aren't inherently directional (cart, user, pin, search, up/down
   carets used purely for open/close state). */
[dir="rtl"] .icon-flip-rtl {
  transform: scaleX(-1);
}

/* ---- Cart badge bump ------------------------------------------------------
   Brief pulse on the header cart icon right after a successful add, played
   from theme.js alongside opening the cart drawer (see
   ".js-add-to-cart-form" handler there). */

.cart-link.cx-cart-bump {
  animation: cxCartBump 0.4s ease;
}

@keyframes cxCartBump {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.28);
  }

  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cart-link.cx-cart-bump {
    animation: none !important;
    transition: none !important;
  }
}

/* ===================================================================
   Shared flash alert — same look as the server-rendered flash in
   layout/theme.liquid (centered card, dimmed backdrop, icon, OK
   button), but built here as reusable classes so any script can
   trigger the same popup client-side (e.g. geolocation errors) without
   waiting on a page reload. See theme.js `showFlashError`.
   =================================================================== */
@keyframes flash-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes flash-pop-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.js-flash-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(17, 17, 17, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: flash-fade-in 0.15s ease;
}

.js-flash {
  position: relative;
  width: 100%;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  padding: 2.25rem 2rem 1.75rem;
  border-radius: 3px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  background: #fff;
  animation: flash-pop-in 0.2s ease;
}

.js-flash--error {
  color: #7f1d1d;
}

.js-flash--success {
  color: #14532d;
}

.js-flash--info {
  color: #0c4a6e;
}

.js-flash__icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.js-flash--error .js-flash__icon {
  background: #fef2f2;
  color: #dc2626;
}

.js-flash--success .js-flash__icon {
  background: #f0fdf4;
  color: #16a34a;
}

.js-flash--info .js-flash__icon {
  background: #f0f9ff;
  color: #0284c7;
}

.js-flash__msg {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
}

.js-flash__close {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 0.75rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  opacity: 0.45;
  padding: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.js-flash__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.js-flash__ok {
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  border: 0;
  cursor: pointer;
  border-radius: 2px;
  padding: 0.7rem 2.5rem;
  background: var(--accent-color, #111);
  color: #fff;
  transition: opacity 0.15s ease;
}

.js-flash__ok:hover {
  opacity: 0.9;
}

/* ---- Smooth scrolling and scroll reveal ---------------------------------
   Motion only for people who have not asked their system to reduce it. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .cx-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
      opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
      transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
  }

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

/* ---- Toasts (add-to-cart success on mobile, errors everywhere) -------------
   Built by theme.js: cxMaybeCartToast (success, phones only) and
   cxShowErrorToast (any screen size). Slides down from the top. */
/* Fixed column holding the toasts: newest on top, older ones below it. */
.cx-toast-stack {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  inset-inline: 0;
  width: min(26rem, calc(100% - 1.5rem));
  margin-inline: auto;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.cx-cart-toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  width: 100%;
  pointer-events: auto;
  padding: 0.7rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent-color, #45bace) 28%, #e5e5e5);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  transform: translateY(-140%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.3s ease;
  cursor: pointer;
}

.cx-cart-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.cx-cart-toast__media {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 3rem;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  overflow: hidden;
  background: var(--adi-gray-100, #f2f3f5);
  color: #999;
}

.cx-cart-toast__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cx-cart-toast__text {
  margin: 0;
  min-width: 0;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

.cx-cart-toast__text strong {
  font-weight: 800;
  color: #111;
}

.cx-cart-toast--error {
  border-color: #f3c4c4;
}

.cx-cart-toast__media--error {
  flex-basis: 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #fdeaea;
  color: #e02424;
}

@media (prefers-reduced-motion: reduce) {
  .cx-cart-toast { transition: opacity 0.2s ease; transform: none; }
}
