/* =====================================================================
   SNACK GEORGES — "Hot & Cold Pop" design system
   Fun, bright, appetizing, app-like. Mobile-first.
   Shared across all customer-facing pages.
   ===================================================================== */

:root {
  /* Canvas / surfaces — Ice-White Blue */
  --cream: #f4f8ff;
  --cream-2: #e0f2fe;
  --card: #ffffff;
  --warm-line: #dbeafe;

  /* Ink (Deep Slate Blue) */
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;

  /* Brand — Cool Azure Blue */
  --coral: #0284c7;
  --orange: #38bdf8;
  --coral-deep: #0369a1;

  /* Accents — Cold Azure */
  --mint: #06b6d4;
  --sky: #0284c7;
  --yellow: #f59e0b;
  --grape: #6366f1;
  --pink: #ec4899;
  --lime: #10b981;

  /* Effects */
  --radius: 20px;
  --radius-sm: 16px;
  --radius-lg: 28px;
  --shadow-soft: 0 10px 30px rgba(2, 132, 199, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-pop: 0 18px 40px rgba(2, 132, 199, 0.25);
  --shadow-card: 0 14px 34px rgba(15, 23, 42, 0.06);
  --grad-hot: linear-gradient(135deg, #38bdf8 0%, #0284c7 55%, #1d4ed8 100%);
  --grad-warm: linear-gradient(135deg, #0284c7 0%, #1e40af 100%);
}

/* Material Symbols: use the friendlier Rounded face even where markup
   still says "outlined". */
.material-symbols-outlined,
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded', 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

/* Twemoji images (emoji.js) size and align like the text they replace */
img.emoji {
  width: 1em; height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--cream);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Atmospheric background blobs — keep it appetizing, never flat white */
.scf-bg { position: relative; isolation: isolate; }
.scf-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(42rem 42rem at 110% -8%, rgba(255, 107, 53, 0.16), transparent 60%),
    radial-gradient(38rem 38rem at -12% 12%, rgba(0, 194, 168, 0.12), transparent 60%),
    radial-gradient(34rem 34rem at 50% 118%, rgba(45, 168, 255, 0.10), transparent 60%),
    var(--cream);
}

/* ----- Typography ----- */
.font-display {
  font-family: 'Clash Display', 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.wordmark {
  font-family: 'Clash Display', sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  background: var(--grad-hot);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  border-radius: 999px;
  transition: transform .15s ease, box-shadow .25s ease, opacity .2s ease, background .2s ease;
  user-select: none;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: var(--grad-hot);
  color: #fff;
  box-shadow: var(--shadow-pop);
  padding: 16px 24px;
  font-size: 17px;
}
.btn-primary:disabled { opacity: .65; box-shadow: none; }
.btn-block { width: 100%; }
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--warm-line);
  box-shadow: var(--shadow-soft);
  padding: 14px 22px;
}
.btn-soft {
  background: var(--cream-2);
  color: var(--coral-deep);
  padding: 12px 18px;
  font-weight: 700;
}

/* round add button used on cards/sheets */
.add-fab {
  width: 46px; height: 46px;
  border-radius: 16px;
  background: var(--grad-hot);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-pop);
  border: none; cursor: pointer;
  transition: transform .15s ease;
}
.add-fab:active { transform: scale(.88) rotate(-8deg); }

/* ----- Category chips ----- */
.chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.chip:active { transform: scale(.94); }
.chip .emoji { font-size: 16px; }
/* idle = tinted, active = solid + lift */
.chip[data-active="true"] { color: #fff; box-shadow: var(--shadow-soft); transform: translateY(-1px); }

/* ----- Cards ----- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
/* Order-summary money rows (Subtotal/Delivery/Total on cart, checkout and
   order-confirmation): the "1,800,000 LL ($20.11)" string grows with the
   order size and can outgrow the row on a narrow phone. These were forced
   onto one line (white-space: nowrap), so a big-enough total didn't wrap —
   it overflowed past the card, and since the page hides horizontal overflow
   (`overflow-x-hidden` on <body>) that overflow rendered as text silently
   clipped at the edge (e.g. a missing closing parenthesis) instead of
   reflowing. Let it wrap onto a second line, right-aligned, instead. */
.money-amount {
  white-space: normal;
  text-align: right;
  min-width: 0;
}
.food-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .25s ease;
}
.food-card:active { transform: scale(.985); }
.food-card .photo {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.food-card:hover .photo { transform: scale(1.05); }

/* ----- Fields ----- */
.field {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--warm-line);
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field::placeholder { color: var(--ink-faint); }
.field:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.12);
}
.field-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 7px 4px;
}

