/* ============================================================================
   Persad's D Food King — Design System
   "Sweet T&T meets editorial" — warm, food-first, premium
   Apex Executive Studio · PD-APEX-GROCER-2026-DESTOCKI
============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,800;0,9..144,900;1,9..144,400;1,9..144,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Palette — warm Trini kitchen at golden hour */
  --cream:        #FAF6EE;
  --cream-deep:   #F0E9D9;
  --cream-card:   #FFFCF5;
  --saffron:      #D4892A;       /* primary accent — turmeric/curry warmth */
  --saffron-deep: #A85F0E;
  --sage:         #7B9F6B;       /* fresh — banana leaf */
  --sage-deep:    #4F6B43;
  --espresso:     #2A1F18;       /* primary text */
  --espresso-soft:#5A4838;
  --cocoa:        #8B5A3C;
  --rust:         #B8413A;       /* sale red — restrained, not garish */
  --gold:         #C99166;
  --line:         #E5DCC9;
  --shadow:       0 1px 2px rgba(42,31,24,.06), 0 8px 24px rgba(42,31,24,.08);
  --shadow-lift:  0 2px 4px rgba(42,31,24,.08), 0 16px 48px rgba(42,31,24,.16);
  --radius:       4px;
  --radius-lg:    12px;

  --display: 'Fraunces', Georgia, serif;
  --body:    'Outfit', -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--espresso);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--saffron-deep); text-decoration: none; transition: color .2s; }
a:hover { color: var(--espresso); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--espresso);
  line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.8rem); font-weight: 600; }
h3 { font-size: clamp(1.3rem, 2vw, 1.8rem); font-weight: 600; }
h4 { font-size: 1.15rem; font-weight: 600; }

.eyebrow {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--saffron-deep);
}

.script-display {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  color: var(--saffron-deep);
}

/* ===== Layout ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-narrow { max-width: 920px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== Top nav ===== */
.nav {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(250,246,238,0.92);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1280px; margin: 0 auto;
}
.logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--espresso);
  display: flex; align-items: baseline; gap: .35rem;
}
.logo .accent { color: var(--saffron-deep); font-style: italic; font-weight: 500; }
.logo-mark {
  width: 36px; height: 36px;
  background: var(--saffron); color: var(--cream);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-style: italic;
  font-size: 1.1rem;
  margin-right: .6rem;
}

.nav-links { display: flex; gap: 1.75rem; align-items: center; }
.nav-links a {
  color: var(--espresso); font-weight: 500; font-size: .94rem;
  position: relative;
}
.nav-links a:hover { color: var(--saffron-deep); }
.nav-links a.active::after {
  content: ''; position: absolute; bottom: -1.18rem; left: 0; right: 0;
  height: 2px; background: var(--saffron);
}

.nav-actions { display: flex; gap: 1rem; align-items: center; }
.icon-btn {
  background: transparent; border: 1px solid var(--line);
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s;
  position: relative;
}
.icon-btn:hover { border-color: var(--saffron); color: var(--saffron-deep); }
.icon-btn .badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--rust); color: white;
  font-size: .7rem; font-weight: 600;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--body); font-weight: 500; font-size: .98rem;
  padding: .85rem 1.6rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all .25s;
  text-decoration: none;
  letter-spacing: .01em;
}
.btn-primary {
  background: var(--espresso); color: var(--cream);
}
.btn-primary:hover { background: var(--saffron-deep); transform: translateY(-1px); box-shadow: var(--shadow); color: var(--cream); }
.btn-saffron {
  background: var(--saffron); color: var(--cream);
}
.btn-saffron:hover { background: var(--saffron-deep); color: var(--cream); }
.btn-ghost {
  background: transparent; color: var(--espresso); border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--saffron); color: var(--saffron-deep); }
.btn-sage {
  background: var(--sage); color: var(--cream);
}
.btn-sage:hover { background: var(--sage-deep); color: var(--cream); }
.btn-sm { padding: .55rem 1rem; font-size: .88rem; }
.btn-lg { padding: 1.1rem 2.2rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
  padding: 5rem 0 7rem;
}
.hero-grid {
  max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 4rem;
  align-items: center;
}
.hero h1 { margin-bottom: 1.5rem; }
.hero h1 em {
  font-style: italic; font-weight: 400;
  color: var(--saffron-deep);
}
.hero-lead {
  font-size: 1.2rem;
  color: var(--espresso-soft);
  margin-bottom: 2.5rem;
  max-width: 28em;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/5;
  box-shadow: var(--shadow-lift);
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.hero-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(42,31,24,0.25) 100%);
}
.hero-tag {
  position: absolute; top: 1.5rem; right: 1.5rem;
  background: var(--saffron); color: var(--cream);
  padding: .4rem .9rem;
  font-size: .82rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 2px;
}

