/* Reset and global styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #e74c3c;
  --secondary-color: #3498db;
  --dark-bg: #1a202c;
  --header-bg: #2d3748;
  --header-glass: rgba(45, 55, 72, 0.95);
  --card-bg: #34495e;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --text-light: #f7fafc;
  --border-color: #e2e8f0;
  --hover-color: #c53030;
  --success-color: #38a169;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --shadow-strong: rgba(0, 0, 0, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.2);
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Loading Screen */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2c3e50, #34495e);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.loading-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: #ecf0f1;
}

.loading-subtitle {
  color: #e74c3c;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.loading-bar-container {
  width: 300px;
  margin: 0 auto;
}

.loading-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #e74c3c, #f39c12);
  border-radius: 2px;
  animation: loading 3s ease-in-out infinite;
}

@keyframes loading {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

.loading-text {
  margin-top: 1rem;
  color: #bdc3c7;
}

/* Header - COMPLETAMENTE REDISEÑADO */
header {
  background: var(--header-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--primary-color);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 80px;
  gap: 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex: 0 0 auto;
}

.header-center {
  flex: 1;
  max-width: 500px;
  margin: 0 2rem;
  min-width: 200px;
}

.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
}

/* Logo */
.logo {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.logo:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

/* Textos del header - MEJORADOS PARA FONDO OSCURO */
.textos-header h1 {
  color: var(--text-light);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.eslogan {
  color: #fbb6ce;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ciudad-actual {
  color: #a0aec0;
  font-size: 0.75rem;
  font-weight: 500;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Buscador mejorado */
#buscador {
  width: 100%;
  padding: 0.9rem 1.4rem;
  border: 2px solid rgba(226, 232, 240, 0.3);
  border-radius: 30px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-weight: 500;
  color: var(--text-primary);
}

#buscador:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.15), 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 1);
}

#buscador::placeholder {
  color: var(--text-secondary);
  font-weight: 500;
}









/* Hidden mobile search by default */
.header-mobile-search {
  display: none !important;
}

/* RESPONSIVE DESIGN */

/* Tablet */
@media (max-width: 1024px) {
  .header-content {
    padding: 1rem 1.5rem;
    gap: 1rem;
  }
  
  .header-center {
    margin: 0 1rem;
    max-width: 400px;
  }
  
  .textos-header h1 {
    font-size: 1.8rem;
  }
  
  .eslogan {
    font-size: 0.8rem;
  }
}

/* Mobile Large */
@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
    gap: 0.8rem;
    flex-wrap: nowrap;
  }
  
  .header-left {
    gap: 0.8rem;
    flex: 0 0 auto;
  }
  
  .header-center {
    margin: 0 0.8rem;
    flex: 1;
    min-width: 150px;
  }
  
  .header-right {
    flex: 0 0 auto;
  }
  
  .textos-header h1 {
    font-size: 1.6rem;
  }
  
  .eslogan {
    font-size: 0.75rem;
  }
  
  .ciudad-actual {
    font-size: 0.7rem;
  }
  
  .logo {
    width: 50px;
    height: 50px;
  }
  
  .hamburger-btn {
    padding: 0.7rem;
    font-size: 1.1rem;
    margin-right: 0.8rem;
  }
  
  #buscador {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 25px;
  }
  
  .usuario-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    min-height: 44px;
  }
  
  .usuario-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }
  
  .login-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    min-height: 44px;
  }
}

/* Mobile Medium */
@media (max-width: 640px) {
  .header-content {
    padding: 0.8rem;
    gap: 0.8rem;
  }
  
  .header-left {
    gap: 0.6rem;
  }
  
  .textos-header h1 {
    font-size: 1.4rem;
  }
  
  .eslogan {
    font-size: 0.7rem;
  }
  
  .logo {
    width: 45px;
    height: 45px;
  }
  
  #buscador {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }
  
  .usuario-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    gap: 0.6rem;
  }
  
  .usuario-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  
  .usuario-nombre {
    max-width: 80px;
  }
}

