/* Megha Hotel – Urlabari restaurant design */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap');

:root {
  --primary: #7B2D26;       /* deep maroon */
  --primary-dark: #5C1F1A;
  --primary-soft: #9B3D35;
  --accent: #C4A35A;        /* muted gold */
  --accent-soft: #E8D5A3;
  --bg: #FAF7F2;            /* warm paper */
  --bg-alt: #F0EBE3;
  --surface: #FFFFFF;
  --text: #1C1917;
  --text-muted: #78716C;
  --border: #E7E0D5;
  --success: #3D6B4F;
  --error: #B91C1C;
  --warning: #B45309;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(28,25,23,0.06), 0 4px 16px rgba(28,25,23,0.04);
  --shadow-lg: 0 8px 30px rgba(28,25,23,0.1);
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --nav-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(64px + var(--safe-bottom)); /* space for mobile bottom nav */
}

@media (min-width: 769px) {
  body { padding-bottom: 0; }
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container { width: min(1080px, 92%); margin-inline: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.85rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.45rem, 3.5vw, 2rem); }
h3 { font-size: 1.15rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.8rem 1.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.92rem; font-family: var(--font);
  border: 1.5px solid transparent; cursor: pointer;
  transition: background var(--transition), transform 0.15s ease, box-shadow var(--transition);
  text-decoration: none; line-height: 1.2;
  min-height: 44px; /* touch target */
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(123, 45, 38, 0.25);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline {
  background: transparent; color: var(--primary); border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-accent {
  background: var(--accent); color: var(--text); border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-soft); }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.85rem; min-height: 36px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Top navbar */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding-top: env(safe-area-inset-top, 0);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  width: min(1080px, 92%);
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 700;
  color: var(--primary);
}
.nav-logo { height: 36px; width: auto; max-width: 100px; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 1.25rem; list-style: none; }
.nav-links a {
  color: var(--text-muted); font-weight: 500; font-size: 0.9rem;
  padding: 0.35rem 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer; padding: 0.5rem;
  min-width: 44px; min-height: 44px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text);
  margin: 5px auto; border-radius: 1px;
}

/* Mobile: hide desktop nav links, use bottom bar */
@media (max-width: 768px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface);
    flex-direction: column; gap: 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block; padding: 0.9rem 1.25rem; width: 100%;
    border-bottom: 1px solid var(--border);
  }
}

/* Bottom app nav (mobile only) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.35rem 0 calc(0.35rem + var(--safe-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
@media (max-width: 768px) {
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  padding: 0.4rem 0.25rem;
  color: var(--text-muted);
  font-size: 0.68rem; font-weight: 500;
  text-decoration: none;
  min-height: 52px; justify-content: center;
}
.bottom-nav a svg, .bottom-nav a .bn-icon {
  width: 22px; height: 22px; stroke: currentColor; fill: none;
  stroke-width: 1.75;
}
.bottom-nav a.active, .bottom-nav a:hover {
  color: var(--primary);
}
.bottom-nav .bn-badge {
  position: absolute; top: 2px; right: calc(50% - 18px);
  background: var(--primary); color: #fff;
  font-size: 0.65rem; min-width: 16px; height: 16px;
  border-radius: 8px; display: none; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* Hero */
