/* --------------------- GLOBAL --------------------- */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  background: #efefef;
  color: #2e4b35;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  flex-wrap: nowrap; /* 🔑 evita que se rompa el header en varias filas */
  box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* 👈 ESTA SOMBRA CREA EL EFECTO DE LÍNEA */

}

/* Contenedor de logos */
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0; /* evita que los logos encojan */
}

/* Logos específicos */
.header-left img.main-logo {
  height: 80px;
  width: auto;
}

.header-left img.secondary-logo-1 {
  width: 200px;
  height: auto;
}

.header-left img.secondary-logo-2 {
  height: 65px;
  width: auto;
}

.header-left img.secondary-logo-3 {
  height: 65px;
  width: auto;
}

.desktop-logo { display: inline-block; }
.mobile-logo { display: none; }

.header-center {
  flex-grow: 1;       /* 🔑 ocupa todo el espacio libre disponible */
  margin: 0 60px;     /* 🔑 crea hueco fijo a izquierda y derecha */
  text-align: center;
  font-size: 23px;    /* un poco más grande, 36px */
  line-height: 1.3;   /* que encaje mejor en 2 líneas */
  font-weight: 600;
  color: #2e4b35;
  white-space: normal; /* permite que haga salto de línea */
}

.header-center span {
  display: block;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0; /* 🔑 evita que los botones encojan */
}

header nav {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex: 1;
  max-width: 1400px;
  margin-left: auto;
}

header nav a {
  text-decoration: none;
  color: #2e4b35;
  padding: 8px 15px;
  border-radius: 6px;
  border: 1px solid #2e4b35;
  margin: 0 5px;
  background: #efefef;
  transition: all 0.2s ease;
  font-weight: 500;
}

header nav a:hover {
  background: #e0e0e0;
}

/* --------------------- DROPDOWN BONITO --------------------- */

/* Contenedor del dropdown */
header nav .dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* Botón Rutes */
header nav .dropdown > a {
  display: inline-flex;
  align-items: center;
  padding: 8px 15px;
  border: 1px solid #2e4b35;
  border-radius: 6px;
  background: #efefef;
  color: #2e4b35;
  font-weight: 500;
  margin: 0 5px;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Hover sobre el botón cambia el fondo */
header nav .dropdown > a:hover {
  background: #e0e0e0;
}

/* Contenido del dropdown */
header nav .dropdown-content {
  display: none;            /* oculto por defecto */
  position: absolute;
  top: 100%;                /* justo debajo del botón */
  left: 0;
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border-radius: 10px;
  padding: 10px 0;
  z-index: 100;
  transition: all 0.3s ease;
}

/* Mostrar dropdown al pasar el ratón sobre el botón */
header nav .dropdown:hover .dropdown-content {
  display: block;
}

/* Enlaces dentro del dropdown */
header nav .dropdown-content a {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  color: #2e4b35;
  font-weight: 500;
  border-radius: 6px;
  margin: 2px 10px;
  transition: all 0.2s ease;
}

/* Efecto al pasar el ratón sobre los enlaces */
header nav .dropdown-content a:hover {
  background-color: #d0e8d4;
  transform: translateX(5px);
}


footer {
  background: #efefef;
  color: #2e4b35;
  text-align: center;
  font-size: 14px;
  line-height: 1;
  padding: 6px 0;
  border-top: 1px solid #ccc;
  flex-shrink: 0;
  margin-top: auto;
}

footer p {
  margin: 0;
}

/* --------------------- MAIN --------------------- */
main {
  display: flex;
  justify-content: center;
  gap: 40px;          /* espacio entre poster y formulario */
  padding: 50px 30px; /* margen lateral igual a izquierda y derecha */
  align-items: stretch; /* fuerza que hijos tengan misma altura */
}

/* --------------------- RUTA / POSTER --------------------- */

.ruta-section {
  flex: 0 0 475px;    /* ancho fijo para el poster */
  display: flex;
  flex-direction: column;
  justify-content: stretch; /* fuerza altura completa */
}

.ruta-imagen {
  width: 100%;
  height: 100%;       /* ocupa toda la altura del contenedor */
  object-fit: cover;
  border: 6px solid #2e4b35;
  border-radius: 15px;
  box-sizing: border-box;  /* incluye borde en el tamaño total */
}

/* --------------------- FORMULARIO --------------------- */

.form-section-popup-pc {
  flex: 1;            /* ocupa el resto del espacio */
  max-width: 700px;
  background: #fff;
  padding: 40px 45px;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  gap: 25px;
  border: 6px solid #2e4b35; /* borde verde igual al poster */
  box-sizing: border-box;
}

/* Mantener altura del formulario igual al poster */
.form-section-popup-pc,
.ruta-section {
  min-height: 500px; /* opcional: asegura altura mínima consistente */
}
.form-section-popup-pc h2 {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: #2e4b35;
  margin-bottom: 30px;
}

.form-row {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
}

.form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-section-popup-pc label {
  font-weight: 600;
  color: #2e4b35;
}

.form-section-popup-pc input,
.form-section-popup-pc select {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 15px;
  background: #fff;
  color: #2e4b35;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.form-section-popup-pc input:focus,
.form-section-popup-pc select:focus {
  border-color: #2e4b35;
  box-shadow: 0 0 10px rgba(46,75,53,0.25);
  outline: none;
}

.form-button-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 25px;
}

.form-section-popup-pc button {
  padding: 14px 26px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid #2e4b35;
  background: #2e4b35;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-section-popup-pc button:hover {
  background: #3a5b44;
}

/* --------------------- NOTIFICATION --------------------- */
.notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #4caf50;
  color: white;
  padding: 16px 28px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  font-size: 16px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 9999;
  text-align: center;
  max-width: 80%;
  word-wrap: break-word;
  white-space: pre-line;
}

.notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.notification.error {
  background: #f44336;
}

/* --------------------- DROPDOWN --------------------- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #efefef;
  min-width: 160px;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.1);
  border-radius: 6px;
  z-index: 100;
}

.dropdown-content a {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: #2e4b35;
}

.dropdown-content a:hover {
  background-color: #d0e8d4;
}

.dropdown.show .dropdown-content {
  display: block;
}

/* --------------------- MEDIA QUERIES --------------------- */
@media (max-width: 992px) {
  main { padding: 30px 15px; gap: 30px; }
  .form-section-popup-pc { padding: 30px 25px; max-width: 600px; }
}

@media (max-width: 768px) {
  main { flex-direction: column; align-items: center; gap: 30px; padding: 20px 15px; }
  .form-row { flex-direction: column; gap: 20px; }
  .form-section-popup-pc { max-width: 100%; padding: 25px 20px; border-radius: 14px; }
  .ruta-imagen { max-width: 90%; height: auto; }
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 15px;
  }  
  .header-left {
    display: flex;
    flex-wrap: wrap;         /* permite pasar a segunda fila */
    justify-content: center; /* centra horizontalmente */
    gap: 10px;               /* espacio entre logos */
    margin-bottom: 15px;
  }

  .header-center {
    flex: none;
    margin: 0;
    font-size: 26px;   /* un poco más pequeño para móviles */
    line-height: 1.4;
    margin-bottom: 15px;
    max-width: 95%;    /* evita que se corte por los lados */
  }

  .header-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;             /* asegura que el bloque ocupe todo */
  }

  header nav {
    margin-left: 0;          /* ❌ elimina el empuje hacia la derecha */
    justify-content: center; /* ✅ centra todos los botones */
    width: 100%;             /* ocupa todo el ancho */
  }

  header nav a,
  header nav .dropdown > a {
    padding: 6px 12px;
    font-size: 14px;
  }


  .header-left img {
    flex: 0 0 48%;           /* dos logos por fila */
    max-width: 48%;
    height: auto;            /* mantiene proporción */
    object-fit: contain;     /* no recorta ni estira */
  }

  .header-left img.main-logo {
    order: 1; /* Ahora aparecerá segundo */
  }

  .header-left img.secondary-logo-1 {
    order: 2; /* Ahora aparecerá primero */
  }

  .header-left img.secondary-logo-2 {
    order: 3; /* Mantener el tercero */
  }

  .header-left img.secondary-logo-3 {
    order: 4; /* Mantener el tercero */
  }

  .desktop-logo { display: none; }
  .mobile-logo { display: inline-block; }

  /* Ajuste de tamaños si quieres */
  .header-left img.main-logo { height: 80px; }
  .header-left img.secondary-logo-1 { height: 80px; }
  .header-left img.secondary-logo-2 { height: 80px; }
  .header-left img.secondary-logo-3 { height: 80px; }
}

  .carousel .slide-text {
    width: 85%;        /* más ancho en móvil */
    max-width: none;   /* sin límite fijo */
    height: auto;      /* que crezca según el contenido */
    min-height: 200px; /* por si hay poco texto */
    padding: 20px;     /* un poco de aire */
  }

  .carousel .slide-text .titulo { font-size: 24px; }
  .carousel .slide-text .subtitulo { font-size: 18px; }
  .carousel .slide-text .fecha { font-size: 16px; }
  
}

@media (max-width: 600px) {
  body { font-size: 14px; }
  .notification { font-size: 14px; padding: 12px 20px; max-width: 90%; border-radius: 10px; }
  .form-section-popup-pc { padding: 20px; }
  .form-section-popup-pc button { font-size: 15px; padding: 14px; }
  .ruta-imagen { max-width: 90%; height: auto; }
}

/* ---------------- EXCLUSIVO RUTES.HTML ---------------- */

@media (max-width: 768px) {
  main.rutes-main {
    flex-direction: column;   /* stack vertical */
    align-items: center;
    gap: 25px;
    padding: 15px;
  }

  main.rutes-main .ruta-section {
    flex: none;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  main.rutes-main .ruta-imagen {
    width: 100%;
    max-width: 500px;
    height: auto;
  }

  main.rutes-main .form-section-popup-pc {
    width: 100%;
    max-width: 500px;
    padding: 20px 18px;
    border-radius: 14px;
    min-height: auto;
  }

  main.rutes-main .form-row {
    flex-direction: column;
    gap: 16px;
  }

  main.rutes-main .form-col {
    width: 100%;
  }

  main.rutes-main .form-section-popup-pc h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }

  main.rutes-main .form-section-popup-pc input,
  main.rutes-main .form-section-popup-pc select {
    font-size: 14px;
    padding: 10px 12px;
  }

  main.rutes-main .form-section-popup-pc button {
    font-size: 15px;
    padding: 12px 18px;
  }
}

@media (max-width: 480px) {
  main.rutes-main .form-section-popup-pc {
    padding: 15px;
  }

  main.rutes-main .form-section-popup-pc h2 {
    font-size: 20px;
  }

  main.rutes-main .ruta-imagen {
    max-width: 100%;
  }
}
