/* ============================================
   TIRUPATI RASOI — GLOBAL STYLESHEET
   Shared design tokens, reset, typography, buttons,
   bottom navigation. Loaded on every page.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Marcellus&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* Colors — pulled from the Tirupati Rasoi logo */
  --maroon-900: #4A0808;
  --maroon-700: #7A0C0C;
  --maroon-600: #91120F;
  --gold-500: #D4AF37;
  --gold-300: #E8C766;
  --gold-100: #F6E9C4;
  --cream-50: #FFFBF2;
  --cream-100: #FBF0D9;
  --ink-900: #2B1A0F;
  --ink-600: #5B4A3A;
  --green-600: #1B8A3D;
  --red-600: #C62828;
  --white: #FFFFFF;

  /* Elevation */
  --shadow-sm: 0 1px 3px rgba(74, 8, 8, 0.08);
  --shadow-md: 0 4px 14px rgba(74, 8, 8, 0.12);
  --shadow-lg: 0 8px 28px rgba(74, 8, 8, 0.18);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Type */
  --font-display: 'Marcellus', serif;
  --font-body: 'Poppins', sans-serif;

  /* Layout */
  --max-width: 480px;
  --bottom-nav-height: 68px;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: var(--font-body);
  background: var(--cream-50);
  color: var(--ink-900);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* App shell — keeps content mobile-width even on desktop browsers */
.app-shell {
  width: 100%;
  max-width: var(--max-width);
  min-height: 100vh;
  background: var(--cream-50);
  position: relative;
  box-shadow: var(--shadow-lg);
  padding-bottom: calc(var(--bottom-nav-height) + 12px);
}

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

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--maroon-900);
  font-weight: 400;
  line-height: 1.25;
}

/* Focus visibility for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--maroon-700), var(--maroon-900));
  color: var(--gold-300);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--maroon-700);
  border: 1.5px solid var(--maroon-700);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-300));
  color: var(--maroon-900);
}

.btn-block {
  width: 100%;
}

/* ---------- Badges ---------- */
.veg-badge {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--green-600);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.veg-badge::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-600);
}

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: var(--bottom-nav-height);
  background: var(--white);
  border-top: 1px solid var(--gold-100);
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -4px 16px rgba(74, 8, 8, 0.08);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 500;
  position: relative;
  padding: 6px 10px;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: var(--ink-600);
  fill: none;
  stroke-width: 1.8;
}

.nav-item.active {
  color: var(--maroon-700);
}

.nav-item.active svg {
  stroke: var(--maroon-700);
  fill: var(--gold-100);
}

.nav-cart-count {
  position: absolute;
  top: -2px;
  right: 2px;
  background: var(--red-600);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ---------- Loading skeleton shimmer (used across pages) ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--cream-100) 25%, var(--gold-100) 50%, var(--cream-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Simple inner-page header (Cart, Checkout, Orders, Profile...) ---------- */
.simple-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--gold-100);
  position: sticky;
  top: 0;
  z-index: 50;
}

.simple-header .back-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cream-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.simple-header .back-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--maroon-700);
}

.simple-header-title {
  font-size: 19px;
}

/* ---------- Empty state (reused: cart, orders, addresses...) ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 30px;
  gap: 6px;
}

.empty-emoji {
  font-size: 56px;
  margin-bottom: 8px;
}

.empty-title {
  font-size: 19px;
}

.empty-sub {
  font-size: 13px;
  color: var(--ink-600);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-900);
  color: var(--cream-50);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
