/* COOPERATIVAS DESTACADAS */
#featured-section {
  margin-top: 10rem;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.featured-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.featured-card-header {
  background: var(--primary-light);
  --text-dark: #ddd;
  /* Texto claro */
  padding: 1rem;
  position: relative;
}

.featured-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--accent);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.featured-coop-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.featured-coop-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--white);
}

.featured-coop-info h3 {
  margin-bottom: 0.3rem;
  font-size: 1.1rem;
  color: var(--white);
}

.featured-description {
  color: var(--light);
}

.featured-routes {
  padding: 1rem;
}

.featured-route {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--gray-light);
}

.featured-route:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.route-direction {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.route-city {
  font-weight: 600;
}

.route-arrow {
  color: var(--gray);
}

.route-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--gray);
}










/* ESTILOS COMPLETOS - TERMINALES DE BUSES ECUADOR */
:root {
  /* Colores
  #2c3e50
  #3d566e

  3498db
  5dade2

  234f9e
  e23c1b
   */
  --primary: #234f9e;
  --primary-light: #3d5f9f;
  --secondary: #e23c1b;
  --secondary-light: #e2573c;
  --accent: #e74c3c;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --gray: #95a5a6;
  --gray-light: #bdc3c7;
  --white: #fff;
  --black: #222;

  /* Sombras */
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.2);

  /* Transiciones */
  --transition: all 0.3s ease;



  --background: #f5f5f5;
  /* Fondo claro */
  --background-dark: #09152c;
  /* Fondo oscuro */
  --text: #333;
  /* Texto oscuro */
  --text-dark: #ddd;
  /* Texto claro */
  --primary: #234f9e;
  /* Color principal */
  --primary-dark: #19376f;
  /* Color principal en modo oscuro */
  --accent: #e74c3c;
  /* Color de acento */
}




/* RESET Y ESTILOS BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}




img {
  max-width: 100%;
  height: auto;
  display: block;
}



/* SECCIONES */
.section {
  display: block;
  animation: fadeIn 0.5s ease;
  margin-bottom: 1rem;
}

.section:not(.active-section) {
  display: none;
}

.section h2 {
  color: var(--light);
  /* Color principal */
  margin-bottom: 0rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 1.5rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}





/* CARDS DE PROVINCIAS (PRIMERA PANTALLA) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.5rem;
  margin: 1rem 0;
}

.card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  height: auto;
  width: auto;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.card-img-container {
  padding: 5px;
  height: 100px;
  overflow: hidden;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
  justify-content: center;
  align-items: center;
  display: flex;
}

.card-img {
    border-radius: 10px !important;

  height: 100%;
  object-fit: contain;
  transition: var(--transition);
  animation: cardImgBounce 2s infinite;
}

@keyframes cardImgBounce {
  0% {
    transform: scale(1) translateY(0);
  }

  50% {
    transform: scale(1.05) translateY(-3px);
  }

  100% {
    transform: scale(1) translateY(0);
  }
}

.card:hover .card-img {
  transform: scale(1.05);
}

.card-body {
  padding: 0rem 0.2rem;
  text-align: center;
}

.card-title {
  font-weight: 600;
  color: var(--primary);
  font-size: 1.1rem;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--gray);
}



/* SECCIÓN DE TERMINALES */
#terminal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}





/* SECCIÓN DE COOPERATIVAS - GRID RESPONSIVO */
#cooperative-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-flow: dense;
  gap: 1rem;
  align-items: start;
}

.cooperative-card {
  position: relative;
  /* Necesario para posicionar el gradiente */
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  /* Asegura que el contenido no desborde */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 0rem 0rem 0rem 0rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cooperative-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Gradiente estático */
.cooperative-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  /* Altura del gradiente */
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
  pointer-events: none;
  /* Permite que el usuario interactúe con el contenido */
  z-index: 1;
  /* Asegura que el gradiente esté sobre el contenido */
}