/* Decorative element — torn-paper feel */
.hero-decor {
  position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
  background: var(--cream);
  clip-path: polygon(0 100%, 100% 100%, 100% 60%, 96% 40%, 92% 65%, 88% 30%, 80% 50%, 72% 25%, 60% 55%, 50% 35%, 40% 60%, 30% 30%, 20% 55%, 12% 35%, 5% 60%, 0 40%);
}

/* ===== Departments grid ===== */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.dept-card {
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  text-decoration: none;
  color: var(--espresso);
  position: relative; overflow: hidden;
}
.dept-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--dept-color, var(--saffron));
}
.dept-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--saffron);
}
.dept-card .dept-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  margin-top: .8rem;
}
.dept-card .dept-local {
  font-size: .8rem;
  color: var(--espresso-soft);
  margin-top: .2rem;
}
.dept-icon {
  width: 56px; height: 56px;
  margin: 0 auto;
  background: var(--cream-deep);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}

/* ===== Product cards ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.product-card {
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all .25s;
  display: flex; flex-direction: column;
  position: relative;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--saffron);
}
.product-photo {
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--cream-deep);
  position: relative;
}
.product-photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s;
}
.product-card:hover .product-photo img { transform: scale(1.06); }
.product-badge {
  position: absolute; top: .8rem; left: .8rem;
  background: var(--rust); color: white;
  padding: .25rem .6rem;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  border-radius: 2px;
}
.product-badge.local {
  background: var(--sage);
  top: auto; bottom: .8rem; left: .8rem;
  display: inline-flex; align-items: center; gap: .25rem;
}
.product-info {
  padding: 1.1rem; flex: 1; display: flex; flex-direction: column;
}
.product-brand {
  font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--cocoa); font-weight: 500;
  margin-bottom: .3rem;
}
.product-name {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.02rem;
  line-height: 1.3;
  margin-bottom: .8rem;
  flex: 1;
}
.product-price {
  display: flex; align-items: baseline; gap: .6rem;
  margin-bottom: .8rem;
}
.product-price .price-now {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--espresso);
}
.product-price .price-was {
  font-size: .9rem;
  color: var(--espresso-soft);
  text-decoration: line-through;
}
.product-price .price-unit {
  font-size: .82rem;
  color: var(--espresso-soft);
}
.product-add {
  background: var(--espresso); color: var(--cream);
  border: none; padding: .65rem .8rem;
  border-radius: var(--radius);
  font-family: var(--body); font-weight: 500; font-size: .88rem;
  cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.product-add:hover { background: var(--saffron-deep); }

/* ===== Section ===== */
.section { padding: 5rem 0; }
.section-tight { padding: 3rem 0; }
.section-head {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 2.5rem; gap: 2rem; flex-wrap: wrap;
}
.section-title h2 { margin-top: .4rem; }

/* ===== Flyer hero spotlight ===== */
.flyer-banner {
  background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-deep) 100%);
  color: var(--cream);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  display: flex; justify-content: space-between; align-items: center;
  gap: 2rem; flex-wrap: wrap;
  margin-bottom: 3rem;
  position: relative; overflow: hidden;
}
.flyer-banner::before {
  content: ''; position: absolute; top: -50%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,.18) 0%, transparent 70%);
  pointer-events: none;
}
.flyer-banner h3 {
  font-style: italic;
  color: var(--cream);
  font-size: 2rem;
  font-weight: 500;
}
.flyer-banner p { opacity: .9; margin-top: .3rem; }
.flyer-banner .btn { background: var(--cream); color: var(--espresso); }
.flyer-banner .btn:hover { background: white; color: var(--saffron-deep); }

/* ===== Footer ===== */
.footer {
  background: var(--espresso);
  color: var(--cream);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer h4 {
  color: var(--cream);
  font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 1rem;
  font-family: var(--body); font-weight: 600;
}
.footer ul { list-style: none; }
.footer li { margin-bottom: .5rem; }
.footer a { color: rgba(250,246,238,.7); font-size: .92rem; }
.footer a:hover { color: var(--saffron); }
.footer-brand { font-family: var(--display); font-size: 1.6rem; font-weight: 700; }
.footer-brand .accent { color: var(--saffron); font-style: italic; font-weight: 400; }
.footer p { color: rgba(250,246,238,.6); margin-top: 1rem; max-width: 32em; line-height: 1.6; }
.footer-bottom {
  border-top: 1px solid rgba(250,246,238,.1);
  padding-top: 2rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: .85rem; color: rgba(250,246,238,.5);
}

/* ===== Forms ===== */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: .82rem; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--espresso-soft);
  margin-bottom: .4rem;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: .85rem 1rem;
  font-family: var(--body); font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cream-card);
  color: var(--espresso);
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(212,137,42,.15);
}

