/* ==========================================================================
   Rajagiri — shared styles
   ========================================================================== */

:root {
  --bg: #fdf6e9;
  --bg-warm: #f8ecd6;
  --surface: #ffffff;
  --ink: #2b2420;
  --ink-soft: #776a5c;
  --accent: #7a1620;
  --accent-dark: #530f16;
  --accent-tint: #f6e6e2;
  --price: #b8912a;
  --line: rgba(122, 22, 32, 0.14);
  --shadow: 0 1px 2px rgba(43, 32, 32, 0.06), 0 6px 16px rgba(43, 32, 32, 0.07);
  --shadow-sm: 0 1px 2px rgba(43, 32, 32, 0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------------------------------------------------------------------- */
/* Menu page header + tabs                                                 */
/* ---------------------------------------------------------------------- */

.site-header {
  background: var(--accent);
  color: #fff;
  padding: 18px 18px 16px;
  box-shadow: 0 2px 10px rgba(83, 15, 22, 0.3);
}

.site-header .wrap {
  padding: 0;
}

.site-header h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  margin: 0;
  letter-spacing: 0.2px;
}

.site-header .tagline {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
}

.tabs-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--line);
}

.tabs-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 18px;
  max-width: 640px;
  margin: 0 auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.tab-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  border-color: var(--accent);
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------------------------------------------------------------------- */
/* Menu content                                                            */
/* ---------------------------------------------------------------------- */

.menu-main {
  padding: 8px 0 40px;
}

.category-section {
  padding: 28px 0 4px;
  scroll-margin-top: 52px;
}

.category-heading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--accent-dark);
  margin: 0 0 4px;
  padding: 0 18px;
}

.category-count {
  display: block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0 0 14px;
  padding: 0 18px;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 18px;
}

.item-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.item-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.item-card.unavailable {
  opacity: 0.55;
}

.item-info h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
}

.item-info p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.sold-out-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--price);
}

.item-price {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--price);
  font-weight: 700;
  white-space: nowrap;
  padding-top: 2px;
}

.empty-state,
.error-state {
  padding: 40px 18px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.site-footer {
  padding: 28px 18px 36px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------------- */
/* Admin panel                                                             */
/* ---------------------------------------------------------------------- */

.admin-body {
  background: var(--bg);
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--accent-dark);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(83, 15, 22, 0.3);
}

.admin-header h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  margin: 0;
}

.admin-header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 26px;
  width: 100%;
  max-width: 360px;
}

.login-card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  margin: 0 0 6px;
  color: var(--accent-dark);
}

.login-card p.sub {
  margin: 0 0 20px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--ink);
}

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

.field-row {
  display: flex;
  gap: 10px;
}

.field-row .field {
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

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

.btn-secondary {
  background: var(--accent-tint);
  color: var(--accent-dark);
}

.btn-secondary:hover {
  opacity: 0.85;
}

.btn-danger {
  background: #fdecec;
  color: #b3261e;
}

.btn-danger:hover {
  background: #fbd8d8;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.78rem;
}

.login-error {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: #b3261e;
  min-height: 1em;
}

.admin-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.admin-section {
  margin-bottom: 30px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--accent-dark);
  margin: 0;
}

.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

thead th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

.row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-yes {
  background: var(--accent-tint);
  color: var(--accent-dark);
}

.badge-no {
  background: #f3f1e4;
  color: var(--ink-soft);
}

.table-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

/* Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 42, 32, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 0;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 22px 20px 26px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
}

@media (min-width: 560px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-card {
    border-radius: var(--radius);
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--accent-dark);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions .btn {
  flex: 1;
}

/* QR modal */

.qr-modal-body {
  text-align: center;
}

.qr-modal-body p {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin: 0 0 16px;
}

#qrcode-canvas-wrap {
  display: inline-block;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.spinner-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}
