/* =========================================================
   The Cute Dosa — global styles
   Warm South Indian palette: banana-leaf cream, turmeric,
   maroon temple red, deep brown ink.
   ========================================================= */

:root {
  --cream:      #fdf6e8;
  --cream-2:    #f7ecd0;
  --turmeric:   #e9a017;
  --turmeric-2: #f4c430;
  --maroon:     #8b1e1e;
  --maroon-2:   #a82a2a;
  --leaf:       #2f6b3a;
  --ink:        #3a2412;
  --ink-soft:   #6b4a30;
  --line:       #d9c39a;
  --shadow:     0 10px 30px rgba(58, 36, 18, 0.12);
  --shadow-lg:  0 18px 50px rgba(58, 36, 18, 0.18);
  --radius:     14px;
  --radius-lg:  22px;
  --serif:      "Georgia", "Cormorant Garamond", "Times New Roman", serif;
  --sans:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 15px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-2));
  color: #fff8e7;
  box-shadow: 0 8px 20px rgba(139, 30, 30, 0.35);
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { background: var(--cream-2); }

.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-lg { padding: 16px 32px; font-size: 17px; }

/* =========================================================
   LANDING PAGE
   ========================================================= */

.landing { background: var(--cream); }

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 246, 232, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); }
.brand-mark { font-size: 26px; }
.brand-name { font-size: 20px; font-weight: 700; color: var(--maroon); letter-spacing: .5px; }
.brand-sub  { font-size: 14px; color: var(--ink-soft); margin-left: 6px; }
.nav-links { display: flex; align-items: center; gap: 22px; font-weight: 500; }
.nav-links a { color: var(--ink); }
.nav-links a:hover { color: var(--maroon); }

/* Hero */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 60px 24px;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(244, 196, 48, 0.35), transparent 55%),
    radial-gradient(circle at 85% 75%, rgba(168, 42, 42, 0.25), transparent 55%),
    repeating-linear-gradient(45deg, rgba(139,30,30,0.04) 0 2px, transparent 2px 14px),
    var(--cream);
}
.hero-content { position: relative; max-width: 820px; }
.kicker {
  font-family: var(--serif); font-style: italic;
  color: var(--maroon); letter-spacing: 3px; text-transform: uppercase;
  font-size: 13px; margin: 0 0 14px;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(48px, 9vw, 110px);
  margin: 0; line-height: 1;
  color: var(--maroon);
  letter-spacing: -1px;
  text-shadow: 0 2px 0 rgba(255,255,255,.4);
}
.hero-tagline {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(18px, 2.4vw, 26px);
  color: var(--ink-soft);
  margin: 18px 0 32px;
}
.hero-flourish {
  margin-top: 32px; color: var(--turmeric);
  letter-spacing: 14px; font-size: 14px;
}

/* Sections */
.section { padding: 90px 24px; }
.container { max-width: 1100px; margin: 0 auto; }
.section-title {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 48px);
  text-align: center;
  color: var(--maroon);
  margin: 0;
}
.divider {
  display: flex; align-items: center; justify-content: center;
  margin: 14px 0 40px; gap: 14px; color: var(--turmeric);
}
.divider::before, .divider::after {
  content: ""; height: 1px; width: 60px; background: var(--line);
}

.about { background: var(--cream-2); }
.about-text {
  max-width: 720px; margin: 0 auto 18px;
  text-align: center; line-height: 1.8;
  font-size: 17px; color: var(--ink);
  font-family: var(--serif);
}

/* Menu preview */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.menu-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
}
.menu-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--turmeric), var(--maroon));
}
.menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.menu-card h3 { margin: 6px 0 8px; font-family: var(--serif); color: var(--ink); font-size: 20px; }
.menu-card .price { color: var(--maroon); font-weight: 700; font-size: 18px; }
.menu-card .dot { color: var(--turmeric); font-size: 22px; }

.menu-cta { text-align: center; margin-top: 50px; }

/* Contact */
.contact { background: var(--cream-2); }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.contact-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.contact-icon { font-size: 36px; margin-bottom: 10px; }
.contact-card h3 { font-family: var(--serif); color: var(--maroon); margin: 6px 0 10px; }
.contact-card p { margin: 0; color: var(--ink-soft); line-height: 1.6; }

.footer {
  text-align: center; padding: 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft); font-size: 14px;
  background: var(--cream);
}

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* =========================================================
   POS / BILLING PAGE
   ========================================================= */

.pos { background: var(--cream-2); height: 100vh; overflow: hidden; }