/* Mobile Small */
@media (max-width: 480px) {
  .header-content {
    padding: 0.7rem;
    gap: 0.6rem;
  }
  
  .header-left {
    gap: 0.5rem;
  }
  
  .textos-header h1 {
    font-size: 1.2rem;
  }
  
  .eslogan {
    display: none;
  }
  
  .logo {
    width: 42px;
    height: 42px;
  }
  
  .hamburger-btn {
    padding: 0.6rem;
    font-size: 1rem;
    margin-right: 0.6rem;
  }
  
  #buscador {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    border-radius: 22px;
  }
  
  .usuario-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    gap: 0.4rem;
  }
  
  .usuario-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }
  
  .usuario-nombre {
    display: none;
  }
  
  .dropdown-arrow {
    font-size: 0.7rem;
  }
  
  .login-btn .login-text {
    display: none;
  }
  
  .login-btn {
    padding: 8px;
    min-width: 44px;
    justify-content: center;
  }
}

/* Mobile Extra Small */
@media (max-width: 360px) {
  .header-content {
    padding: 0.6rem;
    gap: 0.5rem;
  }
  
  .header-left {
    gap: 0.4rem;
  }
  
  .textos-header h1 {
    font-size: 1rem;
  }
  
  .ciudad-actual {
    font-size: 0.65rem;
  }
  
  .logo {
    width: 38px;
    height: 38px;
  }
  
  .hamburger-btn {
    padding: 0.5rem;
    font-size: 0.9rem;
    margin-right: 0.5rem;
  }
  
  #buscador {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
  }
  
  .usuario-btn {
    padding: 5px 8px;
    min-width: 36px;
    justify-content: center;
  }
  
  .usuario-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
  }
}

/* Ultra Small Mobile */
@media (max-width: 320px) {
  .header-content {
    padding: 0.5rem;
    gap: 0.4rem;
  }
  
  .textos-header h1 {
    font-size: 0.9rem;
  }
  
  .logo {
    width: 35px;
    height: 35px;
  }
  
  .hamburger-btn {
    padding: 0.4rem;
    font-size: 0.8rem;
  }
  
  #buscador {
    padding: 0.4rem 0.7rem;
    font-size: 0.7rem;
  }
  
  .usuario-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
}

/* Focus improvements for mobile */
@media (max-width: 768px) {
  .usuario-btn {
    min-height: 44px;
  }
  
  #buscador {
    min-height: 42px;
    font-size: 16px !important; /* Prevents iOS zoom */
  }
  
  #buscador:focus {
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2), 0 4px 12px var(--shadow-medium);
  }
  
  #buscador::placeholder {
    opacity: 0.7;
  }
}
/* Landscape optimization for mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .header-content {
    flex-direction: row;
    min-height: 65px;
    padding: 0.6rem 1rem;
  }
  
  .header-center {
    margin: 0 1rem;
    width: auto;
    flex: 1;
  }
  
  .logo {
    width: 38px;
    height: 38px;
  }
  
  .textos-header h1 {
    font-size: 1rem;
  }
  
  .eslogan {
    display: none;
  }
  
  .ciudad-actual {
    font-size: 0.65rem;
  }
}

/* Animaciones adicionales */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-item {
  animation: fadeIn 0.3s ease forwards;
}

.menu-item:nth-child(1) { animation-delay: 0.1s; }
.menu-item:nth-child(2) { animation-delay: 0.2s; }
.menu-item:nth-child(3) { animation-delay: 0.3s; }
.menu-item:nth-child(4) { animation-delay: 0.4s; }

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



/*SUBCATEGORIA NO SALE EN CELULAR*/
/* Ocultar subcategorías en pantallas pequeñas */
@media screen and (max-width: 768px) {
  #subcategoriasContainer {
    display: none !important;
  }
}


.search-container {
  position: relative;
  width: 100%;
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
  padding: 5px;
  z-index: 10;
}

.clear-search-btn:hover {
  color: #333;
}

/* Ajustar el padding del input para que el texto no se superponga con el botón */
#buscador, #buscador-mobile {
  padding-right: 35px;
}


/* Esqueletos de carga */
.skeleton-categoria {
  height: 40px;
  min-width: 120px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 20px;
  margin-right: 10px;
}

.skeleton-category-section {
  margin-bottom: 2rem;
}

.skeleton-category-title {
  height: 24px;
  width: 200px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.skeleton-restaurants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.skeleton-restaurant-card {
  height: 320px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 12px;
}

.skeleton-recomendado {
  height: 180px;
  min-width: 150px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 12px;
  margin-right: 1rem;
}

.skeleton-producto {
  height: 220px;
  min-width: 160px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 12px;
  margin-right: 1rem;
}

.skeleton-categoria-visual {
  height: 100px;
  min-width: 100px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 50%;
  margin-right: 1.5rem;
}

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


/* Loading Screen para verificación de ubicación */
#loadingScreenUbicacion {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
}

