body {
  font-family: sans-serif;
  margin: 0;
  padding: 1rem;
  background: #f9f9f9;
  width: 100vw;
  box-sizing: border-box;
}

main.main {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

header {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2em;
  margin: 1rem;
}

header > img {
  width: min(3rem,8.5vw);
}

h1 {
  color: #cc0000;
  font-size: min(3rem,8.5vw);
  margin: 0;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
}

h2, h3 {
  color: green;
}

h3 {
  font-size: 135%;
  margin: 0;
  text-align: center;
}

input {
  padding: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

button {
  padding: 0.5rem;
  background: #cc0000;
  color: white;
  border: none;
  cursor: pointer;
  width: 100%;
  font-size: 115%;
}

button#restartBtn, a.button {
  padding: 0.5rem;
  background: gainsboro;
  color: black;
  border: none;
  cursor: pointer;
  /*width: 100%;*/
  border-color: black;
  border-width: 5px;
  border-style: solid;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 120%;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
}

a.subpagelink div {
  width: clamp(120px, 25vw, 220px); /* 🔥 tamaño responsive */
  aspect-ratio: 1.0;
  display: flex;
  position: relative;
  border-width: 5px;
  border-style: solid;
  border-color: black;
  border-radius: 5px;
  overflow: hidden;         /* Evita desbordes de imagen */
}

a.subpagelink div span {
  position: absolute;
  bottom: 0px;
  left: 0px;
  right: 0px;
  /* min-width: 100px; */
  text-align: center;
  padding: .5rem;
  color: black;
  background: rgba(255,255,255,0.8);
}

a.subpagelink div img {
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* 🔥 Ajustes para pantallas muy pequeñas */
@media (max-width: 480px) {
  a.subpagelink div {
    width: 42vw;
  }
  a.subpagelink div span {
    font-size: 0.8rem;
  }
}

#geoBusMap {
  height: 95vw;
  display: none;
  margin-top: 20px;
}

#stopByCode {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

button#lookupBtn {
  margin: 0;
  width: 55%;
}

input#stopIdInput {
  width: 40%;
  margin: 0;
  text-align: center;
  height: 100%;
  font-size: 107%;
}

label#inputCode {
  color: black;
  font-weight:bold;
  font-size: 115%;
}

ul {
  list-style: none;
  padding: 0;
}

#controls {
  background: #f7f7f7;
}

#map {
  height: 50vh;
  display: none;
}

#busmap {
  height: 60vh;
  display: block;
}

select, input {
  margin-right: 1em;
  padding: 0.5em;
  width: 100%;
}

#results {
  padding-top: 1em;
  list-style: none;
}

#cercador {
  display: none;
}

li {
  margin-bottom: 1em;
}

#reloadBtn:disabled {
  display: none;
}
	
.contenido-bus-TMB {
  background: #ffe6e6;
  border-width: 2px;
  border-style: solid;
  border-color: #da291c;
  border-radius: 8px;
  padding: 0.5rem;
  width: 100%;
}

.contenido-bus-AMB {
  background: #fff3e0;
  border-width: 2px;
  border-style: solid;
  border-color: #ffaa00;
  border-radius: 8px;
  padding: 0.5rem;
  width: 100%;
}

.contenido-bus-ATM {
  background: #adf3b6;
  border-width: 2px;
  border-style: solid;
  border-color: #387421;
  border-radius: 8px;
  padding: 0.5em;
  width: 100%;
}

.contenido-bus-MOV {
  background: #ffb25a;
  border-width: 2px;
  border-style: solid;
  border-color: #d35f00;
  border-radius: 8px;
  padding: 0.5em;
  width: 100%;
}

.blockSection {
  border-width: 5px;
  border-color: green;
  border-style: solid;
  padding: 8px;
  margin-top: 5px;
  margin-bottom: 25px;
}

.blockSection#resultsBlock {
  display: none;
}

.BusTMB, .BusAMB, .BusATM {
  display: flex;
  align-items: stretch;
}
.barra-izquierda {
  width: 10px;
  border-radius: 20px 20px 20px 20px;
  margin-right: 10px;
}

.linea-azul-oscuro {
  background-color: #003366; /* Azul oscuro horizontales */
}

.linea-verde {
  background-color: #00ff00; /* Verde verticales */
}

.linea-lila {
  background-color: #8A2BE2; /* Lila diagonales */
}

.linea-negra {
  background-color: #000000; /* Negro express */
}

.linea-azul-palido {
  background-color: #87CEFA; /* Azul pálido nocturnas */
}

.linea-roja {
  background-color: #FF0000; /* Rojo convencionales */
}

.linea-amarilla {
  background-color: #FFD700; /* Amarillo diurnas AMB */
}

.linea-verde-oscuro {
  background-color: #006400; /* Verde oscuro ATM */
}

.linea-naranja {
  background-color: #ff8000; /* Naranja ATM */
}

.bigest {
  padding: 1rem;
}