/* ==========================================================================
   Customer Menu - styles.css
   Mobile-first, premium hospitality aesthetic
   For multi-hotel digital menu + WhatsApp ordering platform
   --------------------------------------------------------------------------
   Contents:
     1. Design tokens (branding variables)
     2. Reset and base
     3. Layout utilities
     4. Header
     5. Search
     6. Category pills (sticky)
     7. Menu grid and cards
     8. Badges
     9. Item modal (bottom sheet on mobile)
     10. Cart drawer
     11. Floating cart button
     12. Checkout form
     13. Toasts and empty states
     14. Footer
     15. Breakpoints (640px, 1024px)
     16. Accessibility and motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   Override --primary, --secondary, --accent per hotel via inline style
   or a hotel specific stylesheet. All components use these tokens.
   -------------------------------------------------------------------------- */
:root {
  /* Brand colors */
  --primary: #3f3457;        /* refined plum: premium hospitality actions */
  --primary-dark: #30273f;
  --primary-light: #eeeaf4;
  --secondary: #c7a56a;      /* muted champagne gold */
  --secondary-dark: #a8844d;
  --secondary-light: #f7f0e3;
  --accent: #c97862;         /* soft terracotta for warm CTAs */
  --accent-dark: #a95f4c;
  --accent-light: #faece7;

  /* Neutrals */
  --bg: #f8f6f2;             /* warm ivory */
  --surface: #ffffff;
  --surface-2: #f1eee8;
  --text: #26232a;
  --text-muted: #6d6870;
  --text-light: #9b969d;
  --border: #e7e1d8;
  --border-strong: #d7cec0;

  /* Status */
  --veg: #2e7d32;
  --veg-bg: #e8f5e9;
  --nonveg: #b3261e;
  --nonveg-bg: #fdecea;
  --spicy: #c2410c;
  --spicy-bg: #fff1e6;
  --success: #1b7a3d;
  --success-bg: #e6f4ea;
  --warning: #9a6b00;
  --warning-bg: #fff8e1;
  --danger: #b3261e;
  --danger-bg: #fdecea;

  /* Typography */
  --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --body-size: 16px;         /* min 14px respected, base is 16px */
  --small-size: 14px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Shape and elevation */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(63, 52, 87, 0.08);
  --shadow-md: 0 6px 18px rgba(63, 52, 87, 0.12);
  --shadow-lg: 0 18px 44px rgba(63, 52, 87, 0.18);

  /* Layout */
  --container-max: 1140px;
  --header-h: 64px;
  --pills-h: 56px;
  --touch-min: 44px;         /* minimum touch target */
  --transition: 0.22s ease;
}

/* --------------------------------------------------------------------------
   2. Reset and base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden; /* prevent horizontal scroll */
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--primary);
  margin: 0 0 var(--space-3);
  font-weight: 700;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 var(--space-3); }

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  min-height: var(--touch-min); /* ensure touch target */
  min-width: var(--touch-min);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   3. Layout utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

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

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-8) 0 var(--space-4);
}

.section-title p {
  color: var(--text-muted);
  font-size: var(--small-size);
  margin: 0;
}

/* Prevent layout shift from long words */
.menu-card-title,
.item-modal-title {
  overflow-wrap: break-word;
}

/* --------------------------------------------------------------------------
   4. Header
   Sticky premium header with hotel branding
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--surface);
  /* Accent stripe: the branding accent token's always-visible consumer.
     Mirrors the Hotel Admin branding preview's use of accent as a border. */
  border-bottom: 3px solid var(--accent);
  backdrop-filter: blur(8px);
}

.site-header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-min);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-text { line-height: 1.2; }

.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  display: block;
}

.brand-sub {
  font-size: var(--small-size);
  color: var(--text-muted);
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  transition: background var(--transition), transform var(--transition);
}

.icon-btn:active { transform: scale(0.96); }

/* Language / veg toggle in header */
.header-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-min);
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--small-size);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   5. Search
   -------------------------------------------------------------------------- */