.hero {
  position: relative;
  padding: 4rem 0 4.5rem;
  min-height: 52vh;
  display: flex;
  align-items: center;
  background: linear-gradient(160deg, #5C1F1A 0%, #7B2D26 45%, #9B3D35 100%);
  color: #fff;
  overflow: hidden;
}
@media (min-width: 900px) {
  .hero {
    min-height: 72vh;
    padding: 5rem 0 5.5rem;
  }
  .hero-content { max-width: 640px; }
  .hero h1 { font-size: clamp(2.4rem, 4vw, 3.4rem); }
  .hero p { font-size: 1.15rem; max-width: 34rem; }
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 20%, rgba(196,163,90,0.2), transparent 55%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 560px; }
.hero h1 { color: #fff; margin-bottom: 0.65rem; }
.hero p { color: rgba(255,255,255,0.88); font-size: 1.05rem; margin-bottom: 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero .btn-primary {
  background: var(--accent); color: var(--text); border-color: var(--accent);
  box-shadow: none;
}
.hero .btn-primary:hover { background: var(--accent-soft); color: var(--text); }
.hero .btn-outline {
  border-color: rgba(255,255,255,0.55); color: #fff;
}
.hero .btn-outline:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Sections */
.section { padding: 2.75rem 0; }
.section-alt { background: var(--bg-alt); }
.section-header { margin-bottom: 1.5rem; }
.section-header h2 { margin-bottom: 0.35rem; }
.section-header p { color: var(--text-muted); font-size: 0.95rem; }
.section-header h2::after {
  content: ''; display: block; width: 28px; height: 3px;
  background: var(--accent); margin-top: 0.5rem; border-radius: 2px;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.15rem;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-img {
  aspect-ratio: 4/3; object-fit: cover; width: 100%; background: var(--bg-alt);
}
.card-body { padding: 1rem 1.1rem 1.2rem; }
.card-body h3 { margin-bottom: 0.3rem; font-size: 1.1rem; }
.card-body p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 0.65rem; }
.price { font-weight: 700; color: var(--primary); font-size: 1.05rem; }

/* Category cards */
.category-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
}
.category-card {
  position: relative; display: block; border-radius: 12px; overflow: hidden;
  aspect-ratio: 1; box-shadow: var(--shadow); color: #fff;
}
.category-card img { width: 100%; height: 100%; object-fit: cover; }
.category-card-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--primary); font-family: var(--font-display); font-size: 2rem; color: var(--accent-soft);
}
.category-card-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.5rem 0.65rem 0.65rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.72));
}
.category-card-label h3 { font-size: 0.95rem; margin: 0; color: #fff; }

/* Menu */
.menu-filters {
  display: flex; flex-wrap: nowrap; gap: 0.5rem; margin-bottom: 1.25rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.35rem;
  scrollbar-width: none;
}
.menu-filters::-webkit-scrollbar { display: none; }
.menu-filters a {
  flex-shrink: 0;
  padding: 0.5rem 1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.85rem; font-weight: 500;
  white-space: nowrap;
}
.menu-filters a.active, .menu-filters a:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.menu-search { margin-bottom: 1rem; }
.menu-search input {
  width: 100%; padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 1rem; font-family: var(--font);
}
.menu-item-row {
  display: flex; gap: 1rem; padding: 1rem;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 0.75rem;
  align-items: flex-start;
}
.menu-item-row img, .menu-item-row > div:first-child {
  width: 88px; height: 88px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
}
.menu-item-info { flex: 1; min-width: 0; }
.menu-item-info h3 { font-size: 1.05rem; margin-bottom: 0.2rem; }
.menu-item-info p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.45rem; }
.menu-item-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-weight: 500; font-size: 0.88rem; margin-bottom: 0.35rem; color: var(--text);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.75rem 0.9rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 1rem; font-family: var(--font);
  color: var(--text); min-height: 44px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(123,45,38,0.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

/* Alerts */
.alert { padding: 0.85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.92rem; }
.alert-error { background: #FEF2F2; color: var(--error); border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: var(--success); border: 1px solid #BBF7D0; }
.alert-info { background: #FFFBEB; color: var(--warning); border: 1px solid #FDE68A; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  font-size: 0.72rem; font-weight: 600;
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.35rem;
  border-radius: 999px;
}

/* Timeline track */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative; padding: 0.65rem 0 0.65rem 1.75rem;
  border-left: 2px solid var(--border); margin-left: 0.5rem;
  color: var(--text-muted);
}
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: 0.9rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--border); border: 2px solid var(--bg);
}
.timeline li.done { color: var(--text); border-left-color: var(--success); }
.timeline li.done::before { background: var(--success); }
.timeline li.current { color: var(--primary); font-weight: 600; border-left-color: var(--primary); }
.timeline li.current::before { background: var(--primary); box-shadow: 0 0 0 3px rgba(123,45,38,0.2); }

/* Footer */
.footer {
  background: #1C1917; color: rgba(255,255,255,0.75);
  padding: 2.5rem 0 calc(2rem + var(--safe-bottom));
  margin-top: 2rem; font-size: 0.9rem;
}
@media (max-width: 768px) {
  .footer { margin-bottom: 0; padding-bottom: calc(5rem + var(--safe-bottom)); }
}
.footer a { color: var(--accent-soft); }
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem; margin-bottom: 1.5rem;
}
.footer h4 {
  font-family: var(--font); font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: #fff; margin-bottom: 0.65rem; font-weight: 600;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.25rem; text-align: center; font-size: 0.82rem;
}

