/* ============================================================
   LO QUIERO A DOMICILIO - Estilos Principales
   Paleta: tonos cálidos, apetitosos, frescos
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Pacifico&display=swap');

:root {
  /* Colores principales */
  --naranja:        #FF6B35;
  --naranja-claro:  #FF8C5A;
  --naranja-dark:   #E55A25;
  --amarillo:       #FFB830;
  --amarillo-claro: #FFC94D;
  --rojo-tomate:    #E63946;
  --verde-fresh:    #52B788;
  --verde-dark:     #2D6A4F;

  /* Neutros cálidos */
  --crema:          #FFF8F0;
  --crema-dark:     #FFF0DC;
  --gris-claro:     #F5F5F5;
  --gris-medio:     #9E9E9E;
  --gris-dark:      #424242;
  --blanco:         #FFFFFF;
  --negro-suave:    #1A1A2E;

  /* Sombras */
  --sombra-xs:  0 1px 3px rgba(0,0,0,.08);
  --sombra-sm:  0 2px 8px rgba(0,0,0,.10);
  --sombra-md:  0 4px 16px rgba(0,0,0,.12);
  --sombra-lg:  0 8px 30px rgba(0,0,0,.15);

  /* Radio */
  --radio-sm:   8px;
  --radio-md:   14px;
  --radio-lg:   20px;
  --radio-xl:   28px;

  /* Tipografía */
  --font-body:    'Nunito', sans-serif;
  --font-display: 'Pacifico', cursive;
}

/* ---- Reset y base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--crema);
  color: var(--gris-dark);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* ---- Navbar App ---- */
.navbar-app {
  background: var(--naranja);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--sombra-md);
}

.navbar-app .logo-text {
  font-family: var(--font-display);
  color: var(--blanco);
  font-size: 1.3rem;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.navbar-app .logo-img {
  height: 36px;
  object-fit: contain;
}

.btn-nav-user {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50px;
  color: var(--blanco);
  padding: 4px 14px;
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s;
}
.btn-nav-user:hover {
  background: rgba(255,255,255,0.35);
  color: var(--blanco);
  text-decoration: none;
}

/* ---- Banners promociones ---- */
.banner-promo {
  border-radius: var(--radio-md);
  overflow: hidden;
  box-shadow: var(--sombra-sm);
  display: block;
  transition: transform .25s, box-shadow .25s;
}
.banner-promo:hover { transform: translateY(-2px); box-shadow: var(--sombra-md); }
.banner-promo img { width: 100%; height: 160px; object-fit: cover; display: block; }

/* ---- Slider de promociones ---- */
.promo-slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.promo-slider::-webkit-scrollbar { display: none; }
.promo-slider .banner-promo { flex: 0 0 85%; scroll-snap-align: start; }

/* ---- Secciones ---- */
.seccion-titulo {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--gris-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.seccion-titulo .acento {
  width: 4px; height: 20px;
  background: var(--naranja);
  border-radius: 4px;
  display: inline-block;
}

/* ---- Categorías ---- */
.categorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.categoria-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--gris-dark);
  transition: transform .2s;
}
.categoria-item:hover { transform: translateY(-3px); text-decoration: none; color: var(--naranja); }
.categoria-item .cat-img-wrap {
  width: 70px; height: 70px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--sombra-sm);
  border: 3px solid var(--blanco);
  background: var(--crema-dark);
}
.categoria-item img { width: 100%; height: 100%; object-fit: cover; }
.categoria-item span {
  margin-top: 6px;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

/* ---- Restaurantes grid ---- */
.restaurantes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}
.restaurante-card {
  background: var(--blanco);
  border-radius: var(--radio-md);
  box-shadow: var(--sombra-sm);
  text-decoration: none;
  color: var(--gris-dark);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  display: block;
}
.restaurante-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-md);
  text-decoration: none;
  color: var(--gris-dark);
}
.restaurante-card img {
  width: 100%; height: 90px;
  object-fit: cover;
}
.restaurante-card .rc-info {
  padding: 8px 10px;
}
.restaurante-card .rc-nombre {
  font-weight: 800;
  font-size: .82rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.restaurante-card .rc-estado {
  font-size: .72rem;
  font-weight: 700;
  margin-top: 3px;
}
.rc-abierto  { color: var(--verde-fresh); }
.rc-cerrado  { color: var(--gris-medio); }

/* ---- Productos sugeridos grid ---- */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.producto-card {
  background: var(--blanco);
  border-radius: var(--radio-md);
  box-shadow: var(--sombra-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  text-decoration: none;
  color: var(--gris-dark);
  display: block;
}
.producto-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sombra-md);
  text-decoration: none;
  color: var(--gris-dark);
}
.producto-card .pc-img {
  width: 100%; height: 120px;
  object-fit: cover;
  display: block;
}
.producto-card .pc-info {
  padding: 10px 10px 12px;
}
.producto-card .pc-nombre {
  font-weight: 800;
  font-size: .85rem;
  line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.producto-card .pc-restaurante {
  font-size: .72rem;
  color: var(--gris-medio);
  margin-bottom: 6px;
}
.producto-card .pc-precio {
  font-weight: 900;
  font-size: .92rem;
  color: var(--naranja-dark);
}

/* ---- Botones ---- */
.btn-naranja {
  background: var(--naranja);
  color: var(--blanco) !important;
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-weight: 800;
  font-size: .92rem;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  text-decoration: none;
  display: inline-block;
}
.btn-naranja:hover {
  background: var(--naranja-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255,107,53,.4);
  text-decoration: none;
}
.btn-naranja:active { transform: scale(.97); }

.btn-verde {
  background: var(--verde-fresh);
  color: var(--blanco) !important;
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-weight: 800;
  font-size: .92rem;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
  display: inline-block;
}
.btn-verde:hover { background: var(--verde-dark); text-decoration: none; }

.btn-outline-naranja {
  background: transparent;
  color: var(--naranja) !important;
  border: 2px solid var(--naranja);
  border-radius: 50px;
  padding: 8px 22px;
  font-weight: 800;
  font-size: .88rem;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  display: inline-block;
}
.btn-outline-naranja:hover {
  background: var(--naranja);
  color: var(--blanco) !important;
  text-decoration: none;
}

/* ---- Badge estado ---- */
.badge-abierto {
  background: #E8F5E9;
  color: var(--verde-dark);
  border-radius: 50px;
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 800;
}
.badge-cerrado {
  background: #F5F5F5;
  color: var(--gris-medio);
  border-radius: 50px;
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 800;
}

/* ---- Cards panel ---- */
.stat-card {
  background: var(--blanco);
  border-radius: var(--radio-lg);
  padding: 20px;
  box-shadow: var(--sombra-sm);
  border-left: 5px solid var(--naranja);
}
.stat-card.verde  { border-left-color: var(--verde-fresh); }
.stat-card.amarillo { border-left-color: var(--amarillo); }
.stat-card.rojo   { border-left-color: var(--rojo-tomate); }
.stat-card .stat-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gris-dark);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: .8rem;
  color: var(--gris-medio);
  font-weight: 700;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---- Bottom nav (app móvil) ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  background: var(--blanco);
  box-shadow: 0 -2px 16px rgba(0,0,0,.10);
  display: flex;
  z-index: 999;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0 8px;
  text-decoration: none;
  color: var(--gris-medio);
  font-size: .68rem;
  font-weight: 700;
  gap: 2px;
  transition: color .2s;
  position: relative;
}
.bottom-nav a.activo, .bottom-nav a:hover { color: var(--naranja); }
.bottom-nav a i { font-size: 1.3rem; }
.bottom-nav .carrito-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--rojo-tomate);
  color: white;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: .65rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---- Espaciado con bottom nav ---- */