.search-wrap {
  padding: var(--space-4) 0 var(--space-2);
  background: var(--bg);
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field input {
  width: 100%;
  min-height: var(--touch-min);
  padding: var(--space-3) var(--space-4) var(--space-3) 48px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--body-size);
}

.search-field input::placeholder { color: var(--text-light); }

.search-icon {
  position: absolute;
  left: 16px;
  pointer-events: none;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.search-clear {
  position: absolute;
  right: 6px;
  width: var(--touch-min);
  height: var(--touch-min);
  border: 0;
  background: transparent;
  border-radius: 50%;
  color: var(--text-muted);
  display: none;
}

.search-field.has-value .search-clear { display: inline-flex; align-items: center; justify-content: center; }

/* --------------------------------------------------------------------------
   6. Category pills (sticky)
   Horizontal scroll within the strip, page never scrolls horizontally
   -------------------------------------------------------------------------- */
.category-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  background: var(--bg);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.category-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-1) var(--space-4) var(--space-2);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-scroll::-webkit-scrollbar { display: none; }

.pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--small-size);
  font-weight: 600;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.pill[aria-selected="true"],
.pill.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* --------------------------------------------------------------------------
   7. Menu grid and cards
   1 col mobile, 2 col at 640px, 3 col at 1024px
   -------------------------------------------------------------------------- */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding: var(--space-4) 0 var(--space-10);
}

.menu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}

.menu-card:active { transform: translateY(1px); }

.menu-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}

.menu-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-card-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.menu-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.menu-card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.menu-card-desc {
  font-size: var(--small-size);
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.menu-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
}

.price {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.price small {
  font-weight: 500;
  color: var(--text-muted);
  font-size: var(--small-size);
}

/* Add / stepper control */
.add-btn {
  min-height: var(--touch-min);
  padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: var(--small-size);
  letter-spacing: 0.02em;
}

.add-btn.is-added {
  background: var(--surface);
  color: var(--primary);
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--primary);
  color: #fff;
}