/* Cart summary */
.cart-summary {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.25rem; border: 1px solid var(--border); margin-top: 1rem;
}
.cart-summary .row {
  display: flex; justify-content: space-between; padding: 0.35rem 0;
}
.cart-summary .row.total {
  font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border);
  margin-top: 0.5rem; padding-top: 0.75rem; color: var(--primary);
}

/* Empty */
.empty-state {
  text-align: center; padding: 2.5rem 1rem; color: var(--text-muted);
}

/* Panel */
.panel {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.25rem; border: 1px solid var(--border); box-shadow: var(--shadow);
}

/* PWA install banner – shows ~10s on load */
.pwa-banner {
  display: none;
  position: fixed; left: 0.75rem; right: 0.75rem;
  bottom: calc(72px + var(--safe-bottom));
  z-index: 250;
  background: #1C1917; color: #fff;
  border-radius: 12px; padding: 0.85rem 0.9rem;
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
  align-items: center; gap: 0.65rem;
  animation: pwaSlideUp 0.35s ease;
}
@media (min-width: 769px) {
  .pwa-banner { bottom: 1.25rem; max-width: 480px; left: 50%; right: auto; transform: translateX(-50%); }
  .pwa-banner.show { transform: translateX(-50%); }
}
.pwa-banner.show { display: flex; }
.pwa-banner-text { flex: 1; min-width: 0; }
.pwa-banner-text strong { display: block; font-size: 0.9rem; margin-bottom: 0.15rem; }
.pwa-banner-text span { font-size: 0.78rem; color: rgba(255,255,255,0.78); line-height: 1.35; display: block; }
.pwa-banner .btn { min-height: 36px; padding: 0.4rem 0.85rem; font-size: 0.82rem; flex-shrink: 0; }
.pwa-banner .pwa-close {
  background: none; border: none; color: rgba(255,255,255,0.55);
  font-size: 1.35rem; cursor: pointer; padding: 0.15rem 0.35rem; line-height: 1; flex-shrink: 0;
}
@keyframes pwaSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (min-width: 769px) {
  @keyframes pwaSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
}

/* Standalone (installed PWA) tweaks */
@media all and (display-mode: standalone) {
  .navbar { border-bottom-color: transparent; }
  body { user-select: none; -webkit-user-select: none; }
  input, textarea { user-select: text; -webkit-user-select: text; }
}

/* Status badges public */
.status-badge {
  display: inline-block; padding: 0.2rem 0.55rem; border-radius: 6px;
  font-size: 0.78rem; font-weight: 600; text-transform: capitalize;
}
.status-placed { background: #FEF3C7; color: #92400E; }
.status-accepted, .status-preparing { background: #DBEAFE; color: #1E40AF; }
.status-ready, .status-served { background: #D1FAE5; color: #065F46; }
.status-completed { background: #E5E7EB; color: #374151; }
.status-cancelled, .status-rejected { background: #FEE2E2; color: #991B1B; }

/* Play Store badge in footer */
.footer-download {
  margin: 1.5rem 0 0.5rem;
  text-align: center;
}
.footer-download h4 {
  font-family: var(--font);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.play-badge {
  height: 48px;
  width: auto;
  display: inline-block;
  border-radius: 6px;
}
.play-badge-link {
  display: inline-block;
  transition: opacity 0.2s ease, transform 0.15s ease;
}
.play-badge-link:hover { opacity: 0.92; transform: translateY(-1px); }
.play-badge-link.is-disabled {
  cursor: default;
  opacity: 0.55;
  pointer-events: none;
}
.play-badge-link.is-disabled:hover { transform: none; opacity: 0.55; }

/* Nepali date/time clock */
.np-clock {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  margin-left: 1rem;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 900px) {
  .np-clock { display: flex; }
}
.np-clock-bs {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}
.np-clock-time {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
}
/* Mobile: show in footer */
.footer-clock {
  text-align: center;
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}
.footer-clock .np-clock-bs { display: block; color: rgba(255,255,255,0.65); font-size: 0.8rem; }
.footer-clock .np-clock-time { display: block; color: var(--accent-soft); font-size: 1.1rem; font-weight: 700; margin-top: 0.2rem; }
@media (min-width: 900px) {
  .footer-clock { display: none; }
}