/* MODALES */
.modal-overlay {
  position: absolute;
  top: 100%;
  /* Aparece justo debajo del ícono */
  left: 50%;
  /* Centrado horizontalmente */
  transform: translateX(-50%);
  width: 200px;
  /* Ajusta según el diseño */
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 1rem;
  z-index: 10;
  display: none;
  /* Oculto por defecto */
}

.modal-overlay.active {
  display: block;
  /* Mostrar cuando esté activo */
}

.modal {
  background: var(--white);
  border-radius: 10px;
  width: 90%;
  max-width: 300px;
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: var(--text-dark);
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
}

.modal-body {
  padding: 1.5rem;
}

/* TOOLTIPS */
.tooltip {
  position: absolute;
  background: var(--primary);
  color: var(--text-dark);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s;
  max-width: 250px;
  box-shadow: var(--shadow-md);
}

.tooltip::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 6px solid transparent;
}

.tooltip.top::after {
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: var(--text-dark);
}

.tooltip.bottom::after {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: var(--text-dark);
}

.tooltip.left::after {
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--text-dark);
}

.tooltip.right::after {
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--text-dark);
}














/* Estado abierto del acordeón */
.coop-body.open {
  display: block;
}


/* Botón de alternar */
.accordion-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-dark);
  transition: transform 0.3s ease;
  transform: rotate(0deg);
}

.accordion-toggle[aria-expanded="true"] {
  transform: rotate(90deg);
}

/* Estilos para el acordeón */
.coop-body {
  display: none;
  /* Cerrado por defecto */
  max-height: 320px;
  overflow-y: auto;
  padding: 0 1rem;
  transition: max-height 0.3s ease-out;
}

/* Mostrar cuando el header tiene aria-expanded="true" */
.coop-header[aria-expanded="true"]+.coop-body {
  display: block;
  max-height: 320px;
}

/* Ocultar el cuerpo cuando está colapsado */
[aria-expanded="false"]+.coop-body {
  display: none;
}


.coop-header {
  background: var(--primary);
  color: var(--text-dark);
  /* Texto claro */
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;



  cursor: pointer;
  user-select: none;
}


/* Mantener el hover effect solo en el header */
.coop-header:hover {
  background-color: var(--primary-dark);
}

.coop-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.coop-info {
  flex-grow: 1;
}

.coop-info h3 {
  margin: 0;
  font-size: 1.1rem;
}

.coop-rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  margin-top: 0.3rem;
  color: var(--light);
}

.coop-rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.3rem;
  gap: 0.5rem;
}





.info-icon {
  position: relative;
  margin-left: 8px;
  color: #3498db;
  cursor: pointer;
  font-size: 1.1em;
  vertical-align: middle;
  display: inline-block;
}

.route {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.route:last-child {
  border-bottom: none;
}

.route-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.route-schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.time {
  background: #f0f0f0;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  box-shadow: 0 1px 4px rgba(44, 79, 158, 0.07);
}

.time:hover {
  background: var(--primary);
  color: var(--white);
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(44, 79, 158, 0.15);
}

/* Animación al hacer clic (efecto breve) */
.time:active {
  background: var(--secondary);
  color: var(--white);
  transform: scale(0.95);
}

.time.active-time {
  background: var(--secondary);
  color: var(--white);
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(44, 79, 158, 0.15);
}

.route-price {
  margin-top: 0.5rem;
  font-weight: bold;
  color: var(--accent);
}













.scroll-indicator {
  text-align: center;
  margin-top: 0.25rem;
  animation: bounce 1.5s infinite;
  opacity: 0.8;
}

.scroll-indicator i {
  font-size: 1rem;
  color: var(--gray);
  transition: opacity 0.3s ease;
}

.scroll-indicator:hover i {
  opacity: 1;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
    opacity: 0.8;
  }

  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}











/* ERROR */
.error {
  text-align: center;
  padding: 2rem;
  color: var(--accent);
  grid-column: 1 / -1;
}

