:root {
  --red: #E2231A;
  --red-dark: #B71C13;
  --black: #1A1A1A;
  --gray: #6b6b6b;
  --bg: #FAF7F5;
  --card: #FFFFFF;
  --border: #EDE6E3;
  --success: #1E8E3E;
  --warn: #E08A00;
  --radius: 16px;
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--black);
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-bottom: 90px;
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--black);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}

.topbar img.logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
  letter-spacing: 0.5px;
  flex: 1;
  color: var(--red);
  font-weight: 700;
}

.topbar .badge {
  background: var(--red);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.account-btn {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

.hero {
  padding: 22px 18px 8px;
  text-align: center;
}

.hero img {
  width: 84px;
  height: 84px;
  margin-bottom: 8px;
}

.hero h2 {
  margin: 4px 0 2px;
  font-size: 22px;
}

.hero p {
  color: var(--gray);
  margin: 0;
  font-size: 14px;
}

.category-title {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
  font-weight: 700;
  margin: 22px 4px 10px;
}

.item-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.item-emoji {
  font-size: 34px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 12px;
  flex-shrink: 0;
}

.item-photo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.item-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-info { flex: 1; min-width: 0; }
.item-info h3 { margin: 0 0 4px; font-size: 16px; }
.item-info p { margin: 0; font-size: 13px; color: var(--gray); line-height: 1.35; }
.item-price { font-weight: 700; margin-top: 6px; color: var(--red-dark); font-size: 14px; }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.stepper button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper button.add-btn {
  width: auto;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 13px;
}

.stepper span.qty {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
}

.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--black);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
}

.cart-bar.hidden { display: none; }

.cart-bar button {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.cart-bar .cart-info { font-size: 14px; }
.cart-bar .cart-info b { display: block; font-size: 16px; }

/* Modal / sheet */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

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

.sheet {
  background: #fff;
  width: 100%;
  max-width: 560px;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  max-height: 88vh;
  overflow-y: auto;
}

.sheet h2 {
  margin: 0 0 14px;
  font-size: 19px;
}

.sheet .close-btn {
  float: right;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--gray);
}

.cart-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cart-line .name { flex: 1; font-size: 14px; }
.cart-line .line-price { font-weight: 700; font-size: 14px; }

.field {
  margin-bottom: 14px;
}

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

.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: var(--bg);
}

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

