/* ==========================================================================
   MORDEVO DESIGN SYSTEM — TOKENS
   ========================================================================== */

:root{
  /* ---- Color ---- */
  --color-ivory:        #F6F2E9;
  --color-white:        #FFFFFF;
  --color-forest-900:   #14261C;
  --color-forest-800:   #1C3527;
  --color-forest-700:   #24422F;
  --color-forest-600:   #2E5439;
  --color-gold-600:     #A9782F;
  --color-gold-500:     #BE8E42;
  --color-gold-100:     #F1E4CC;
  --color-ink:          #262420;
  --color-ink-soft:     #55524A;
  --color-ink-faint:    #8B8778;
  --color-line:         #E4DDCC;
  --color-line-strong:  #CFC5A9;
  --color-success:      #3E6B4A;
  --color-error:        #A6402C;
  --color-bg:           var(--color-ivory);
  --color-surface:      var(--color-white);

  /* ---- Type ---- */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.125rem;
  --text-lg:   1.375rem;
  --text-xl:   1.75rem;
  --text-2xl:  2.25rem;
  --text-3xl:  3rem;
  --text-4xl:  3.75rem;

  --leading-tight: 1.08;
  --leading-snug:  1.3;
  --leading-normal: 1.6;

  /* ---- Spacing (8px base) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* ---- Radius ---- */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-pill: 999px;

  /* ---- Shadow ---- */
  --shadow-sm: 0 1px 2px rgba(20, 38, 28, 0.06);
  --shadow-md: 0 6px 20px rgba(20, 38, 28, 0.08);
  --shadow-lg: 0 16px 40px rgba(20, 38, 28, 0.14);

  /* ---- Layout ---- */
  --container-max: 1200px;
  --container-pad: clamp(20px, 4vw, 64px);
  --header-h: 76px;
  --header-h-mobile: 60px;

  /* ---- Motion ---- */
  --ease-standard: cubic-bezier(.4,0,.2,1);
  --dur-fast: 150ms;
  --dur-base: 240ms;
}

/* ==========================================================================
   RESET
   ========================================================================== */

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,p,figure{ margin: 0; }
ul{ margin: 0; padding: 0; list-style: none; }
img{ max-width: 100%; display: block; }
button{ font: inherit; }
a{ color: inherit; text-decoration: none; }
input, select, textarea{ font: inherit; color: inherit; }

:focus-visible{
  outline: 2px solid var(--color-gold-600);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

h1,h2,h3{ font-family: var(--font-display); font-weight: 600; line-height: var(--leading-tight); color: var(--color-forest-900); }

.h-display{ font-size: var(--text-4xl); }
.h-1{ font-size: var(--text-3xl); }
.h-2{ font-size: var(--text-2xl); }
.h-3{ font-size: var(--text-xl); }
.eyebrow{ font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm); color: var(--color-gold-600); }
.lede{ font-size: var(--text-md); color: var(--color-ink-soft); line-height: var(--leading-snug); }

@media (max-width: 720px){
  .h-display{ font-size: 2.5rem; }
  .h-1{ font-size: 2rem; }
  .h-2{ font-size: 1.6rem; }
}

/* ==========================================================================
   LAYOUT PRIMITIVES
   ========================================================================== */

