/* ═══════════════════════════════════════════════════════════════
   TomlistPOS — Global Design System
   Aesthetic: Warm editorial · Rich food imagery · Confident reds
   Fonts: Playfair Display (display) + DM Sans (body)
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --red:        #d63031;
  --red-dark:   #b71c1c;
  --red-light:  #fff0f0;
  --gold:       #f0a500;
  --dark:       #1a1a1a;
  --dark-2:     #2d2d2d;
  --mid:        #5c5c5c;
  --muted:      #9a9a9a;
  --border:     #e8e2d9;
  --bg:         #fdfaf6;
  --white:      #ffffff;
  --card-bg:    #ffffff;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:  0 6px 24px rgba(0,0,0,0.10);
  --shadow-lg:  0 16px 48px rgba(0,0,0,0.14);
  --radius:     12px;
  --radius-lg:  20px;
  --ff-display: 'Playfair Display', Georgia, serif;
  --ff-body:    'DM Sans', system-ui, sans-serif;
  --nav-h:      68px;
  --max-w:      1240px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--ff-display); line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 600; }
p  { color: var(--mid); line-height: 1.75; }

/* ── Layout Utilities ─────────────────────────────────────── */
.container  { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section    { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.flex       { display: flex; }
.items-center { align-items: center; }
.gap-8    { gap: 8px; }
.gap-16   { gap: 16px; }
.gap-24   { gap: 24px; }
.text-center { text-align: center; }
.hidden   { display: none !important; }

/* ── Navigation ───────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  background: rgba(253,250,246,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
.navbar.scrolled { box-shadow: var(--shadow-md); }
.navbar__inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 32px;
}
.navbar__logo {
  font-family: var(--ff-display);
  font-size: 1.5rem; font-weight: 800;
  color: var(--red); letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 8px;
}
.navbar__logo span { font-style: italic; }
.navbar__nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.navbar__nav a {
  font-size: 0.9rem; font-weight: 500; color: var(--dark-2);
  padding: 6px 0; position: relative; transition: color 0.2s;
}
.navbar__nav a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; width: 0;
  height: 2px; background: var(--red); transition: width 0.25s;
}
.navbar__nav a:hover, .navbar__nav a.active { color: var(--red); }
.navbar__nav a:hover::after, .navbar__nav a.active::after { width: 100%; }
.navbar__actions { display: flex; align-items: center; gap: 12px; }
.btn-ghost {
  padding: 8px 20px; border: 1.5px solid var(--border);
  border-radius: 50px; font-size: 0.875rem; font-weight: 500;
  color: var(--dark-2); transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.navbar__mobile-toggle { display: none; flex-direction: column; gap: 5px; padding: 4px; }
.navbar__mobile-toggle span { display: block; width: 22px; height: 2px; background: var(--dark); border-radius: 2px; transition: all 0.3s; }
.navbar__mobile-menu {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 20px 24px; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-md); z-index: 999;
}
.navbar__mobile-menu.open { display: flex; }
.navbar__mobile-menu a { padding: 12px 0; font-weight: 500; border-bottom: 1px solid var(--border); color: var(--dark-2); }
.navbar__mobile-menu a:last-child { border-bottom: none; }
body { padding-top: var(--nav-h); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px; border-radius: 50px;
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.3px;
  transition: all 0.22s; white-space: nowrap;
}
.btn-primary {
  background: var(--red); color: var(--white);
  box-shadow: 0 4px 18px rgba(214,48,49,0.35);
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 7px 22px rgba(214,48,49,0.42); }
.btn-secondary {
  background: var(--white); color: var(--red);
  border: 1.5px solid var(--red);
}
.btn-secondary:hover { background: var(--red-light); }
.btn-outline {
  background: transparent; color: var(--white);
  border: 2px solid rgba(255,255,255,0.7);
}
.btn-outline:hover { background: rgba(255,255,255,0.15); }
.btn-sm { padding: 8px 18px; font-size: 0.82rem; }
.btn-lg { padding: 16px 40px; font-size: 1rem; }

/* ── Section Headings ─────────────────────────────────────── */
.section-label {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--red); margin-bottom: 12px;
}
.section-title { margin-bottom: 16px; color: var(--dark); }
.section-sub   { font-size: 1.05rem; color: var(--mid); max-width: 560px; }
.section-head  { margin-bottom: 48px; }
.section-head.centered { text-align: center; }
.section-head.centered .section-sub { margin: 0 auto; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid var(--border);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card__img { width: 100%; height: 200px; object-fit: cover; background: #f0ebe3; }
.card__body { padding: 18px 20px; }
.card__tag {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--red);
  background: var(--red-light); padding: 4px 10px;
  border-radius: 50px; display: inline-block; margin-bottom: 10px;
}
.card__title { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; color: var(--dark); }
.card__desc  { font-size: 0.87rem; color: var(--mid); line-height: 1.5; margin-bottom: 12px; }
.card__meta  { display: flex; align-items: center; gap: 12px; }
.card__rating { display: flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 600; color: var(--gold); }
.card__price  { font-size: 0.85rem; font-weight: 600; color: var(--mid); }

/* ── Restaurant Grid ──────────────────────────────────────── */
.restaurants-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 7px; color: var(--dark-2); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 0.9rem; color: var(--dark);
  background: var(--white); transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--red); box-shadow: 0 0 0 3px rgba(214,48,49,0.1);
}
.form-input::placeholder { color: var(--muted); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-error { font-size: 0.8rem; color: var(--red); margin-top: 5px; }

/* ── Toast Notifications ──────────────────────────────────── */
#toast-container {
  position: fixed; top: 80px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  background: var(--dark); color: var(--white);
  padding: 14px 20px; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-md); pointer-events: all;
  animation: toast-in 0.3s ease; max-width: 320px;
  display: flex; align-items: center; gap: 10px;
}
.toast.success { background: #1e7e34; }
.toast.error   { background: var(--red-dark); }
@keyframes toast-in { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* ── Badge / Chip ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 50px; font-size: 0.75rem; font-weight: 600;
}
.badge-red   { background: var(--red-light); color: var(--red); }
.badge-gold  { background: #fff8e1; color: #e65100; }
.badge-green { background: #e8f5e9; color: #2e7d32; }

/* ── Stars ────────────────────────────────────────────────── */
.stars { color: var(--gold); letter-spacing: -1px; }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--dark); color: rgba(255,255,255,0.7);
  padding: 64px 0 0;
}
.footer__grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer__brand { max-width: 320px; }
.footer__logo {
  font-family: var(--ff-display); font-size: 1.6rem; font-weight: 800;
  color: var(--white); margin-bottom: 14px; display: block;
}
.footer__logo span { color: var(--red); font-style: italic; }
.footer__desc { font-size: 0.875rem; line-height: 1.7; margin-bottom: 20px; }
.footer__social { display: flex; gap: 10px; }
.footer__social a {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; transition: background 0.2s;
}
.footer__social a:hover { background: var(--red); }
.footer__col h4 { color: var(--white); font-size: 0.9rem; font-weight: 600; margin-bottom: 18px; letter-spacing: 0.5px; }
.footer__col ul { display: flex; flex-direction: column; gap: 10px; }
.footer__col ul li a { font-size: 0.85rem; transition: color 0.2s; }
.footer__col ul li a:hover { color: var(--white); }
.footer__bottom {
  padding: 20px 0; display: flex; align-items: center;
  justify-content: space-between; font-size: 0.8rem;
}
.footer__bottom-links { display: flex; gap: 20px; }
.footer__bottom-links a:hover { color: var(--white); }

/* ── Page Hero (inner pages) ──────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  padding: 64px 0 56px; text-align: center; position: relative; overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-hero h1 { color: var(--white); font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 12px; }
.page-hero p  { color: rgba(255,255,255,0.65); font-size: 1.05rem; max-width: 500px; margin: 0 auto; }

/* ── Loading Spinner ──────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--red);
  animation: spin 0.7s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Auth Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 2000; display: none; align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 440px; overflow: hidden;
  box-shadow: var(--shadow-lg); animation: modal-in 0.3s ease;
}
@keyframes modal-in { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.modal__header {
  padding: 28px 32px 0; display: flex; justify-content: space-between; align-items: flex-start;
}
.modal__title { font-family: var(--ff-display); font-size: 1.6rem; font-weight: 700; color: var(--dark); }
.modal__close {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--mid); transition: all 0.2s; cursor: pointer;
}
.modal__close:hover { background: var(--border); color: var(--dark); }
.modal__body { padding: 24px 32px 32px; }
.modal__tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.modal__tab {
  flex: 1; padding: 10px 0; text-align: center;
  font-weight: 600; font-size: 0.9rem; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s;
}
.modal__tab.active { color: var(--red); border-bottom-color: var(--red); }
.modal__switch { font-size: 0.85rem; text-align: center; color: var(--mid); margin-top: 16px; }
.modal__switch a { color: var(--red); font-weight: 600; cursor: pointer; }

/* ── Cart sidebar ─────────────────────────────────────────── */
.cart-sidebar {
  position: fixed; top: 0; right: -420px; width: 420px; height: 100%;
  background: var(--white); z-index: 1500; box-shadow: var(--shadow-lg);
  transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
.cart-sidebar.open { right: 0; }
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 1499; display: none;
}
.cart-overlay.open { display: block; }
.cart__header {
  padding: 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.cart__header h3 { font-size: 1.2rem; }
.cart__items { flex: 1; overflow-y: auto; padding: 20px 24px; }
.cart__item {
  display: flex; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cart__item-img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #f0ebe3; }
.cart__item-info { flex: 1; }
.cart__item-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.cart__item-price { font-size: 0.85rem; color: var(--mid); }
.cart__item-qty {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.qty-btn {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; line-height: 1; transition: all 0.2s;
}
.qty-btn:hover { background: var(--red); color: var(--white); border-color: var(--red); }
.qty-num { font-weight: 600; font-size: 0.9rem; min-width: 16px; text-align: center; }
.cart__footer {
  padding: 20px 24px; border-top: 1px solid var(--border);
}
.cart__total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.1rem; margin-bottom: 16px; }
.cart__empty { text-align: center; padding: 60px 0; color: var(--muted); }
.cart__empty .icon { font-size: 3rem; margin-bottom: 12px; }
#cart-count {
  background: var(--red); color: var(--white);
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 0.7rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 4px; vertical-align: middle;
}

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 32px; align-items: center;
}
.filter-chip {
  padding: 8px 18px; border-radius: 50px;
  border: 1.5px solid var(--border); background: var(--white);
  font-size: 0.85rem; font-weight: 500; color: var(--dark-2);
  cursor: pointer; transition: all 0.2s;
}
.filter-chip:hover, .filter-chip.active {
  background: var(--red); color: var(--white); border-color: var(--red);
}
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 50px; padding: 8px 16px; flex: 1; max-width: 360px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(214,48,49,0.1); }
.search-bar input { border: none; outline: none; font-size: 0.9rem; width: 100%; background: transparent; }
.search-bar svg { color: var(--muted); flex-shrink: 0; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.page-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); font-weight: 600; font-size: 0.875rem;
  transition: all 0.2s; cursor: pointer; background: var(--white);
}
.page-btn:hover, .page-btn.active { background: var(--red); color: var(--white); border-color: var(--red); }