/* segmented toggle (delivery/pickup, share/manual) */
.seg {
  display: flex;
  background: var(--cream-2);
  border-radius: 999px;
  padding: 5px;
  gap: 4px;
}
.seg button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  font-family: inherit;
  padding: 11px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
  font-size: 14px;
}
.seg button[data-active="true"], .seg button.is-active {
  background: var(--grad-hot);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

/* ----- Floating sticky cart ----- */
.fab-cart {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: var(--grad-hot);
  color: #fff;
  border-radius: 999px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 22px;
  box-shadow: var(--shadow-pop);
  transition: transform .15s ease, opacity .2s ease;
}
.fab-cart:active { transform: scale(.98); }

/* ----- Bottom sheet ----- */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(42, 24, 16, .5);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: 560px;
  background: var(--cream);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -20px 60px rgba(42, 24, 16, .35);
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  max-height: 92vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sheet-scrim.open .sheet { transform: translateY(0); }
.sheet-grip { width: 44px; height: 5px; border-radius: 999px; background: var(--warm-line); margin: 12px auto 4px; }

/* ----- Badges / pills ----- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-weight: 700; font-size: 12px;
}
.pill-live { background: rgba(52,199,89,.14); color: #1f9d4d; }

/* ----- Bottom nav ----- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; margin: 0 auto; width: 100%;
  max-width: 768px;
  z-index: 50;
  display: flex; justify-content: space-around; align-items: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 247, 240, 0.9);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--warm-line);
  border-radius: 24px 24px 0 0;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-soft);
  font-weight: 700; font-size: 11px;
  padding: 6px 14px; border-radius: 16px;
  transition: color .2s ease, background .2s ease;
}
.nav-item.is-active { color: #fff; background: var(--grad-hot); box-shadow: var(--shadow-soft); }
.nav-badge {
  position: absolute; top: 2px; right: 8px;
  background: var(--coral); color: #fff;
  font-size: 10px; font-weight: 800;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--cream);
}

/* ----- Header ----- */
.app-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 50;
  height: 64px;
  background: rgba(255, 247, 240, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--warm-line);
  display: flex; align-items: center;
}
.icon-btn {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: #fff;
  color: var(--coral-deep);
  box-shadow: var(--shadow-soft);
  border: none; cursor: pointer;
  transition: transform .15s ease;
}
.icon-btn:active { transform: scale(.9); }

/* ----- Animations ----- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.9); } 60% { transform: scale(1.03); } 100% { opacity: 1; transform: scale(1); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wobble { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.anim-fade-up { animation: fadeUp .5s both; }
.anim-pop { animation: popIn .4s both; }
.spin { animation: spin 1s linear infinite; }

/* staggered reveal for grids/lists */
.stagger > * { animation: fadeUp .5s both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .13s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .23s; }
.stagger > *:nth-child(6) { animation-delay: .28s; }
.stagger > *:nth-child(7) { animation-delay: .33s; }
.stagger > *:nth-child(8) { animation-delay: .38s; }
.stagger > *:nth-child(n+9) { animation-delay: .42s; }

/* ----- Scrollbars / utilities ----- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
::-webkit-scrollbar { width: 7px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #f0d3c0; border-radius: 999px; }

.pb-safe { padding-bottom: env(safe-area-inset-bottom); }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Portrait lock overlay (shared) */
#rotate-overlay { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  #rotate-overlay {
    display: flex; position: fixed; inset: 0; z-index: 1000;
    flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 24px; background: var(--cream); color: var(--ink);
  }
  body { overflow: hidden; }
}