.pay-options {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.pay-option {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.pay-option.selected {
  border-color: var(--red);
  background: #FFF3F2;
  color: var(--red-dark);
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  padding: 6px 0;
}

.totals-row.total {
  font-weight: 700;
  font-size: 18px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 6px;
}

.primary-btn {
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  padding: 15px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  margin-top: 6px;
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-btn {
  width: 100%;
  background: none;
  color: var(--black);
  border: 1px solid var(--border);
  padding: 13px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
}

.secondary-btn.active {
  background: #E8F7EC;
  border-color: var(--success);
  color: var(--success);
}

.error-box {
  background: #FFF0F0;
  color: var(--red-dark);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--gray);
}

.empty-state .emoji { font-size: 46px; margin-bottom: 10px; }

/* Admin */
.login-wrap {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--black);
  border-radius: var(--radius);
  padding: 30px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.login-card img { width: 70px; margin-bottom: 12px; }
.login-card h2 { margin: 0 0 4px; color: var(--red); }
.login-card p { color: #C9C9C9; font-size: 13px; margin: 0 0 18px; }

.tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
  overflow-x: auto;
}

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

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

.order-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 16px;
  margin: 10px 16px;
}

.order-card .row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.order-card .order-id { font-weight: 700; font-size: 15px; }
.order-card .order-time { font-size: 12px; color: var(--gray); }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-recibido { background: #FFF3F2; color: var(--red-dark); }
.status-preparando { background: #FFF6E5; color: var(--warn); }
.status-listo { background: #E8F7EC; color: var(--success); }
.status-en_camino { background: #E7F0FF; color: #1959B8; }
.status-entregado { background: #EDEDED; color: var(--gray); }
.status-cancelado { background: #EDEDED; color: var(--gray); text-decoration: line-through; }

.order-card ul {
  margin: 8px 0;
  padding-left: 18px;
  font-size: 13px;
}

.order-card .meta {
  font-size: 13px;
  color: var(--gray);
  margin: 4px 0;
}

.order-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.order-actions button {
  flex: 1;
  min-width: 90px;
  padding: 10px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  color: #fff;
}

.btn-preparando { background: var(--warn); }
.btn-listo { background: var(--success); }
.btn-en_camino { background: #1959B8; }
.btn-entregado { background: var(--black); }
.btn-cancelado { background: var(--gray); }
.btn-print { background: #37474f; }

.tracker-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  opacity: 0.4;
}

.tracker-step .dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--border);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.tracker-step .label {
  font-weight: 600;
  font-size: 15px;
}

.tracker-step.done { opacity: 1; }
.tracker-step.done .dot { background: var(--success); }

.tracker-step.current { opacity: 1; }
.tracker-step.current .dot { background: var(--red); }
.tracker-step.current .label { color: var(--red); }

.tracker-step.cancelled .dot { background: var(--gray); }

.refresh-note {
  text-align: center;
  font-size: 12px;
  color: var(--gray);
  padding: 10px;
}

/* ===================================================================
   Menú del cliente — rediseño moderno (solo afecta index.html; no
   toca .topbar, .sheet, .order-card ni ninguna clase que use admin.html)
   =================================================================== */

html { scroll-behavior: smooth; }

.menu-hero {
  background: linear-gradient(135deg, var(--black) 0%, #33110d 55%, var(--red-dark) 100%);
  padding: 36px 20px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.menu-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 82% -15%, rgba(226,35,26,0.45), transparent 55%);
  pointer-events: none;
}

.menu-hero h2 {
  position: relative;
  color: #fff;
  font-family: 'Poppins', -apple-system, sans-serif;
  font-size: 27px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: 0.2px;
}

.menu-hero p {
  position: relative;
  color: #EBC9C6;
  margin: 0;
  font-size: 14px;
}

.menu-hero .accent-line {
  width: 46px;
  height: 4px;
  background: var(--red);
  border-radius: 4px;
  margin: 16px auto 0;
  position: relative;
}

.category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 15;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}

.category-nav::-webkit-scrollbar { display: none; }

.category-pill {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.category-pill.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(226,35,26,0.35);
}

.menu-section-title {
  font-family: 'Poppins', -apple-system, sans-serif;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red-dark);
  font-weight: 800;
  margin: 26px 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  scroll-margin-top: 62px;
}

.menu-section-title::before {
  content: '';
  width: 5px;
  height: 18px;
  background: var(--red);
  border-radius: 4px;
  display: inline-block;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

.menu-item {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(26,26,26,0.08);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.menu-item:active { transform: scale(0.98); }

.menu-item-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #33110d, var(--red-dark));
}

.menu-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-item-media .emoji-tile {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

.menu-item-media.no-photo {
  background: linear-gradient(135deg, #33110d, var(--red-dark));
}

.menu-item-price-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(26,26,26,0.85);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}

.menu-item-unavailable-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.92);
  color: var(--gray);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
}

.menu-item-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.menu-item-name {
  font-family: 'Poppins', -apple-system, sans-serif;
  font-size: 16.5px;
  font-weight: 700;
  margin: 0;
  color: var(--black);
}

.menu-item-desc {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-item-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 8px;
}

.menu-add-btn {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(226,35,26,0.35);
  transition: transform 0.1s ease;
}

.menu-add-btn:active { transform: scale(0.94); }

.menu-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-radius: 999px;
  padding: 4px 6px;
}

.menu-stepper button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-stepper span.qty {
  min-width: 16px;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
}

/* Barra de carrito: mismo negro/rojo, un poco más llamativa */
.cart-bar {
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 24px rgba(226,35,26,0.25);
  border-top: 1px solid rgba(226,35,26,0.4);
}
