/* ============================================================
   XionPOS Menu — "Natural" UI
   Simple, clean, calm. Plain light background, white cards,
   thin borders, subtle accents. Theme colors (--primary/--accent)
   come from restaurant settings and are used sparingly.
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  --primary: #c2185b;
  --primary-dark: #9c1248;
  --secondary: #ffffff;
  --dark: #1c1c1c;
  --light: #ffffff;
  --accent: #8d6e63;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f6f6;
  --border: #ececec;
  --border-strong: #dcdcdc;

  --text: #1f1f1f;
  --text-soft: #555555;
  --muted: #909090;

  --veg: #1f8a4c;
  --nonveg: #c0392b;
  --gold: #b7791f;

  --primary-soft: color-mix(in srgb, var(--primary) 8%, white);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.14);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  --ease: ease;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- 2. Base ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
select {
  font-family: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* Bootstrap-style helpers used by JS-rendered states */
.text-center { text-align: center; }
.py-5 { padding: 3rem 0; }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }

/* ---------- 3. App shell ---------- */
.app-shell {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ---------- 4. Hero ---------- */
.hero-header {
  position: relative;
  padding: 44px 20px 24px;
  text-align: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-section {
  margin-bottom: 14px;
}

.logo-halo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.restaurant-logo {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 50%;
}

.restaurant-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 5.5vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 10px;
}

.restaurant-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: center;
}

.info-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-soft);
}

.info-item i {
  color: var(--muted);
  font-size: 13px;
}

.hero-scroll-hint {
  margin: 22px auto 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  animation: hint-bounce 2s ease-in-out infinite;
}

@keyframes hint-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(5px); opacity: 1; }
}

/* ---------- 5. Sticky controls ---------- */
.menu-controls {
  position: sticky;
  top: 0;
  z-index: 600;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding-top: 10px;
  transition: box-shadow 0.2s var(--ease);
}

.menu-controls.scrolled {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  flex-wrap: wrap;
}

.search-section {
  flex: 1 1 auto;
  min-width: 200px;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 5px 5px 12px;
}

.search-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.search-icon {
  color: var(--muted);
  font-size: 13px;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  padding: 7px 0;
  color: var(--text);
}

.search-input::placeholder {
  color: var(--muted);
}

.search-toggle-btn,
.clear-search-btn,
.category-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  flex-shrink: 0;
}

.search-toggle-btn:hover,
.clear-search-btn:hover,
.category-icon-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.clear-search-btn {
  display: none;
}

.search-container.active .search-toggle-btn {
  display: none;
}

.search-container.active .clear-search-btn {
  display: inline-flex;
}

.category-icon-btn {
  color: var(--primary);
}

/* Food type inline */
.food-type-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.food-type-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.food-type-all.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.food-type-switch {
  display: flex;
  align-items: center;
  gap: 7px;
}

.switch-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}

.switch-track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #dfe8e1;
  position: relative;
  display: inline-block;
  cursor: pointer;
  flex-shrink: 0;
}

.switch-track input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s var(--ease);
}

.food-type-switch.non-veg .switch-track {
  background: #edd6d3;
}

.food-type-switch.non-veg .switch-thumb {
  transform: translateX(20px);
  background: var(--nonveg);
}

.food-type-switch.non-veg .switch-label:nth-of-type(2) {
  color: var(--nonveg);
  font-weight: 700;
}

/* Desktop category filter */
.desktop-only {
  display: none;
}

/* Category chips (inside sticky controls) */
.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.category-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.category-chip.active {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 35%, white);
  color: var(--primary-dark);
}

/* ---------- 6. Menu ---------- */
#menu-container {
  padding: 4px 16px 40px;
}

.menu-section {
  scroll-margin-top: 122px;
  margin-top: 24px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  color: var(--text);
  margin-bottom: 12px;
}

.menu-row-list {
  display: flex;
  flex-direction: column;
}

/* Card */
.menu-row-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.menu-row-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.row-image {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
}

.row-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--gold);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.row-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 2px 0;
}

.item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.featured-star {
  color: var(--gold);
  font-size: 12px;
}

.item-description {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preparation-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* Food type indicator */
.food-type-indicator {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  flex-shrink: 0;
}

.food-type-indicator.veg {
  border: 1.5px solid var(--veg);
  color: var(--veg);
}

.food-type-indicator.non-veg {
  border: 1.5px solid var(--nonveg);
  color: var(--nonveg);
}

.row-image .food-type-indicator {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
}

/* Row footer + price */
.row-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  flex-wrap: wrap;
}

.item-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.availability {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: capitalize;
  padding: 2px 8px;
  border-radius: 999px;
}

.availability.available {
  background: color-mix(in srgb, var(--veg) 10%, white);
  color: var(--veg);
}

.availability.unavailable {
  background: color-mix(in srgb, var(--nonveg) 10%, white);
  color: var(--nonveg);
}

.availability.seasonal {
  background: color-mix(in srgb, var(--gold) 12%, white);
  color: var(--gold);
}

