/* ==========================================================================
   COMIDA (CUBA) - DISEÑO MINIMALISTA ESTILO UBER EATS
   Optimizado para teléfonos de gama baja/media y ahorro extremo de datos.
   ========================================================================== */

:root {
  --bg-page: #f6f6f6;
  --bg-card: #ffffff;
  --text-main: #111111;
  --text-muted: #545454;
  --text-light: #757575;
  --brand-black: #000000;
  --brand-green: #06c167;
  --brand-green-dark: #049a52;
  --brand-green-soft: #e6f9ef;
  --brand-amber: #f59e0b;
  --brand-amber-soft: #fef3c7;
  --brand-red: #e11d48;
  --brand-red-soft: #ffe4e6;
  --border-color: #e8e8e8;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.16);
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.45;
  font-size: 15px;
  padding-bottom: 96px;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

.app-shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--bg-card);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.04);
}

/* BARRA SUPERIOR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.4px;
  color: var(--brand-black);
}

.brand-mark .brand-dot {
  color: var(--brand-green);
}

.mode-switch-btn {
  background: #f0f0f0;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mode-switch-btn.active-vendor {
  background: var(--brand-black);
  color: #ffffff;
  border-color: var(--brand-black);
}

/* CABECERA DEL NEGOCIO (ESTILO UBER EATS) */
.store-hero {
  padding: 18px 16px 14px;
  border-bottom: 6px solid var(--bg-page);
}

.store-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.store-title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.store-desc {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-top: 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.open {
  background: var(--brand-green-soft);
  color: var(--brand-green-dark);
}

.status-pill.closed {
  background: var(--brand-red-soft);
  color: var(--brand-red);
}

.store-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.meta-chip {
  background: #f4f4f4;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-chip.rate-chip {
  background: #eff6ff;
  color: #1d4ed8;
}

/* PESTAÑAS DE CATEGORÍAS */
.category-tabs {
  position: sticky;
  top: 53px;
  z-index: 25;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 10px 16px;
  scrollbar-width: none;
}

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

.cat-tab {
  border: none;
  background: #f2f2f2;
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.cat-tab.active {
  background: var(--brand-black);
  color: #ffffff;
}

/* LISTA DE PRODUCTOS */
.menu-container {
  padding: 8px 16px 24px;
}

.category-heading {
  font-size: 18px;
  font-weight: 800;
  margin: 16px 0 8px;
  letter-spacing: -0.3px;
}

.product-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.product-card.unavailable {
  opacity: 0.5;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-weight: 700;
  font-size: 15.5px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-row {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.product-price-cup {
  font-weight: 800;
  font-size: 15.5px;
  color: var(--brand-black);
}

.product-action-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 78px;
  height: 78px;
  background: #f7f7f7;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.product-emoji {
  font-size: 32px;
  line-height: 1;
}

.add-btn {
  position: absolute;
  bottom: -8px;
  right: -6px;
  background: var(--brand-black);
  color: #ffffff;
  border: 2px solid #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
}

.qty-control {
  position: absolute;
  bottom: -10px;
  background: var(--brand-black);
  color: #ffffff;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  box-shadow: var(--shadow-soft);
}

.qty-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  width: 22px;
  height: 22px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.qty-val {
  font-size: 13px;
  font-weight: 700;
  min-width: 14px;
  text-align: center;
}

/* BARRA FLOTANTE DEL CARRITO (UBER EATS BOTTOM BAR) */
.floating-cart-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 12px 16px 16px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 70%, rgba(255, 255, 255, 0));
  pointer-events: none;
}

.floating-cart-btn {
  pointer-events: auto;
  max-width: 528px;
  margin: 0 auto;
  width: 100%;
  background: var(--brand-black);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
  box-shadow: var(--shadow-float);
}

.cart-count-badge {
  background: var(--brand-green);
  color: #000000;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 800;
}

/* MODALES Y CHECKOUT */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-sheet {
  background: var(--bg-card);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px 26px;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
}

.close-btn {
  background: #f0f0f0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* FORMULARIOS */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafafa;
  color: var(--text-main);
  outline: none;
}

.form-input:focus {
  border-color: var(--brand-black);
  background: #ffffff;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-primary {
  width: 100%;
  background: var(--brand-green);
  color: #000000;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-weight: 800;
  font-size: 15.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-black {
  width: 100%;
  background: var(--brand-black);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-outline {
  background: #ffffff;
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* PANEL DEL VENDEDOR */
.vendor-wrap {
  padding: 16px;
}

.vendor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}

.eltoque-box {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.eltoque-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.eltoque-badge {
  background: rgba(6, 193, 103, 0.2);
  color: #4ade80;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
}

.rate-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.rate-big-input {
  width: 120px;
  font-size: 22px;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid #475569;
  background: #0f172a;
  color: #ffffff;
  text-align: center;
}

.vendor-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
  background: #f0f0f0;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.vendor-nav-btn {
  border: none;
  background: transparent;
  padding: 8px 6px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
}

.vendor-nav-btn.active {
  background: #ffffff;
  color: var(--brand-black);
  box-shadow: var(--shadow-soft);
}

/* TARJETAS DE PEDIDOS */
.order-card {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px;
  margin-bottom: 12px;
}

.order-card.estado-nuevo {
  border-left: 5px solid var(--brand-green);
  background: #fafffc;
}

.order-card.estado-en_camino {
  border-left: 5px solid var(--brand-amber);
}

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

.status-btn {
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.status-btn.active {
  background: var(--brand-black);
  color: #ffffff;
  border-color: var(--brand-black);
}

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: #111111;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-float);
}
