/* Base styles for hero section */
.hero-rutas {
  height: 70vh;
  background-image: url("https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  /* Fija la imagen al fondo */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: -70px;
}

.hero-rutas::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7));
  z-index: 1;
}

.hero-rutas .hero-content {
  text-align: center;
  z-index: 2;
  max-width: 800px;
  padding: 0 20px;
  width: 100%;
  /* Asegura que ocupe el ancho disponible */
}

.hero-rutas .welcome-message {
  font-size: clamp(2rem, 5vw, 4rem);
  /* Tamaño de fuente responsivo */
  font-weight: 700;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease forwards;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-rutas .welcome-subtitle {
  font-size: clamp(1rem, 2vw, 1.5rem);
  /* Tamaño de fuente responsivo */
  margin: 0 auto 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease 0.5s forwards;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease 1s forwards;
  flex-wrap: wrap;
  /* Permite que los botones se envuelvan en pantallas pequeñas */
}

.hero-btn {
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-btn.primary {
  background: var(--gradient-primary);
  color: white;
}

.hero-btn.secondary {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  border: 2px solid white;
}

.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1s ease 2s forwards;
}

.mouse {
  width: 30px;
  height: 50px;
  border: 2px solid white;
  border-radius: 20px;
  margin: 0 auto 10px;
  position: relative;
}

.wheel {
  width: 6px;
  height: 6px;
  background-color: white;
  border-radius: 50%;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 1.5s infinite;
}

.arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.arrow span {
  display: block;
  width: 10px;
  height: 10px;
  border-bottom: 2px solid white;
  border-right: 2px solid white;
  transform: rotate(45deg);
  animation: arrowDown 1.5s infinite;
}

.arrow span:nth-child(2) {
  animation-delay: 0.2s;
}

.arrow span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes scrollWheel {
  0% {
    opacity: 1;
    top: 10px;
  }

  100% {
    opacity: 0;
    top: 30px;
  }
}

@keyframes arrowDown {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(-5px, -5px);
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: rotate(45deg) translate(5px, 5px);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Rutas y Cómo llegar - Mejorado con Flexbox */
.rutas-container {
  background-color: var(--color-card);
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  overflow: hidden;
}

.rutas-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-light);
  background-color: var(--color-light);
  overflow-x: auto;
  /* Permite desplazamiento horizontal en móviles */
  padding: 0 10px;
  -webkit-overflow-scrolling: touch;
  /* Mejora el desplazamiento en iOS */
  scrollbar-width: thin;
  /* Barra de desplazamiento delgada en Firefox */
}

/* Estilizar la barra de desplazamiento para Chrome */
.rutas-tabs::-webkit-scrollbar {
  height: 4px;
}

.rutas-tabs::-webkit-scrollbar-track {
  background: var(--color-light);
}

.rutas-tabs::-webkit-scrollbar-thumb {
  background-color: var(--color-primary);
  border-radius: 4px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  font-weight: 600;
  padding: 15px 20px;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
  /* Evita que los botones se compriman */
}

.tab-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom: 3px solid var(--color-primary);
}

.tab-content {
  display: none;
  padding: 20px;
}

.tab-content.active {
  display: block;
}