.error i {
  font-size: 2rem;
  margin-bottom: 1rem;
}

@media (max-width: 1024px) {
  #cooperative-container {
    grid-template-columns: repeat(2, 1fr);
  }
}



@media (max-width: 768px) {

  .card-grid,
  #terminal-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    transition: 0.5s;
  }

  #cooperative-container {
    grid-template-columns: 1fr;
  }



  .section h2 {
    font-size: 1rem;
  }



  .accordion-toggle {
    display: inline-block;
    /* Mostrar el botón de acordeón */
  }

  #cooperative-section h2 {
    flex-wrap: wrap;
    /* Permite que el botón baje si no hay espacio */
  }

  .toggle-all-btn {
    font-size: 0.9rem;
    padding: 0.4rem 0.5rem;
  }

}

@media (max-width: 375px) {

  .card-grid,
  #terminal-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    transition: 1s;
  }

  .card-body {
    padding: 0.5rem;
    text-align: center;
  }

  .card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    height: auto;
  }

  .card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
  }

  .card-img-container {
    padding: 5px;
    height: 50px;
    overflow: hidden;
  }

  .card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
    
  }

  .card-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
  }

  .card-meta {
    font-size: 0.55rem;
    color: var(--gray);
  }







  .featured-description p {
    text-align: center;
  }



  .section h2 {
    font-size: 0.85rem;
  }

  .coop-header {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .coop-rating {
    padding: 0.2rem 0.5rem;
    font-weight: 500;
    gap: 0.2rem;
    font-size: small;
  }

  .info-icon {
    font-size: 1rem;
  }

  .coop-body {
    max-height: 280px;
    /* Ajusta según el diseño */
    overflow-y: auto;
    /* Habilita el desplazamiento vertical */
    padding-right: 0.2rem;
    /* Espacio para evitar que el scroll tape el contenido */
  }


}

@media (max-width: 320px) {

  .card-grid,
  #terminal-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }




  .featured-description p {
    text-align: center;
  }



  .section h2 {
    font-size: 0.75rem;
  }


}

/* Contenedor para el título y el botón */
#cooperative-section h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  /* Espaciado entre el título y el botón */
  margin: 0;
  /* Elimina márgenes adicionales */
}




/* Estilo del botón MOSTRAR TODAS */
.toggle-all-btn {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-all-btn:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
}

.toggle-all-btn:active {
  transform: scale(0.95);
}




/* Contenedor para el título y el botón */
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  /* Espaciado entre el título y el botón */
  margin-bottom: 1rem;
  /* Espaciado inferior para separar del contenido */
}



/* Estilo general para el botón "MOSTRAR TODAS" */
.toggle-all-btn {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.toggle-all-btn:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
  /* Efecto de hover */
}

.toggle-all-btn:active {
  transform: scale(0.95);
  /* Efecto al hacer clic */
}

/* Ajustes para pantallas más pequeñas */
@media (max-width: 767px) {
  .header-container {
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    /* Permite que el botón baje si no hay espacio */
  }

  .toggle-all-btn {
    font-size: 0.9rem;
    padding: 0.4rem 0.7rem;
  }
}

@media (max-width: 576px) {
  .toggle-all-btn {
    font-size: 0.8rem;
    padding: 0.3rem;
  }
}

@media (max-width: 320px) {
  .toggle-all-btn {
    font-size: 0.7rem;
    padding: 0.2rem;
  }
}

/* Nueva clase para el modal de información */
.info-modal {
  position: absolute;
  top: 120%;
  right: 0;
  min-width: 220px;
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  padding: 1rem;
  z-index: 100001;
  font-size: 0.95rem;
  cursor: auto;
}

.info-modal a {
  color: #234f9e;
  text-decoration: underline;
  word-break: break-all;
}

.info-modal p {
  margin: 0.5em 0 0.2em 0;
}