/* Compact (no-image) cards */
.menu-row-card.compact .item-description {
  -webkit-line-clamp: 3;
}

/* ---------- 7. Featured slider ---------- */
.featured-section {
  margin-top: 20px;
}

.featured-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.featured-header .section-title {
  margin-bottom: 0;
}

.scroll-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.scroll-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.scroll-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.scroll-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.featured-slider {
  overflow: hidden;
}

.featured-track {
  display: flex;
  gap: 14px;
  transition: transform 0.4s var(--ease);
}

.featured-item {
  flex-shrink: 0;
  width: 240px;
}

.featured-item .menu-row-card {
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.featured-item .row-image {
  width: 100%;
  height: 140px;
}

.featured-item .row-content {
  padding-top: 10px;
}

/* ---------- 8. Footer ---------- */
.footer {
  padding: 24px 16px 48px;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-logo-img {
  height: 30px;
  width: auto;
  opacity: 0.6;
}

.footer-text {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 9. Scroll to top ---------- */
.scroll-to-top {
  position: fixed;
  right: 16px;
  bottom: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s var(--ease);
  z-index: 500;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- 10. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

/* ---------- 11. Modals ---------- */
.category-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 20px;
}

.category-modal.active {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 360px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.close-modal,
.close-banner-modal,
.item-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover,
.close-banner-modal:hover,
.item-modal-close:hover {
  color: var(--text);
}

.category-list {
  list-style: none;
  overflow-y: auto;
  padding: 8px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-soft);
}

.category-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.category-item.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.category-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.category-item.active .category-icon {
  background: var(--surface);
}

/* Banner modal */
.banner-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 16px;
}

.banner-modal.active {
  display: flex;
}

.banner-modal-content {
  position: relative;
  max-width: 460px;
  width: 100%;
}

.close-banner-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
}

.banner-image-container {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.banner-image-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* Item modal (bottom sheet) */
.item-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}

.item-modal.active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.item-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.item-modal-content {
  position: relative;
  background: var(--surface);
  width: 100%;
  max-width: 540px;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-lg);
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
}

.item-modal.active .item-modal-content {
  transform: translateY(0);
}

.item-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
}

.item-modal-body {
  display: flex;
  flex-direction: column;
}

.item-modal-image {
  width: 100%;
  height: 210px;
  background: var(--surface-2);
}

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

.item-modal-details {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#item-modal-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
}

.item-modal-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: var(--gold);
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

#item-modal-description {
  font-size: 14px;
  color: var(--text-soft);
}

.item-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.item-modal-price {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.item-modal-availability,
.item-modal-meta {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
}

.item-modal-meta-row {
  justify-content: flex-start;
}

/* ---------- 12. Swipe up cue ---------- */
.swipe-up-cue {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  bottom: 20px;
  z-index: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.swipe-up-cue.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.swipe-up-cue-icon {
  color: var(--muted);
  animation: hint-bounce 1.6s ease-in-out infinite;
}

.swipe-up-cue-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
}

/* ---------- 13. Reveal animation ---------- */
.menu-section.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.menu-section.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 14. Loading / error ---------- */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--primary);
}

.error-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--text);
}

.error-message > i {
  font-size: 38px;
  color: var(--nonveg);
  margin-bottom: 14px;
}

.error-message h3 {
  font-family: var(--font-display);
  font-size: 19px;
  margin-bottom: 8px;
}

.error-message p {
  color: var(--text-soft);
  margin-bottom: 16px;
}

/* ---------- 15. Opening loader ---------- */
.opening-menu-loader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.opening-menu-loader.hidden {
  display: none;
}

.loader-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

.video-loader-spinner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-weight: 600;
  transition: opacity 0.4s ease;
}

.video-loader-spinner p {
  font-size: 14px;
}

.modern-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loader-orb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--primary);
  animation: loader-bounce 1.2s ease-in-out infinite;
}

.loader-orb-2 {
  animation-delay: 0.15s;
}

.loader-orb-3 {
  animation-delay: 0.3s;
}

@keyframes loader-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-8px); opacity: 1; }
}

/* ---------- 16. Legacy banner carousel (unused) ---------- */
.banner-container,
.banner-carousel {
  display: none;
}

/* ---------- 17. Responsive ---------- */
@media (min-width: 769px) {
  .desktop-only {
    display: block;
  }

  .category-icon-btn {
    display: none;
  }

  .controls-row {
    flex-wrap: nowrap;
    padding: 0 16px;
  }

  #menu-container {
    padding: 8px 24px 40px;
  }

  .menu-section {
    scroll-margin-top: 110px;
  }

  .menu-row-list {
    gap: 0;
  }

  .row-image {
    width: 112px;
    height: 112px;
  }

  .item-modal-content {
    margin: auto;
    border-radius: var(--radius);
    max-height: 82vh;
  }

  .item-modal {
    align-items: center;
  }

  .item-modal-body {
    flex-direction: row;
  }

  .item-modal-image {
    width: 44%;
    height: auto;
    min-height: 300px;
  }

  .item-modal-details {
    flex: 1;
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