/* ===== Cart ===== */
.cart-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  gap: 1.2rem; align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-row .cart-photo {
  width: 80px; height: 80px;
  border-radius: var(--radius);
  background: var(--cream-deep);
  overflow: hidden;
}
.cart-row .cart-photo img { width: 100%; height: 100%; object-fit: cover; }
.cart-row .cart-name { font-family: var(--display); font-weight: 500; font-size: 1.05rem; }
.cart-row .cart-meta { font-size: .85rem; color: var(--espresso-soft); margin-top: .2rem; }
.qty-stepper {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.qty-stepper button {
  width: 32px; height: 32px; border: none; background: transparent;
  cursor: pointer; font-size: 1.1rem; color: var(--espresso); font-weight: 500;
}
.qty-stepper button:hover { background: var(--cream-deep); }
.qty-stepper input {
  width: 40px; border: none; text-align: center; background: transparent;
  font-family: var(--body); font-size: .95rem; color: var(--espresso);
}

.cart-summary {
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  position: sticky; top: 6rem;
}
.cart-summary h3 { margin-bottom: 1.2rem; }
.summary-row {
  display: flex; justify-content: space-between;
  padding: .55rem 0; font-size: .96rem;
}
.summary-row.total {
  font-family: var(--display); font-size: 1.4rem; font-weight: 700;
  border-top: 1px solid var(--line);
  padding-top: 1rem; margin-top: .5rem;
}

/* ===== Tables (admin) ===== */
.tbl {
  width: 100%; border-collapse: collapse;
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.tbl th {
  text-align: left;
  font-size: .76rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--espresso-soft); font-weight: 600;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--cream-deep);
}
.tbl td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: .94rem;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover { background: var(--cream); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== Tabs ===== */
.tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--line);
  margin-bottom: 2rem; overflow-x: auto;
}
.tab {
  padding: .9rem 1.5rem;
  font-family: var(--body); font-weight: 500; font-size: .94rem;
  color: var(--espresso-soft);
  background: transparent; border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}
.tab.active { color: var(--saffron-deep); border-bottom-color: var(--saffron); }
.tab:hover { color: var(--espresso); }

/* ===== KPI Cards (admin) ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.kpi-card {
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  background: var(--accent, var(--saffron));
}
.kpi-card .kpi-label {
  font-size: .76rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--espresso-soft); font-weight: 500;
}
.kpi-card .kpi-value {
  font-family: var(--display); font-size: 2.2rem; font-weight: 700;
  margin-top: .35rem; color: var(--espresso);
  font-variant-numeric: tabular-nums;
}
.kpi-card .kpi-sub {
  font-size: .85rem; color: var(--espresso-soft); margin-top: .2rem;
}

/* ===== Status pills ===== */
.pill {
  display: inline-flex; align-items: center;
  padding: .25rem .65rem;
  font-size: .76rem; font-weight: 500;
  border-radius: 12px;
  letter-spacing: .03em;
}
.pill-active   { background: rgba(123,159,107,.18); color: var(--sage-deep); }
.pill-pending  { background: rgba(212,137,42,.18); color: var(--saffron-deep); }
.pill-overdue  { background: rgba(184,65,58,.15); color: var(--rust); }
.pill-paid     { background: rgba(123,159,107,.18); color: var(--sage-deep); }
.pill-info     { background: rgba(91,157,190,.18); color: #2A5A75; }

/* ===== Auth modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(42,31,24,.6);
  display: none; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--cream); border-radius: var(--radius-lg);
  padding: 2.5rem; width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lift);
}
.modal h3 { margin-bottom: .4rem; }
.modal-close {
  float: right; background: transparent; border: none; cursor: pointer;
  font-size: 1.5rem; color: var(--espresso-soft); line-height: 1;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cart-row { grid-template-columns: 60px 1fr; row-gap: .5rem; }
  .cart-row .cart-photo { width: 60px; height: 60px; }
  .nav-links { display: none; }
}

/* ===== Misc ===== */
.local-stamp {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .76rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sage-deep); font-weight: 600;
}
.local-stamp::before {
  content: ''; width: 6px; height: 6px; background: var(--sage); border-radius: 50%;
}
.muted { color: var(--espresso-soft); }
.center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2.5rem; }
.flex { display: flex; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.hidden { display: none !important; }

/* ===== Animations ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .6s ease-out backwards; }
.fade-up-1 { animation-delay: .05s; }
.fade-up-2 { animation-delay: .15s; }
.fade-up-3 { animation-delay: .25s; }
.fade-up-4 { animation-delay: .35s; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--espresso); color: var(--cream);
  padding: 1rem 1.4rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  font-size: .94rem;
  z-index: 200;
  animation: fadeUp .3s ease-out;
}