.ruta-card {
  background-color: var(--color-card);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.ruta-header {
  background: var(--gradient-primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  flex-wrap: wrap;
  /* Permite que los elementos se envuelvan en móviles */
  gap: 10px;
  /* Espacio entre elementos cuando se envuelven */
}

.ruta-header h3 {
  font-size: 1.3rem;
  margin: 0;
}

.tiempo {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ruta-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  /* Grid responsivo */
  gap: 20px;
  padding: 20px;
}

.ruta-info h4 {
  color: var(--color-primary);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.ruta-info ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.ruta-info ol li {
  margin-bottom: 8px;
}

.ruta-mapa {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: 400px;
  overflow: hidden;
  z-index: 0;
  min-height: 300px;
  /* Altura mínima para móviles */
}

.mapa-interactivo {
  height: 100%;
  width: 100%;
}

/* Números de Emergencia - Mejorado con Flexbox */
.emergency-search {
  display: flex;
  margin-bottom: 20px;
  max-width: 600px;
  width: 100%;
  /* Asegura que ocupe el ancho disponible */
}

.emergency-search input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px 0 0 8px;
  font-size: 1rem;
}

.emergency-search button {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0 20px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
}

.emergency-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  /* Grid responsivo mejorado */
  gap: 20px;
  margin-bottom: 30px;
}

.emergency-card {
  background-color: var(--color-card);
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.emergency-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.emergency-icon {
  width: 80px;
  min-width: 80px;
  /* Evita que se comprima en pantallas pequeñas */
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  transition: transform 0.3s ease;
}

.emergency-icon.carabineros {
  background-color: #1b5e20;
}

.emergency-icon.bomberos {
  background-color: #b71c1c;
}

.emergency-icon.ambulancia {
  background-color: #d32f2f;
}

.emergency-icon.pdi {
  background-color: #0d47a1;
}

.emergency-icon.municipal {
  background-color: #0277bd;
}

.emergency-icon.seguridad {
  background-color: #f57c00;
}

.emergency-info {
  flex: 1;
  padding: 15px;
}

.emergency-info h3 {
  color: var(--color-primary);
  margin-bottom: 5px;
}

.emergency-info p {
  color: var(--color-text);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.emergency-number {
  color: var(--color-primary);
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.emergency-number:hover {
  transform: scale(1.05);
}

.emergency-address {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.ver-mapa-btn {
  background-color: var(--color-light);
  border: none;
  border-radius: 4px;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 5px 10px;
  transition: all 0.3s ease;
}

.ver-mapa-btn:hover {
  background-color: var(--color-primary);
  color: white;
}

/* Modal - Mejorado para responsividad */
.modal {
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  height: 100%;
  left: 0;
  overflow: auto;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: var(--color-card);
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  margin: 5% auto;
  max-width: 800px;
  padding: 20px;
  position: relative;
  width: 90%;
  /* Aumentado para mejor visualización en móviles */
  animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-modal {
  color: #aaa;
  cursor: pointer;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  right: 20px;
  top: 15px;
}

.close-modal:hover {
  color: var(--color-primary);
}

/* Indicadores Económicos - Mejorado con Grid */
.indicadores-container {
  background-color: var(--color-card);
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  overflow: hidden;
}

.indicadores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  /* Grid responsivo */
  gap: 20px;
  padding: 20px;
}

.indicador-card {
  align-items: center;
  background-color: var(--color-light);
  border-radius: 8px;
  display: flex;
  gap: 15px;
  padding: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.indicador-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.indicador-icon {
  align-items: center;
  background: var(--gradient-primary);
  border-radius: 50%;
  color: white;
  display: flex;
  font-size: 1.5rem;
  height: 50px;
  justify-content: center;
  width: 50px;
  min-width: 50px;
  /* Evita que se comprima */
}

.indicador-info {
  flex: 1;
}

.indicador-info h3 {
  color: var(--color-text);
  font-size: 1rem;
  margin-bottom: 5px;
}

.indicador-value {
  color: var(--color-primary);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.indicador-desc {
  color: #666;
  font-size: 0.8rem;
}

/* Sidebar específico - Mejorado para responsividad */
.clima-widget {
  background-color: var(--color-light);
  border-radius: 8px;
  margin-bottom: 15px;
  padding: 15px;
}

.clima-actual {
  align-items: center;
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  /* Permite envolver en pantallas muy pequeñas */
}

.clima-icon {
  align-items: center;
  display: flex;
  height: 60px;
  justify-content: center;
  width: 60px;
  min-width: 60px;
  /* Evita que se comprima */
}

.clima-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

#temperatura-actual {
  font-size: 1.5rem;
  font-weight: 700;
}

#clima-descripcion {
  color: #666;
  font-size: 0.9rem;
}

.clima-detalles {
  border-bottom: 1px dashed #ddd;
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  padding-bottom: 15px;
  flex-wrap: wrap;
  /* Permite envolver en pantallas pequeñas */
  gap: 10px;
  /* Espacio cuando se envuelven */
}

.clima-detalle {
  align-items: center;
  display: flex;
  font-size: 0.9rem;
  gap: 5px;
}

.clima-pronostico {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  /* Permite envolver en pantallas pequeñas */
  gap: 10px;
  /* Espacio cuando se envuelven */
}

.dia-pronostico {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  /* Distribuye el espacio equitativamente */
  min-width: 70px;
  /* Ancho mínimo para evitar compresión excesiva */
}

.dia-pronostico i {
  color: #78909c;
  font-size: 1.2rem;
}

/* Responsive - Mejorado y reorganizado */
@media (max-width: 992px) {
  .ruta-body {
    grid-template-columns: 1fr;
    /* Una columna en tablets */
  }

  .content-wrapper {
    flex-direction: column;
  }

  .main-column {
    width: 100%;
  }

  .sidebar {
    width: 100%;
    margin-top: 30px;
  }

  .ad-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {

  /* Ajustes para tarjetas de emergencia */
  .emergency-card {
    flex-direction: row;
    /* Mantener horizontal para mejor visualización */
  }

  .tab-btn {
    font-size: 0.9rem;
    padding: 10px 15px;
  }

  .modal-content {
    margin: 10% auto;
    width: 95%;
  }

  /* Ajustes para el hero */
  .hero-rutas {
    height: 60vh;
    /* Altura reducida para móviles */
  }

  .hero-buttons {
    flex-direction: column;
    gap: 10px;
    width: 100%;
    /* Asegura que los botones ocupen todo el ancho */
    max-width: 300px;
    /* Limita el ancho máximo */
    margin: 0 auto;
    /* Centra los botones */
  }

  .hero-btn {
    width: 100%;
    /* Botones a ancho completo */
  }

  /* Ajustes para encabezados de ruta */
  .ruta-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .emergency-search {
    width: 100%;
  }

  .horarios-tabla {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Ajustes para el menú */
  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    flex-direction: column;
    background-color: var(--color-card);
    width: 100%;
    height: calc(100vh - 70px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    align-items: flex-start;
    padding: 20px 0;
    overflow-y: auto;
    z-index: 1000;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-link {
    width: 100%;
    padding: 15px 25px;
    color: var(--color-text);
  }

  /* Animación de las barras del menú */
  .menu-toggle.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }

  .menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }

  /* Ajustes para el topbar */
  .topbar .container {
    flex-direction: column;
    gap: 10px;
  }

  .weather-finance {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .finance-info {
    justify-content: center;
    flex-wrap: wrap;
    /* Permite envolver en pantallas muy pequeñas */
  }

  /* Ajustes para el footer */
  .footer-content {
    flex-direction: column;
    gap: 30px;
  }

  .footer-section {
    width: 100%;
  }
}

@media (max-width: 576px) {

  .indicadores-grid,
  .eventos-completos {
    grid-template-columns: 1fr;
  }

  .clima-detalles {
    flex-direction: column;
    gap: 10px;
  }

  .hero-rutas {
    height: 60vh;
    background-attachment: scroll;
    /* Mejor rendimiento en móviles */
  }

  .scroll-indicator {
    display: none;
    /* Ocultar en móviles para ahorrar espacio */
  }

  .emergency-container {
    grid-template-columns: 1fr;
  }

  /* Ajuste para tarjetas de emergencia en móviles pequeños */
  .emergency-card {
    flex-direction: column;
    /* Cambiar a vertical en móviles pequeños */
  }

  .emergency-icon {
    width: 100%;
    height: 60px;
  }

  .ruta-mapa,
  .mapa-interactivo {
    height: 300px;
    /* Mapas más pequeños en móviles */
  }

  .modal-content {
    margin: 15% auto;
    width: 95%;
    padding: 15px;
  }

  .evento-card {
    padding: 15px;
  }

  /* Ajustes para los botones flotantes */
  .floating-button,
  .floating-button-emergency {
    bottom: 10px;
  }

  .floating-button {
    right: 10px;
  }

  .floating-button-emergency {
    left: 10px;
  }

  .float-options,
  .float-options-emergency {
    bottom: 60px;
  }

  .float-option span,
  .float-option-emergency span {
    display: none;
    /* Ocultar texto en móviles */
  }
}

@media (max-width: 400px) {
  .section-title {
    font-size: 1.5rem;
  }

  .tab-btn {
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .ruta-info h4 {
    font-size: 1rem;
  }

  .ruta-info ol li {
    font-size: 0.9rem;
  }

  .emergency-info h3 {
    font-size: 1.1rem;
  }

  .emergency-number {
    font-size: 1.1rem;
  }
}

.leaflet-control-container {
  z-index: 0;
}

/* Estilos para el menú móvil - Mejorado */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
  }

  .bar {
    height: 3px;
    width: 100%;
    background-color: var(--color-text);
    border-radius: 3px;
    transition: all 0.3s ease;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    flex-direction: column;
    background-color: var(--color-card);
    width: 100%;
    height: calc(100vh - 70px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    align-items: flex-start;
    padding: 20px 0;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-link {
    width: 100%;
    padding: 15px 25px;
    color: var(--color-text);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.03);
  }
}

/* Estilos para el contenedor principal - Mejorado con Flexbox */
.content-wrapper {
  display: flex;
  gap: 30px;
}

.main-column {
  flex: 1;
  min-width: 0;
  /* Evita desbordamiento en Flexbox */
}

.sidebar {
  width: 300px;
}

@media (max-width: 992px) {
  .content-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }
}

/* Estilos para los botones flotantes - Mejorado para accesibilidad */
.floating-button,
.floating-button-emergency {
  position: fixed;
  bottom: 20px;
  z-index: 999;
}

.floating-button {
  right: 20px;
}

.floating-button-emergency {
  left: 20px;
}

.main-float-btn,
.main-float-btn-emergency {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 2;
}

.float-options,
.float-options-emergency {
  position: absolute;
  bottom: 70px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.float-options.active,
.float-options-emergency.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.float-option,
.float-option-emergency {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 30px;
  background-color: white;
  color: var(--color-text);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.float-option:hover,
.float-option-emergency:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.float-option i,
.float-option-emergency i {
  font-size: 18px;
}

/* Estilos para tablas responsivas - Mejorado */
.horarios-tabla {
  width: 100%;
  border-collapse: collapse;
}

.horarios-tabla th,
.horarios-tabla td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.horarios-tabla th {
  background-color: var(--color-light);
  font-weight: 600;
}

@media (max-width: 768px) {
  .horarios-tabla {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    /* Mejora el desplazamiento en iOS */
    scrollbar-width: thin;
    /* Barra de desplazamiento delgada en Firefox */
  }

  /* Estilizar la barra de desplazamiento para Chrome */
  .horarios-tabla::-webkit-scrollbar {
    height: 4px;
  }

  .horarios-tabla::-webkit-scrollbar-track {
    background: var(--color-light);
  }

  .horarios-tabla::-webkit-scrollbar-thumb {
    background-color: var(--color-primary);
    border-radius: 4px;
  }
}

/* Animaciones para elementos */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilos para el topbar - Mejorado para responsividad */
.topbar {
  background-color: var(--color-card);
  padding: 10px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  /* Permite envolver en pantallas pequeñas */
}

.weather-finance {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  /* Permite envolver en pantallas pequeñas */
}

.weather {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.finance-info {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  /* Permite envolver en pantallas muy pequeñas */
}

.finance-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: white;
}

.finance-value {
  font-weight: 600;
  color: white;
}

.date {
  font-weight: 500;
  color: white;
}

/* Estilos para el navbar - Mejorado */
.navbar {
  position: sticky;
  top: 0;
  background-color: var(--color-card);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  height: 70px;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--color-primary);
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 0 15px;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-link:hover {
  color: var(--color-primary);
}

/* Estilos para eventos - Mejorado con Grid */
.eventos-lista {
  list-style: none;
  padding: 0;
  margin: 0;
}

.eventos-lista li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.evento-fecha {
  background-color: var(--color-primary);
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.eventos-completos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  /* Grid responsivo */
  gap: 20px;
}

.evento-card {
  background-color: var(--color-light);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.evento-fecha-completa {
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 10px;
}

/* Estilos para el footer - Mejorado con Flexbox */
.footer {
  background-color: var(--color-dark);
  color: white;
  padding: 50px 0 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 30px;
}

.footer-section {
  flex: 1;
  min-width: 250px;
}

.footer-section h3 {
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-section h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 2px;
  background-color: var(--color-primary);
}

.social-icons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
  /* Permite envolver en pantallas muy pequeñas */
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: white;
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background-color: var(--color-primary);
  transform: translateY(-3px);
}

.footer-section.links ul {
  list-style: none;
  padding: 0;
}

.footer-section.links ul li {
  margin-bottom: 10px;
}

.footer-section.links ul li a {
  color: #ddd;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-section.links ul li a:hover {
  color: var(--color-primary);
  padding-left: 5px;
}

.footer-section.contact p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ajustes adicionales para dispositivos muy pequeños */
@media (max-width: 350px) {
  .hero-rutas .welcome-message {
    font-size: 1.6rem;
  }

  .hero-rutas .welcome-subtitle {
    font-size: 0.9rem;
  }

  .tab-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .indicador-card {
    flex-direction: column;
    text-align: center;
  }

  .indicador-icon {
    margin-bottom: 10px;
  }
}

/* Estilos para el componente de Farmacias de Turno */

.farmacias-turno-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: inherit;
}

.farmacias-header {
  margin-bottom: 30px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary, #0277bd);
  margin-bottom: 10px;
}

.section-description {
  color: #666;
  font-size: 1rem;
}

/* Estados (carga, error, vacío) */
.farmacias-estado {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background-color: var(--color-light, #f5f5f5);
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.error-estado {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.empty-estado {
  background-color: rgba(255, 193, 7, 0.1);
  color: #856404;
}

.farmacias-estado i {
  font-size: 2rem;
  margin-right: 15px;
}

.farmacias-estado h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px;
}

/* Loader */
.loader {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--color-primary, #0277bd);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin-right: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Grid de farmacias */
.farmacias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Tarjeta de farmacia */
.farmacia-card {
  background-color: var(--color-card, white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.farmacia-card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.farmacia-header {
  padding: 15px;
  border-bottom: 1px solid #eee;
  background-color: rgba(2, 119, 189, 0.05);
}

.farmacia-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text, #333);
  margin: 0 0 5px 0;
}

.farmacia-header p {
  color: #666;
  font-size: 0.9rem;
  margin: 0;
}

.farmacia-body {
  padding: 15px;
}

.farmacia-info {
  display: flex;
  align-items: flex-start;
  margin-bottom: 10px;
}

.farmacia-info i {
  color: #666;
  margin-right: 10px;
  min-width: 16px;
  margin-top: 3px;
}

.farmacia-info a {
  color: var(--color-primary, #0277bd);
  text-decoration: none;
}

.farmacia-info a:hover {
  text-decoration: underline;
}

.farmacia-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.ver-mapa-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background-color: var(--color-light, #f5f5f5);
  color: var(--color-primary, #0277bd);
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.ver-mapa-btn:hover {
  background-color: var(--color-primary, #0277bd);
  color: white;
}

.ver-mapa-btn i {
  margin-right: 5px;
}

/* Responsive */
@media (max-width: 768px) {
  .farmacias-grid {
    grid-template-columns: 1fr;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .farmacias-estado {
    flex-direction: column;
    text-align: center;
  }
  
  .farmacias-estado i {
    margin-right: 0;
    margin-bottom: 10px;
  }
  
  .loader {
    margin-right: 0;
    margin-bottom: 10px;
  }
}