.pb-bottom-nav { padding-bottom: 80px; }

/* ---- Página restaurante ---- */
.rest-header {
  position: relative;
  border-radius: 0 0 var(--radio-xl) var(--radio-xl);
  overflow: hidden;
  min-height: 180px;
}
.rest-header .portada {
  width: 100%; height: 180px;
  object-fit: cover;
}
.rest-header .portada-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.15), rgba(0,0,0,.55));
}
.rest-header .rest-logo {
  position: absolute;
  bottom: -30px;
  left: 20px;
  width: 70px; height: 70px;
  border-radius: var(--radio-md);
  border: 3px solid var(--blanco);
  object-fit: cover;
  box-shadow: var(--sombra-md);
}
.rest-info {
  margin-top: 38px;
  padding: 0 16px 12px;
}
.rest-nombre {
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--gris-dark);
}
.rest-meta {
  font-size: .8rem;
  color: var(--gris-medio);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.rest-meta span { display: flex; align-items: center; gap: 4px; }

/* ---- Barra categorías producto ---- */
.cats-barra {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 12px 16px;
  background: var(--blanco);
  position: sticky;
  top: 56px;
  z-index: 100;
  box-shadow: var(--sombra-xs);
}
.cats-barra::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0;
  background: var(--gris-claro);
  color: var(--gris-dark);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: .8rem;
  font-weight: 800;
  text-decoration: none;
  transition: all .2s;
  border: none;
  cursor: pointer;
}
.cat-pill.activo, .cat-pill:hover {
  background: var(--naranja);
  color: var(--blanco);
}