/* ── Cuisine category pills ───────────────────────────────── */
.cuisine-pills { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.cuisine-pills::-webkit-scrollbar { display: none; }
.cuisine-pill {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 24px; border-radius: var(--radius-lg);
  background: var(--white); border: 1.5px solid var(--border);
  cursor: pointer; transition: all 0.2s; min-width: 90px;
}
.cuisine-pill .emoji { font-size: 1.8rem; }
.cuisine-pill span   { font-size: 0.78rem; font-weight: 600; color: var(--mid); }
.cuisine-pill:hover, .cuisine-pill.active {
  border-color: var(--red); background: var(--red-light);
}
.cuisine-pill:hover span, .cuisine-pill.active span { color: var(--red); }

/* ── Menu item card ───────────────────────────────────────── */
.menu-card {
  display: flex; gap: 16px; padding: 16px;
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); transition: box-shadow 0.2s;
}
.menu-card:hover { box-shadow: var(--shadow-md); }
.menu-card__img { width: 90px; height: 90px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #f0ebe3; }
.menu-card__info { flex: 1; }
.menu-card__name { font-weight: 600; margin-bottom: 4px; font-size: 0.95rem; }
.menu-card__desc { font-size: 0.82rem; color: var(--mid); margin-bottom: 8px; line-height: 1.4; }
.menu-card__footer { display: flex; justify-content: space-between; align-items: center; }
.menu-card__price { font-weight: 700; font-size: 1rem; color: var(--dark); }
.add-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--red); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 300; transition: all 0.2s;
}
.add-btn:hover { background: var(--red-dark); transform: scale(1.1); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .navbar__nav, .navbar__actions { display: none; }
  .navbar__mobile-toggle { display: flex; margin-left: auto; }
  .restaurants-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
  .cart-sidebar { width: 100%; right: -100%; }
}
@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
}