.pos-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-2));
  color: #fff8e7;
  border-bottom: 3px solid var(--turmeric);
  height: 64px;
}
.brand-pos .brand-name { color: #fff8e7; }
.brand-pos .brand-sub  { color: rgba(255,248,231,0.75); }
.pos-header-actions { display: flex; align-items: center; gap: 14px; }
.datetime { font-size: 14px; color: rgba(255,248,231,0.85); }
.pos-header .btn-ghost { color: #fff8e7; border-color: rgba(255,248,231,0.4); }
.pos-header .btn-ghost:hover { background: rgba(255,255,255,0.1); }

.pos-main {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  height: calc(100vh - 64px);
}

/* Items panel (left) */
.items-panel {
  padding: 20px 22px;
  overflow-y: auto;
  background: var(--cream);
}
.items-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
}
.items-toolbar h2 {
  font-family: var(--serif); color: var(--maroon);
  margin: 0; font-size: 22px;
}
.butter-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: #fff; border: 1.5px solid var(--turmeric);
  border-radius: 999px;
  cursor: pointer; font-size: 14px;
  user-select: none;
}
.butter-toggle input { width: 18px; height: 18px; accent-color: var(--maroon); cursor: pointer; }

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.item-btn {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 110px;
  box-shadow: 0 2px 6px rgba(58,36,18,0.06);
}
.item-btn:hover { border-color: var(--turmeric); box-shadow: var(--shadow); transform: translateY(-2px); }
.item-btn:active { transform: scale(.97); background: var(--cream-2); }
.item-btn .name { font-weight: 700; font-size: 16px; color: var(--ink); line-height: 1.25; }
.item-btn .price { color: var(--maroon); font-weight: 700; font-size: 18px; margin-top: 10px; }
.item-btn.addon { border-style: dashed; border-color: var(--turmeric); background: #fff9e8; }

/* Pop animation when added */
@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); background: var(--turmeric-2); }
  100% { transform: scale(1); }
}
.item-btn.popped { animation: pop .35s ease; }

/* Bill panel (right) */
.bill-panel {
  background: #fff;
  border-left: 3px solid var(--turmeric);
  display: flex; flex-direction: column;
  height: 100%;
}
.bill-header {
  padding: 18px 20px;
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px dashed var(--line);
}
.bill-header h2 { margin: 0; font-family: var(--serif); color: var(--maroon); font-size: 22px; }
.bill-count { color: var(--ink-soft); font-size: 13px; }

.bill-items {
  flex: 1; overflow-y: auto;
  padding: 12px 16px;
}
.bill-empty {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--ink-soft); text-align: center;
}
.bill-empty-icon { font-size: 48px; margin-bottom: 10px; opacity: .6; }

.bill-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  padding: 12px 6px;
  border-bottom: 1px dashed var(--line);
  align-items: center;
}
.bill-row .name {
  font-weight: 600; color: var(--ink); font-size: 15px;
}
.bill-row .unit-price { color: var(--ink-soft); font-size: 12px; }
.bill-row .line-total { font-weight: 700; color: var(--maroon); font-size: 16px; text-align: right; }
.bill-row .controls {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.qty-btn {
  width: 32px; height: 32px;
  border: 1.5px solid var(--line); background: var(--cream);
  border-radius: 8px; cursor: pointer; font-size: 18px; font-weight: 700;
  color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease;
}
.qty-btn:hover { background: var(--turmeric-2); border-color: var(--turmeric); }
.qty-val { min-width: 28px; text-align: center; font-weight: 700; }
.remove-btn {
  margin-left: auto;
  background: transparent; border: none;
  color: var(--maroon); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 6px;
}
.remove-btn:hover { background: rgba(139,30,30,0.08); }

.bill-summary {
  padding: 16px 20px;
  border-top: 2px solid var(--turmeric);
  background: var(--cream);
}
.bill-summary .row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 15px; color: var(--ink-soft);
}
.total-row {
  font-size: 22px !important; font-weight: 800;
  color: var(--maroon) !important;
  border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px !important;
  font-family: var(--serif);
}
.bill-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 14px 20px 18px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .pos { height: auto; overflow: auto; }
  .pos-main {
    grid-template-columns: 1fr;
    height: auto;
  }
  .bill-panel {
    border-left: none;
    border-top: 3px solid var(--turmeric);
    position: sticky; bottom: 0;
    max-height: 60vh;
  }
  .nav-links a:not(.btn) { display: none; }
}
@media (max-width: 600px) {
  .nav-inner { padding: 12px 16px; }
  .section { padding: 60px 18px; }
  .items-panel { padding: 16px; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .item-btn { min-height: 90px; padding: 14px 12px; }
  .item-btn .name { font-size: 14px; }
  .item-btn .price { font-size: 16px; }
  .datetime { display: none; }
}

/* =========================================================
   PRINT RECEIPT
   ========================================================= */
.receipt {
  display: none;
  font-family: "Courier New", Courier, monospace;
  color: #000; background: #fff;
  padding: 16px;
  width: 280px;
}
.receipt-head { text-align: center; }
.receipt-head h1 { font-size: 20px; margin: 0 0 4px; font-family: "Courier New", monospace; }
.receipt-head p { margin: 2px 0; font-size: 12px; }
.receipt-meta { margin-top: 8px !important; font-size: 11px; }
.receipt hr { border: none; border-top: 1px dashed #000; margin: 10px 0; }
.receipt-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.receipt-table th, .receipt-table td { text-align: left; padding: 3px 2px; }
.receipt-table th:nth-child(2), .receipt-table td:nth-child(2),
.receipt-table th:nth-child(3), .receipt-table td:nth-child(3),
.receipt-table th:nth-child(4), .receipt-table td:nth-child(4) { text-align: right; }
.receipt-total {
  display: flex; justify-content: space-between;
  font-weight: bold; font-size: 14px; padding: 4px 0;
}
.receipt-thanks { text-align: center; font-size: 12px; margin: 8px 0 0; }

@media print {
  body * { visibility: hidden; }
  .receipt, .receipt * { visibility: visible; }
  .receipt {
    display: block !important;
    position: absolute; left: 0; top: 0;
    width: 100%;
  }
  @page { margin: 8mm; }
}