/* ── CSS Variables & Reset ─────────────────────────────────── */
:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 60px;
}

.header-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255,255,255,0.2);
}

.header-logo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.header-title { font-size: 1.1rem; font-weight: 700; flex: 1; }

.cart-btn {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: 24px;
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s;
}
.cart-btn:hover { background: rgba(255,255,255,0.3); }
.cart-count {
  background: #fff;
  color: var(--primary);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Category Nav ─────────────────────────────────────────── */
.category-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 60px;
  z-index: 90;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-nav-inner {
  display: flex;
  gap: 0;
  padding: 0 1rem;
  max-width: 800px;
  margin: 0 auto;
}
.cat-tab {
  padding: 0.8rem 1rem;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.cat-tab:hover { color: var(--primary); }
.cat-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Menu ─────────────────────────────────────────────────── */
.menu-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 6rem;
}

.category-section { margin-bottom: 2rem; }
.category-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 560px) {
  .items-grid { grid-template-columns: 1fr 1fr; }
}

.item-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.item-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.item-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #f0f0f0;
}
.item-image-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.item-body { padding: 0.75rem; flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.item-name { font-weight: 600; font-size: 1rem; }
.item-desc { font-size: 0.85rem; color: var(--text-muted); flex: 1; }
.item-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.item-price { font-weight: 700; font-size: 1.05rem; color: var(--primary); }
.add-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  line-height: 1;
}
.add-btn:hover { background: var(--primary-dark); transform: scale(1.1); }

/* ── Cart Drawer ──────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}
.cart-drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-header h2 { font-size: 1.1rem; }
.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.cart-items { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }

.cart-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 0.95rem; }
.cart-item-price { font-size: 0.85rem; color: var(--text-muted); }
.qty-controls { display: flex; align-items: center; gap: 0.5rem; }
.qty-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.qty-btn:hover { background: var(--primary-dark); }
.qty-val { font-weight: 700; min-width: 20px; text-align: center; }

.cart-empty { text-align: center; color: var(--text-muted); padding: 2rem; }

.drawer-footer { padding: 1rem; border-top: 1px solid var(--border); }
.cart-total { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }

/* ── Checkout ─────────────────────────────────────────────── */
.checkout-section { display: none; }
.checkout-section.active { display: block; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.3rem; }
.form-control {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s;
  background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); }

.btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; width: auto; display: inline-block; }

/* ── Swish ────────────────────────────────────────────────── */
.swish-box {
  background: #f0faf0;
  border: 2px solid #4caf50;
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
}
.swish-title { font-weight: 700; font-size: 1rem; color: #2e7d32; margin-bottom: 0.5rem; }
.swish-number { font-size: 1.8rem; font-weight: 900; color: #1b5e20; letter-spacing: 0.05em; }
.swish-amount { font-size: 1.1rem; font-weight: 700; color: #2e7d32; margin-top: 0.25rem; }
.swish-instructions { font-size: 0.85rem; color: #555; margin-top: 0.75rem; }

/* ── Order Confirmation ───────────────────────────────────── */
.confirmation-page {
  max-width: 520px;
  margin: 2rem auto;
  padding: 0 1rem;
  text-align: center;
}
.checkmark {
  font-size: 4rem;
  margin-bottom: 1rem;
}
.order-number {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary);
  margin: 0.5rem 0;
}
.status-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border-radius: 24px;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0.5rem 0;
}
.status-pending { background: #fff3cd; color: #856404; }
.status-confirmed { background: #d1ecf1; color: #0c5460; }
.status-preparing { background: #fff3cd; color: #856404; }
.status-ready { background: #d4edda; color: #155724; }
.status-collected { background: #d4edda; color: #155724; }

.status-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

/* ── Loading / Error ──────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
  flex-direction: column;
  gap: 1rem;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  background: #fff0f0;
  border: 1px solid #ffb3b3;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: #c62828;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ── Closed Notice ────────────────────────────────────────── */
.closed-notice {
  max-width: 520px;
  margin: 3rem auto;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
.closed-notice h2 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text); }