#loadingScreenUbicacion .loading-content {
  text-align: center;
  color: white;
  padding: 2rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#loadingScreenUbicacion .loading-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
  border: 2px solid rgba(231, 76, 60, 0.3);
}

#loadingScreenUbicacion .loading-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #ecf0f1;
  font-weight: 800;
}

#loadingScreenUbicacion .loading-subtitle {
  color: #e74c3c;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  font-weight: 600;
}

#loadingScreenUbicacion .loading-bar-container {
  width: 300px;
  margin: 0 auto;
}

#loadingScreenUbicacion .loading-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

#loadingScreenUbicacion .loading-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #e74c3c, #f39c12);
  border-radius: 3px;
  animation: loading 2s ease-in-out infinite;
}

#loadingScreenUbicacion .loading-text {
  margin-top: 1rem;
  color: #bdc3c7;
  font-size: 0.9rem;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes loading {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

/* Para pantallas móviles */
@media (max-width: 768px) {
  #loadingScreenUbicacion .loading-content {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  #loadingScreenUbicacion .loading-logo {
    width: 60px;
    height: 60px;
  }
  
  #loadingScreenUbicacion .loading-title {
    font-size: 1.5rem;
  }
  
  #loadingScreenUbicacion .loading-bar-container {
    width: 250px;
  }
}

/* Desktop optimizations - Pantallas grandes */
@media (min-width: 1200px) {
  .header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
  }
  
  .textos-header h1 {
    font-size: 1.8rem;
  }
  
  .eslogan {
    font-size: 0.8rem;
  }
  
  .ciudad-actual {
    font-size: 0.7rem;
  }
  
  .logo {
    width: 50px;
    height: 50px;
  }
  
  #buscador {
    font-size: 0.9rem;
    padding: 0.8rem 1.2rem;
  }
}

@media (min-width: 1440px) {
  .header-content {
    max-width: 1400px;
  }
  
  .textos-header h1 {
    font-size: 1.6rem;
  }
  
  .eslogan {
    font-size: 0.75rem;
  }
  
  .logo {
    width: 45px;
    height: 45px;
  }
}

/* Agrega estas reglas al final de headerIndex.css */

/* Desktop compacto - Pantallas grandes */
@media (min-width: 1024px) {
  .header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    min-height: 60px; /* Reducido de 80px */
    gap: 1rem;
  }
  
  .logo {
    width: 40px; /* Reducido de 55px */
    height: 40px;
  }
  
  .textos-header h1 {
    font-size: 1.4rem; /* Reducido de 2rem */
  }
  
  .eslogan {
    font-size: 0.7rem; /* Reducido de 0.85rem */
  }
  
  .ciudad-actual {
    font-size: 0.65rem; /* Reducido de 0.75rem */
  }
  
  #buscador {
    padding: 0.7rem 1.2rem; /* Reducido de 0.9rem 1.4rem */
    font-size: 0.85rem; /* Reducido de 1rem */
  }
}

@media (min-width: 1200px) {
  .header-content {
    max-width: 1200px;
    padding: 0.7rem 1.5rem; /* Aún más compacto */
    min-height: 55px; /* Más pequeño */
  }
  
  .logo {
    width: 38px;
    height: 38px;
  }
  
  .textos-header h1 {
    font-size: 1.3rem;
  }
  
  .eslogan {
    font-size: 0.65rem;
  }
  
  .ciudad-actual {
    font-size: 0.6rem;
  }
  
  #buscador {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
}

@media (min-width: 1440px) {
  .header-content {
    max-width: 1400px;
    padding: 0.6rem 1.5rem; /* Máximo compacto */
    min-height: 50px; /* Mínimo altura */
  }
  
  .logo {
    width: 35px;
    height: 35px;
  }
  
  .textos-header h1 {
    font-size: 1.2rem;
  }
  
  .eslogan {
    font-size: 0.6rem;
  }
  
  .ciudad-actual {
    font-size: 0.55rem;
  }
  
  #buscador {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }
}

/* Para pantallas muy grandes (4K, etc.) */
@media (min-width: 1920px) {
  .header-content {
    max-width: 1600px;
    padding: 0.5rem 1.5rem;
    min-height: 45px;
  }
  
  .logo {
    width: 32px;
    height: 32px;
  }
  
  .textos-header h1 {
    font-size: 1.1rem;
  }
  
  .eslogan {
    font-size: 0.55rem;
  }
  
  .ciudad-actual {
    font-size: 0.5rem;
  }
}