.stepper button {
  width: var(--touch-min);
  height: var(--touch-min);
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.stepper span {
  min-width: 32px;
  text-align: center;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   8. Badges
   -------------------------------------------------------------------------- */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

/* Veg / non-veg square mark pattern */
.diet-mark {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.diet-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: block;
}

.badge-veg {
  background: var(--veg-bg);
  color: var(--veg);
  border-color: var(--veg);
}

.badge-veg .diet-mark { border-color: var(--veg); color: var(--veg); }

.badge-nonveg {
  background: var(--nonveg-bg);
  color: var(--nonveg);
  border-color: var(--nonveg);
}

.badge-nonveg .diet-mark { border-color: var(--nonveg); color: var(--nonveg); }
.badge-nonveg .diet-mark::after { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

.badge-spicy {
  background: var(--spicy-bg);
  color: var(--spicy);
  border-color: #f0c9a8;
}

.badge-bestseller {
  background: var(--secondary-light);
  color: #7a5a1f;
  border-color: var(--secondary);
}

/* Card corner ribbon for bestseller */
.ribbon {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
}

/* --------------------------------------------------------------------------
   9. Item modal (bottom sheet on mobile, centered dialog on desktop)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(48, 39, 63, 0.55);
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal-backdrop.is-open { display: flex; }

.item-modal {
  width: 100%;
  max-height: 92vh;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: sheet-up 0.28s ease;
}

@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.item-modal-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
}

.item-modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: var(--touch-min);
  height: var(--touch-min);
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.95);
  color: var(--text);
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.item-modal-body {
  padding: var(--space-5) var(--space-4) var(--space-4);
  overflow-y: auto;
}

.item-modal-title {
  font-size: 1.35rem;
  margin-bottom: var(--space-2);
}

.item-modal-price {
  font-size: 1.15rem;
  font-weight: 800;
  margin: var(--space-2) 0;
}

.option-group { margin: var(--space-4) 0; }

.option-group legend,
.option-label {
  font-weight: 700;
  font-size: var(--small-size);
  margin-bottom: var(--space-2);
  color: var(--primary);
}

.option-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--touch-min);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.option-item label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-height: var(--touch-min);
  font-size: var(--small-size);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.modal-foot {
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.modal-foot .add-btn,
.modal-foot .stepper { flex-shrink: 0; }

.modal-total {
  margin-left: auto;
  text-align: right;
}

.modal-total strong { display: block; font-size: 1.1rem; }
.modal-total span { font-size: var(--small-size); color: var(--text-muted); }

/* --------------------------------------------------------------------------
   10. Cart drawer (slides from right, full width sheet on small phones)
   -------------------------------------------------------------------------- */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(48,39,63,0.5);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.cart-backdrop.is-open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 71;
  width: 100%;
  max-width: 420px;
  height: 100dvh;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(105%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.is-open { transform: translateX(0); }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.cart-head h2 { margin: 0; font-size: 1.2rem; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.cart-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.cart-item-info { min-width: 0; }
.cart-item-info strong {
  display: block;
  font-size: var(--small-size);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-info span { font-size: var(--small-size); color: var(--text-muted); }

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.qty-btn {
  width: var(--touch-min);
  height: var(--touch-min);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-foot {
  border-top: 1px solid var(--border);
  padding: var(--space-4);
  background: var(--surface);
}

.cart-totals { display: grid; gap: var(--space-1); margin-bottom: var(--space-4); font-size: var(--small-size); }
.cart-totals .row { display: flex; justify-content: space-between; }
.cart-totals .grand { font-size: 1rem; font-weight: 800; color: var(--primary); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: var(--body-size);
  transition: transform var(--transition), background var(--transition);
  text-align: center;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--border-strong); }
.btn-whatsapp { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------------------
   11. Floating cart button
   -------------------------------------------------------------------------- */
.fab-cart {
  position: fixed;
  left: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-weight: 700;
}

.fab-cart.is-visible { display: inline-flex; }

.fab-cart-count {
  min-width: var(--touch-min);
  height: var(--touch-min);
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--secondary);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   12. Checkout form
   -------------------------------------------------------------------------- */
.checkout-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
  margin: var(--space-4) 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.field { display: grid; gap: var(--space-2); }

.field label {
  font-size: var(--small-size);
  font-weight: 700;
  color: var(--primary);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: var(--touch-min);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: var(--body-size);
}

.field textarea { min-height: 96px; resize: vertical; }

.field-hint { font-size: var(--small-size); color: var(--text-muted); }
.field-error { font-size: var(--small-size); color: var(--danger); font-weight: 600; }

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-bg);
}

/* --------------------------------------------------------------------------
   13. Toasts and empty states
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(92vw, 420px);
}

.toast {
  background: var(--primary);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: var(--small-size);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  color: var(--text-muted);
}

.empty-state h3 { color: var(--primary); }

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--primary);
  color: #e9e2d0;
  padding: var(--space-8) 0;
  margin-top: var(--space-8);
}

.site-footer a { color: #fff; }
.site-footer p { font-size: var(--small-size); color: #c9c2ae; }

/* --------------------------------------------------------------------------
   15. Breakpoints
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  h1 { font-size: 2.1rem; }

  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
  }

  .modal-backdrop {
    align-items: center;
    padding: var(--space-6);
  }

  .item-modal {
    max-width: 560px;
    border-radius: var(--radius-lg);
  }

  .fab-cart {
    left: auto;
    right: var(--space-6);
    bottom: var(--space-6);
    min-width: 320px;
  }

  .form-grid.two-col { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .menu-grid { grid-template-columns: repeat(3, 1fr); }

  .site-header-inner { gap: var(--space-6); }

  .search-wrap { padding: var(--space-5) 0 var(--space-3); }

  .menu-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
  }

  /* Keep hover as enhancement only, focus does the same */
  .menu-card:focus-within {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
  }

  .checkout-section { padding: var(--space-6); }
}

/* --------------------------------------------------------------------------
   16. Accessibility and motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast support */
@media (forced-colors: active) {
  .btn-primary, .add-btn, .pill[aria-selected="true"] {
    forced-color-adjust: none;
  }
}

/* ==========================================================================\n   Compatibility / current index.html layout fixes\n   The customer HTML uses these class names. This block intentionally maps\n   the current markup to the premium mobile-first layout.\n   ========================================================================== */

/* Header */
.site-header { min-height: var(--header-h); height: auto; }
.header-inner {
  width: 100%; max-width: var(--container-max); margin: 0 auto;
  min-height: var(--header-h); padding: 0 var(--space-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.header-inner .brand { flex: 1; min-width: 0; }
.brand-logo { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; flex: 0 0 auto; }
.brand-name { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tagline { margin: 2px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nav-toggle { flex: 0 0 auto; }
.header-actions { flex: 0 0 auto; }
.hotel-meta { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-4) var(--space-3); color: var(--text-muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }

/* Search */
.search-wrap { position: relative; padding: var(--space-3) var(--space-4); background: var(--bg); }
.search-inner { width: 100%; max-width: var(--container-max); margin: 0 auto; }
.search-form { position: relative; display: flex; align-items: center; }
.search-input {
  width: 100%; min-height: var(--touch-min); padding: 10px 48px 10px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface);
  outline: none;
}
.search-input:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(199,165,106,.16); }
.search-clear { position: absolute; right: 4px; border: 0; background: transparent; }
.filter-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.chip-toggle {
  min-height: 40px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text-muted); font-size: 13px; font-weight: 700; white-space: nowrap; display: inline-flex;
  flex: 0 0 auto; flex-shrink: 0; align-items: center; justify-content: center; gap: 9px;
}
.chip-toggle.active, .chip-toggle[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.veg-dot {
  display: block;
  flex: 0 0 10px;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin: 0;
  border: 2px solid #1b8a3d;
  border-radius: 50%;
  background: #fff;
}
.filter-pill-label { flex: 0 0 auto; flex-shrink: 0; white-space: nowrap; line-height: 1; }
.veg-dot.nonveg-dot {
  border-color: #d33;
}
.sort-label { margin-left: auto; flex: 0 0 auto; }
.sort-select { min-height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; background: var(--surface); }

/* Category navigation */
.category-nav { position: sticky; top: 0; z-index: 30; background: rgba(248,246,242,.96); border-bottom: 1px solid var(--border); }
.category-nav-inner { width: 100%; max-width: var(--container-max); margin: 0 auto; overflow-x: auto; }
.category-list { list-style: none; display: flex; gap: 8px; margin: 0; padding: 10px var(--space-4); overflow-x: auto; scrollbar-width: none; }
.category-list::-webkit-scrollbar { display: none; }
.category-list li { flex: 0 0 auto; }
.category-list .chip-toggle { min-height: 38px; }

/* Main + hero */
.main { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-4); }
.hero { margin: var(--space-4) 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.hero-image { width: 100%; max-height: 220px; object-fit: cover; }
.hero-body { padding: var(--space-4); }
.hero-description { margin: 0; color: var(--text-muted); line-height: 1.55; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-muted); font-size: 12px; font-weight: 700; }
.badge-veg { background: var(--veg-bg); color: var(--veg); }
.menu-section { padding-top: var(--space-2); }

/* Menu cards */
.menu-card { min-width: 0; }
.menu-card-image { width: 100%; max-height: 220px; object-fit: cover; }
.menu-card-title-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.menu-card-title-row h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.menu-card-description { color: var(--text-muted); font-size: 14px; line-height: 1.5; margin: 0; }
.menu-card-tags { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.menu-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.menu-card-bottom strong { white-space: nowrap; }
.veg-mark { width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 2px; display: inline-block; flex: 0 0 auto; margin-top: 3px; position: relative; }
.veg-mark::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; position: absolute; left: 2px; top: 2px; }
.veg-mark.veg { color: var(--veg); }
.veg-mark.nonveg { color: var(--nonveg); }
.veg-mark.unknown { color: var(--text-light); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--touch-min); padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid transparent; font-weight: 700; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--primary); border-color: transparent; }
.btn-block { width: 100%; }
.btn-large { min-height: 50px; }

/* Loading / empty / not-found */
.app-loading { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: menu-spin .8s linear infinite; }
@keyframes menu-spin { to { transform: rotate(360deg); } }
.empty-state { padding: 40px 16px; text-align: center; color: var(--text-muted); }
.empty-icon { font-size: 34px; margin-bottom: 8px; }
.not-found { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.not-found-card { width: min(520px, 100%); padding: 28px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.not-found-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.not-found-hint { color: var(--text-muted); font-size: 13px; }

/* Cart */
.cart-fab { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; min-height: 58px; padding: 8px 14px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 16px; background: var(--primary); color: #fff; box-shadow: var(--shadow-lg); }
.cart-fab-icon { font-size: 22px; }
.cart-fab-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; flex: 1; }
.cart-fab-count { font-weight: 800; font-size: 13px; }
.cart-fab-total { font-weight: 700; font-size: 12px; opacity: .9; }
.cart-fab-cta { font-weight: 800; }
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.42); }
.cart-drawer { position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg); padding: 16px; }
.cart-drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-drawer-header h2 { margin: 0; }
.cart-hotel-line { color: var(--text-muted); font-size: 13px; }
.cart-items { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.cart-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 38px; min-width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); }
.cart-footer { padding-top: 10px; border-top: 1px solid var(--border); }
.cart-row { display: flex; justify-content: space-between; gap: 12px; }
.cart-note { font-size: 12px; color: var(--text-muted); }

/* Modals */
.modal { width: min(620px, calc(100% - 24px)); max-height: 90vh; border: 0; border-radius: 20px; padding: 0; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(0,0,0,.48); }
.modal-card { padding: 20px; overflow: auto; max-height: 90vh; }
.modal-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-title-row { display: flex; align-items: flex-start; gap: 8px; }
.modal-title-row h2 { margin: 0; }
.modal-close { flex: 0 0 auto; }
.modal-image { width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; margin-bottom: 14px; }
.modal-body { padding-top: 8px; }
.modal-description { color: var(--text-muted); }
.modal-price { font-size: 20px; font-weight: 800; color: var(--primary); }
.field { display: grid; gap: 6px; margin: 14px 0; }
.text-input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.modal-note-label { display: block; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segmented-option { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.checkout-form { display: grid; gap: 12px; }
.order-type-fieldset { border: 0; padding: 0; margin: 0; }
.order-summary { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.summary-list { margin: 8px 0; padding-left: 20px; }
.summary-total { display: flex; justify-content: space-between; font-weight: 800; }
.checkout-hint, .muted { color: var(--text-muted); font-size: 13px; }
.field-error { color: var(--danger); font-size: 12px; }

/* Footer + misc */
.site-footer { padding: 36px 16px 100px; text-align: center; background: var(--primary); color: #fff; }
.site-footer p { margin: 0 0 6px; color: rgba(255,255,255,.9); }
.footer-note { font-size: 12px; opacity: .75; }
.skip-link { position: fixed; left: 8px; top: 8px; z-index: 200; transform: translateY(-150%); background: var(--primary); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.toast-region { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(20px); z-index: 120; opacity: 0; pointer-events: none; background: #222; color: #fff; padding: 10px 14px; border-radius: 10px; transition: opacity .2s ease, transform .2s ease; }
.toast-region.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 640px) {
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cart-fab { left: auto; right: 20px; width: auto; min-width: 230px; }
}
@media (min-width: 1024px) {
  .header-inner, .hotel-meta, .search-inner, .category-nav-inner, .main { padding-left: 20px; padding-right: 20px; }
  .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cart-drawer { left: auto; width: 430px; max-height: 100vh; border-radius: 20px 0 0 20px; }
}


/* ===== FINAL CUSTOMER-MENU MOBILE FIX ===== */
[hidden] { display: none !important; }

/* Keep the customer header compact and prevent text collisions on phones. */
.header-inner { min-height: 64px; }
.header-inner .brand { min-width: 0; overflow: hidden; }
.brand-text { min-width: 0; overflow: hidden; }
.brand-name, .brand-tagline { max-width: 100%; }

/* Search/filter area should never overlap the header. */
.search-wrap { position: relative; z-index: 20; }
.search-inner { overflow: visible; }
.filter-row { min-width: 0; }

/* Category strip is horizontal and contained. */
.category-nav { position: sticky; top: 64px; z-index: 30; }
.category-list { flex-wrap: nowrap; }

/* Cart: hidden until the user taps View cart; mobile opens as a bottom sheet. */
.cart-drawer {
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  max-height: 88vh !important;
  transform: translateY(105%) !important;
  transition: transform .28s ease !important;
  border-radius: 20px 20px 0 0 !important;
  overflow-y: auto !important;
}
.cart-drawer[hidden] { display: none !important; }
.cart-drawer.is-open { transform: translateY(0) !important; }
.scrim[hidden] { display: none !important; }

@media (min-width: 768px) {
  .cart-drawer {
    top: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    right: 0 !important;
    width: min(430px, 100vw) !important;
    max-height: 100vh !important;
    height: 100vh !important;
    transform: translateX(105%) !important;
    border-radius: 20px 0 0 20px !important;
  }
  .cart-drawer.is-open { transform: translateX(0) !important; }
}

/* Avoid a blank/loading layer remaining above the actual menu. */
.app-loading[hidden] { display: none !important; }
.app-shell[hidden] { display: none !important; }

/* Clean mobile menu cards. */
.menu-card-body { min-width: 0; }
.menu-card-title-row h3 { overflow-wrap: anywhere; word-break: normal; }
.menu-card-description { overflow-wrap: anywhere; }

@media (max-width: 639px) {
  .container, .main { padding-left: 12px; padding-right: 12px; }
  .header-inner { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .brand-name { font-size: 1rem; }
  .brand-tagline { font-size: 11px; }
  .search-wrap { padding: 10px 12px; }
  .category-list { padding-left: 12px; padding-right: 12px; }
  .menu-grid { gap: 12px; }
  .menu-card-body { padding: 12px; }
}

/* Pre-publish customer preview */
.preview-mode-note {
  margin: 12px auto 0;
  width: min(92%, 760px);
  padding: 10px 14px;
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  background: #fff7df;
  color: #5f4a12;
  border: 1px solid #ead58a;
  overflow-wrap: anywhere;
}

/* Optional hotel ordering status: only rendered when the hotel enables it. */
.ordering-status-banner { margin: .75rem auto; max-width: 1100px; padding: .75rem 1rem; border-radius: .75rem; font-weight: 600; text-align: center; }
.ordering-status-banner.is-open { background: #eaf8ef; color: #176b35; }
.ordering-status-banner.is-closed { background: #fff2f2; color: #9d2222; }

/* Customer order status: shown for the order this page just placed. */
.order-status-card { margin: .75rem auto; max-width: 1100px; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); }
.order-status-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.order-status-head h2 { margin: 0; font-size: 1rem; }
.order-status-id { margin: .25rem 0 0; color: var(--text-muted); font-size: .875rem; }
.order-status-line { display: flex; align-items: center; gap: .5rem; margin: .35rem 0 0; font-weight: 600; }
.order-status-dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--text-light); flex: 0 0 auto; }
.order-status-dot[data-status="new"] { background: var(--text-muted); }
.order-status-dot[data-status="accepted"] { background: var(--warning); }
.order-status-dot[data-status="preparing"] { background: var(--accent); }
.order-status-dot[data-status="ready"] { background: var(--success); }
.order-status-dot[data-status="completed"] { background: var(--success); }
.order-status-dot[data-status="cancelled"] { background: var(--danger); }
.order-status-note { margin: .35rem 0 0; }

/* Bilingual item names: English first, Marathi second (stacked). */
.bilingual-name-mr { display: block; font-size: .88em; font-weight: 600; opacity: .85; margin-top: 2px; }