/* ----- Language switcher ----- */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--cream-2);
  border-radius: 999px;
  padding: 3px;
}
.lang-switch-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  transition: background .2s ease, color .2s ease;
  white-space: nowrap;
}
/* Keep the header on one row on narrow phones */
@media (max-width: 480px) {
  .lang-switch-btn { padding: 5px 6px; font-size: 10px; }
  .app-header .pill-live { display: none; }
}
/* Header must never crop: the title shrinks/ellipsizes, actions stay on screen */
.app-header > div { min-width: 0; }
.app-header > div > :first-child { flex: 1 1 auto; min-width: 0; }
.app-header > div > :last-child { flex-shrink: 0; }
.app-header h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* <br> in the wordmark still breaks its two lines */
}
.app-header h1:not(.wordmark) { font-size: clamp(16px, 5.4vw, 22px); }
.app-header h1.wordmark { font-size: clamp(13px, 4.6vw, 19px); }
@media (max-width: 460px) {
  .app-header .header-label { display: none; }
}
@media (max-width: 360px) {
  .lang-switch-btn { padding: 5px 5px; }
  .app-header .icon-btn { width: 38px; height: 38px; }
}
/* Compact language codes when the header row gets tight: always below 375px,
   and earlier on headers marked .header-tight (extra actions, e.g. Orders) */
.lang-switch-btn .lang-short { display: none; }
@media (max-width: 374px) {
  .lang-switch-btn .lang-full { display: none; }
  .lang-switch-btn .lang-short { display: inline; }
}
@media (max-width: 430px) {
  .header-tight .lang-switch-btn .lang-full { display: none; }
  .header-tight .lang-switch-btn .lang-short { display: inline; }
}
/* ----- Suggestion cards (menu for-you row, item sheet, cart pairings) ----- */
.hub-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.hub-card {
  flex: 0 0 160px;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.hub-card img { width: 100%; height: 92px; object-fit: cover; display: block; }
.hub-body { padding: 10px 12px 12px; }
.hub-name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 33px;
}
.hub-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hub-price {
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--coral-deep);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Card is too narrow for "500,000 LL $5.59" on one line: USD goes underneath */
.hub-price .usd-eq { display: block; }
html[lang="ar"] .hub-price { font-family: 'Tajawal', sans-serif; }
.usd-eq {
  font-size: 0.8em;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}
.hub-add {
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--cream-2);
  color: var(--coral-deep);
  font-family: inherit;
  font-weight: 800;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  transition: transform .15s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.hub-add:active { transform: scale(.92); }
.hub-add.is-added { background: #e7f9ec; color: #1f9d4d; }

/* ===== RTL support ===== */
[dir="rtl"] body { direction: rtl; }

/* ===== Arabic typography =====
   Clash Display and Plus Jakarta Sans have no Arabic glyphs, and any
   letter-spacing (positive or negative) visually breaks the joined
   Arabic script. Use Tajawal for Arabic and neutralize all tracking. */
html[lang="ar"] body {
  font-family: 'Tajawal', 'Plus Jakarta Sans', system-ui, sans-serif;
}
html[lang="ar"] .font-display,
html[lang="ar"] .btn {
  font-family: 'Tajawal', 'Clash Display', sans-serif;
  letter-spacing: 0;
}
html[lang="ar"] .font-display { font-weight: 800; }
html[lang="ar"] .tracking-wide,
html[lang="ar"] .tracking-wider,
html[lang="ar"] .tracking-widest {
  letter-spacing: 0;
}
html[lang="ar"] .leaflet-container {
  font-family: 'Tajawal', 'Plus Jakarta Sans', sans-serif;
}

/* Mirror absolute-positioned icon/badge utilities used across the customer pages */
[dir="rtl"] .left-4 { left: auto; right: 1rem; }
[dir="rtl"] .right-3 { right: auto; left: 0.75rem; }
[dir="rtl"] .right-4 { right: auto; left: 1rem; }
[dir="rtl"] .-right-2\.5 { right: auto; left: -0.625rem; }
[dir="rtl"] .-mr-1 { margin-right: 0; margin-left: -0.25rem; }

/* Icons that imply a forward/next direction should mirror under RTL */
[dir="rtl"] .rtl-flip { display: inline-block; transform: scaleX(-1); }

/* Nav badge (top-right counter on the Cart bottom-nav item) */
[dir="rtl"] .nav-badge { right: auto; left: 8px; }

/* Floating cart: icon+label on the leading edge, total pill on the trailing edge */
[dir="rtl"] .fab-cart { padding: 0 22px 0 14px; }

/* Search field icon padding (inline-styled on index.html) */
[dir="rtl"] #search-input { padding-left: 44px !important; padding-right: 48px !important; }

/* Phone "+961" prefix padding (inline-styled on checkout/profile/orders) */
[dir="rtl"] .phone-field-rtl { padding-left: 16px !important; padding-right: 60px !important; }