/* ---- Producto card (en restaurante) ---- */
.prod-list-item {
  background: var(--blanco);
  border-radius: var(--radio-md);
  box-shadow: var(--sombra-xs);
  display: flex;
  gap: 0;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s;
}
.prod-list-item:hover { box-shadow: var(--sombra-sm); }
.prod-list-item .pli-img {
  width: 100px;
  flex-shrink: 0;
  object-fit: cover;
}
.prod-list-item .pli-info {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.prod-list-item .pli-nombre {
  font-weight: 800;
  font-size: .9rem;
  color: var(--gris-dark);
}
.prod-list-item .pli-desc {
  font-size: .78rem;
  color: var(--gris-medio);
  margin: 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prod-list-item .pli-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pli-precio {
  font-weight: 900;
  font-size: 1rem;
  color: var(--naranja-dark);
}
.btn-agregar {
  background: var(--naranja);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
  padding: 0;
  line-height: 1;
}
.btn-agregar:hover { background: var(--naranja-dark); transform: scale(1.1); }

/* ---- Modal producto ---- */
.modal-producto .modal-content {
  border: none;
  border-radius: var(--radio-xl);
  overflow: hidden;
}
.modal-producto .modal-img {
  width: 100%; height: 220px;
  object-fit: cover;
}
.modal-producto .modal-body { padding: 20px; }
.modal-producto .mp-nombre {
  font-weight: 900;
  font-size: 1.2rem;
}
.modal-producto .mp-precio {
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--naranja-dark);
}
.modal-producto .opcion-grupo-titulo {
  font-weight: 800;
  font-size: .85rem;
  color: var(--gris-dark);
  margin: 14px 0 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.modal-producto .opcion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--crema);
  border-radius: var(--radio-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: background .2s;
}
.modal-producto .opcion-item:hover { background: var(--crema-dark); }
.modal-producto .opcion-item input { margin-right: 10px; accent-color: var(--naranja); }
.opcion-precio-extra {
  font-weight: 700;
  font-size: .8rem;
  color: var(--verde-fresh);
}
.opcion-incluido {
  font-weight: 700;
  font-size: .8rem;
  color: var(--gris-medio);
}

/* ---- Carrito ---- */
.carrito-item {
  background: var(--blanco);
  border-radius: var(--radio-md);
  padding: 12px;
  box-shadow: var(--sombra-xs);
  margin-bottom: 10px;
}
.carrito-item .ci-nombre {
  font-weight: 800;
  font-size: .9rem;
}
.carrito-item .ci-opciones {
  font-size: .78rem;
  color: var(--gris-medio);
  margin: 4px 0;
}
.carrito-item .ci-precio {
  font-weight: 900;
  color: var(--naranja-dark);
}

/* ---- Formularios ---- */
.form-control-lqad {
  border: 2px solid #EEE;
  border-radius: var(--radio-sm);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: .9rem;
  width: 100%;
  transition: border .2s;
  background: var(--blanco);
  color: var(--gris-dark);
}
.form-control-lqad:focus {
  outline: none;
  border-color: var(--naranja);
  box-shadow: 0 0 0 3px rgba(255,107,53,.15);
}

/* ---- Página de login ---- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--naranja) 0%, var(--amarillo) 100%);
  padding: 20px;
}
.login-card {
  background: var(--blanco);
  border-radius: var(--radio-xl);
  padding: 36px 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--sombra-lg);
}
.login-card .login-logo {
  text-align: center;
  margin-bottom: 24px;
}
.login-card .login-logo img { height: 60px; }
.login-card .login-titulo {
  font-weight: 900;
  font-size: 1.3rem;
  text-align: center;
  margin-bottom: 20px;
  color: var(--gris-dark);
}

/* ---- Alertas ---- */
.alerta-vencimiento {
  background: linear-gradient(135deg, #FFF3CD, #FFE69C);
  border: 2px solid var(--amarillo);
  border-radius: var(--radio-md);
  padding: 14px 18px;
  font-weight: 700;
  font-size: .88rem;
  color: #856404;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

/* ---- QR ---- */
.qr-container {
  background: var(--blanco);
  border-radius: var(--radio-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--sombra-sm);
}

/* ---- Panel sidebar ---- */
.sidebar {
  background: var(--blanco);
  width: 240px;
  min-height: 100vh;
  box-shadow: 2px 0 16px rgba(0,0,0,.06);
  position: fixed;
  left: 0; top: 0;
  overflow-y: auto;
  z-index: 200;
}
.sidebar .sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid #F0F0F0;
  text-align: center;
}
.sidebar .sidebar-logo img { height: 44px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  text-decoration: none;
  color: var(--gris-dark);
  font-weight: 700;
  font-size: .88rem;
  transition: background .2s, color .2s;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover, .sidebar-nav a.activo {
  background: var(--crema);
  color: var(--naranja);
  border-left-color: var(--naranja);
}
.sidebar-nav a i { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-nav .nav-grupo {
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gris-medio);
  padding: 14px 20px 4px;
}

.main-content {
  margin-left: 240px;
  padding: 24px;
  min-height: 100vh;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s; }
  .sidebar.abierto { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; }
}

/* ---- Utilidades ---- */
.text-naranja  { color: var(--naranja) !important; }
.text-verde    { color: var(--verde-fresh) !important; }
.text-rojo     { color: var(--rojo-tomate) !important; }
.bg-naranja    { background: var(--naranja) !important; }
.bg-crema      { background: var(--crema) !important; }
.fw-900        { font-weight: 900 !important; }
.font-display  { font-family: var(--font-display) !important; }
.rounded-xl    { border-radius: var(--radio-xl) !important; }
.shadow-card   { box-shadow: var(--sombra-sm) !important; }
.gap-2         { gap: 8px; }
.gap-3         { gap: 12px; }
