/* ============ Taste & Tail — design tokens + shared components ============ */
:root {
  --navy-900: #0f1830;
  --navy-800: #16213e;
  --navy-700: #1f2c50;
  --navy-600: #2b3a66;
  --gold-600: #b8862f;
  --gold-500: #cf9d45;
  --gold-400: #e2b866;
  --gold-200: #f3dfb6;
  --cream-50: #fffbf5;
  --cream-100: #fbf4ea;
  --cream-200: #f4e7d5;
  --cream-300: #ead7bd;
  --ink: #1d2235;
  --ink-soft: #5d6274;
  --muted: #8b8577;
  --line: #eadcc6;
  --green: #1f9d55;
  --red: #c8423b;
  --wa: #25d366;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(22, 33, 62, .06), 0 2px 8px rgba(22, 33, 62, .05);
  --shadow: 0 6px 24px rgba(22, 33, 62, .10);
  --shadow-lg: 0 20px 50px rgba(15, 24, 48, .25);

  --font-ar: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  --font-display-ar: 'El Messiri', 'Tajawal', serif;
  --font-en: 'Poppins', 'Tajawal', system-ui, sans-serif;
  --font-script: 'Great Vibes', cursive;
  --font-serif: 'Playfair Display', Georgia, serif;

  --header-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ar);
  color: var(--ink);
  background: var(--cream-100);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="en"] body { font-family: var(--font-en); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .container { padding-inline: 24px; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--navy-900); box-shadow: 0 6px 18px rgba(184, 134, 47, .35); }
.btn--gold:hover { box-shadow: 0 8px 24px rgba(184, 134, 47, .45); }
.btn--navy { background: var(--navy-800); color: #fff; }
.btn--navy:hover { background: var(--navy-700); }
.btn--ghost { background: transparent; border-color: currentColor; }
.btn--light { background: #fff; color: var(--navy-800); border-color: var(--line); }
.btn--light:hover { border-color: var(--gold-500); }
.btn--wa { background: var(--wa); color: #fff; box-shadow: 0 6px 18px rgba(37, 211, 102, .35); }
.btn--danger { background: #fff; color: var(--red); border-color: #f0cfcc; }
.btn--danger:hover { background: #fdf1f0; }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: #fff; color: var(--navy-800); flex: none;
  transition: background .2s, border-color .2s;
}
.icon-btn:hover { border-color: var(--gold-500); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- form fields ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .field-label { font-weight: 700; font-size: 14px; color: var(--navy-800); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; font-size: 16px; /* 16px avoids iOS zoom */
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 4px rgba(207, 157, 69, .15); }
.field.invalid .input, .field.invalid .textarea { border-color: var(--red); }
.field .err { color: var(--red); font-size: 13px; display: none; }
.field.invalid .err { display: block; }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 110px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 6px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-weight: 700; font-size: 14.5px; cursor: pointer;
  transition: all .2s; text-align: center; line-height: 1.25;
}
.seg span small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 12.5px; }
.seg input:checked + span { border-color: var(--gold-500); background: #fff8ea; box-shadow: 0 0 0 3px rgba(207, 157, 69, .18); }
.seg input:focus-visible + span { outline: 2px solid var(--gold-500); }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; }
.qty button { width: 38px; height: 38px; border: 0; background: none; font-size: 20px; font-weight: 700; color: var(--navy-800); display: grid; place-items: center; }
.qty output { min-width: 28px; text-align: center; font-weight: 800; }
.qty--sm button { width: 30px; height: 30px; font-size: 17px; }

/* ---------- sheet / modal (bottom sheet on mobile, centered dialog on desktop) ---------- */
.sheet { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(10, 15, 30, .55); backdrop-filter: blur(3px); animation: fade .25s var(--ease); }
.sheet__panel {
  position: relative; width: 100%; max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--cream-50); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg);
  animation: up .35s var(--ease);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet__handle { width: 44px; height: 5px; border-radius: 9px; background: var(--cream-300); margin: 10px auto 0; }
.sheet__close { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 3; }
@media (min-width: 768px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet__panel { max-width: 560px; border-radius: var(--radius-lg); animation: pop .3s var(--ease); }
  .sheet__handle { display: none; }
  .sheet--drawer { justify-content: flex-end; padding: 0; align-items: stretch; }
  .sheet--drawer .sheet__panel { max-width: 440px; height: 100%; max-height: none; border-radius: 0; animation: slide .35s var(--ease); display: flex; flex-direction: column; }
  html[dir="rtl"] .sheet--drawer { justify-content: flex-start; }
  html[dir="rtl"] .sheet--drawer .sheet__panel { animation-name: slide-rtl; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
@keyframes slide { from { transform: translateX(100%); } }
@keyframes slide-rtl { from { transform: translateX(-100%); } }

body.locked { overflow: hidden; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 200; left: 50%; bottom: 96px; transform: translate(-50%, 20px);
  background: var(--navy-800); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 14.5px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .3s var(--ease); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