.container{
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.section{ padding: var(--space-9) 0; }
.section--tight{ padding: var(--space-7) 0; }
.section--surface{ background: var(--color-surface); }
.section--forest{ background: var(--color-forest-800); color: var(--color-ivory); }
.section--forest h1, .section--forest h2, .section--forest h3{ color: var(--color-white); }

.grid{ display: grid; gap: var(--space-6); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-4{ grid-template-columns: repeat(var(--products-per-row, 4), 1fr); }
.grid-4-fixed{ grid-template-columns: repeat(4, 1fr); } /* always exactly 4 columns — for non-menu sections (destination cards, trust badges, etc.) that shouldn't follow the admin's "dishes per row" setting */

@media (max-width: 980px){
  .grid-4, .grid-4-fixed{ grid-template-columns: repeat(2, 1fr); }
  .grid-3{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px){
  .grid-2, .grid-3, .grid-4-fixed{ grid-template-columns: 1fr; }
  .grid-4{ grid-template-columns: repeat(var(--products-per-row-mobile, 1), 1fr); }
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
  white-space: nowrap;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: var(--color-forest-800); color: var(--color-white); }
.btn-vivid-green{ background: var(--color-success) !important; border-color: var(--color-success) !important; }
.btn-vivid-green:hover{ background: #345A3D !important; }
.btn-primary:hover{ background: var(--color-forest-900); }
.btn-danger{ background: var(--color-error); color: var(--color-white); }
.btn-danger:hover{ background: #872213; }
.btn-gold{ background: var(--color-gold-600); color: var(--color-white); }
.btn-gold:hover{ background: var(--color-gold-500); }
.btn-outline{ background: transparent; color: var(--color-forest-800); border-color: var(--color-forest-800); }
.btn-outline:hover{ background: var(--color-forest-800); color: var(--color-white); }
.btn-outline-light{ background: transparent; color: var(--color-white); border-color: rgba(255,255,255,0.5); }
.btn-outline-light:hover{ background: rgba(255,255,255,0.12); border-color: var(--color-white); }
.btn-ghost{ background: transparent; color: var(--color-forest-800); padding-left: 4px; padding-right: 4px; }
.btn-ghost:hover{ color: var(--color-gold-600); }
.btn-sm{ padding: 9px 18px; font-size: var(--text-xs); }
.btn-block{ width: 100%; }
.btn:disabled{ opacity: 0.5; cursor: not-allowed; }
.btn-icon{
  width: 40px; height: 40px; padding: 0; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--color-line-strong); color: var(--color-forest-800);
}
.btn-icon:hover{ border-color: var(--color-forest-800); }
.notif-badge{
  position: absolute; top: 0; left: 0; min-width: 16px; height: 16px; padding: 0 3px;
  background: var(--color-danger, #b3261e); color: #fff; border-radius: 20px;
  font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  line-height: 1; box-shadow: 0 0 0 2px var(--color-cream, #F6F2E9);
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card{
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.field{ display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field label{ font-size: var(--text-sm); font-weight: 600; color: var(--color-forest-900); }
.field .hint{ font-size: var(--text-xs); color: var(--color-ink-faint); }
.field .error-msg{ font-size: var(--text-xs); color: var(--color-error); display:none; }
.field.has-error .error-msg{ display: block; }
.field.has-error input, .field.has-error select, .field.has-error textarea{ border-color: var(--color-error); }

.input, select.input, textarea.input{
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-size: var(--text-base);
  transition: border-color var(--dur-fast);
}
.input:focus{ border-color: var(--color-forest-700); outline: none; box-shadow: 0 0 0 3px rgba(36,66,47,0.12); }
textarea.input{ resize: vertical; min-height: 110px; }
/* Force the browser's autofill tint (usually blue/yellow) back to our own
   input background, so an autofilled field still looks empty/normal even
   if the browser ignores autocomplete="off" and fills it anyway. */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus{
  -webkit-box-shadow: 0 0 0 1000px var(--color-white) inset;
  -webkit-text-fill-color: var(--color-ink);
  transition: background-color 9999s ease-in-out 0s;
}

.form-row{ display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 620px){ .form-row{ grid-template-columns: 1fr; } }

/* ==========================================================================
   BADGES / TAGS / STATUS
   ========================================================================== */

.tag{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 600;
  border: 1px solid var(--color-line-strong); color: var(--color-forest-800);
  background: var(--color-white); cursor: pointer;
  transition: all var(--dur-fast);
}
.tag.is-active{ background: var(--color-forest-800); border-color: var(--color-forest-800); color: var(--color-white); }
.tag:hover:not(.is-active){ border-color: var(--color-forest-800); }

.status{ display:inline-flex; align-items:center; gap:8px; font-size: var(--text-sm); font-weight:600; }
.status::before{ content:""; width:8px; height:8px; border-radius:50%; background: currentColor; }
.status--delivered{ color: var(--color-success); }
.status--transit{ color: var(--color-gold-600); }
.status--preparing{ color: var(--color-ink-soft); }

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.text-center{ text-align: center; }
.muted{ color: var(--color-ink-soft); }
.faint{ color: var(--color-ink-faint); }
.mt-1{ margin-top: var(--space-1); } .mt-2{ margin-top: var(--space-2); } .mt-3{ margin-top: var(--space-3); }
.mt-4{ margin-top: var(--space-4); } .mt-5{ margin-top: var(--space-5); } .mt-6{ margin-top: var(--space-6); } .mt-7{ margin-top: var(--space-7); }
.mt-8{ margin-top: var(--space-8); } .mt-9{ margin-top: var(--space-9); }
.mb-2{ margin-bottom: var(--space-2); } .mb-3{ margin-bottom: var(--space-3); } .mb-4{ margin-bottom: var(--space-4); } .mb-5{ margin-bottom: var(--space-5); } .mb-6{ margin-bottom: var(--space-6); }
.divider{ height: 1px; background: var(--color-line); border: none; margin: var(--space-6) 0; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skip-link{ position:absolute; left:-999px; top:0; background:var(--color-forest-900); color:#fff; padding:12px 20px; z-index:999; }
.skip-link:focus{ left: 12px; top: 12px; }
