/* --- Variables para Colores y Espaciado --- */
:root {
  --primary-color: #1F4282;
  --secondary-color: #4b679b;
  --tertiary-color: #8fa0c0;
  --text-color-light: white;
  --text-color-dark: #1F4282;
  --footer-color: #00275c;
  --footer-text-color: #757a82;
  --link-color-dark: #1F4282;
  --link-color-light: white;
  --card-background: white;
  --shadow-light: rgba(0,0,0,0.1);
  --shadow-medium: rgba(0,0,0,0.2);
  --shadow-strong: rgba(0,0,0,0.3);
  --border-radius: 8px;
  --transition-speed: 0.3s;
}

/* --- Reset básico y Estilos del Cuerpo --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  /* FUENTE BASE: ROBOTO (Debe estar enlazada en el HTML) */
  font-family: 'Roboto', sans-serif; 
  background-color: var(--primary-color); /* Color por defecto, será sobrescrito por clases .body-xxx */
  color: var(--text-color-light);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.6;
  padding-top: 40px;
}

.rethink {
  /* FUENTE PARA LOGO/MARCA */
  font-family: 'Saira', sans-serif;
  font-weight: 700;
}

/* --- Menú y Desplegable --- */
.menu {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
}

.dropdown {
  position: relative;
}

.dropbtn {
  /* Valores por defecto: Fondo azul oscuro, texto/ícono blanco */
  background-color: var(--primary-color);
  color: var(--text-color-light); 
  padding: 10px 20px;
  font-size: 32px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.dropbtn:hover {
  background-color: var(--secondary-color);
  transform: scale(1.05);
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--card-background);
  min-width: 160px;
  box-shadow: 0 8px 16px var(--shadow-medium);
  z-index: 101;
  border-radius: var(--border-radius);
}

.dropdown-content a {
  color: var(--text-color-dark);
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  transition: all var(--transition-speed) ease;
}

.dropdown-content a:hover {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
}

.dropdown:hover .dropdown-content {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

.has-submenu {
  position: relative;
}

.submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background-color: var(--card-background);
  min-width: 200px;
  box-shadow: 0 8px 16px var(--shadow-medium);
  border-radius: var(--border-radius);
  z-index: 102;
  animation: fadeIn 0.2s ease-in-out;
}

.submenu a {
  color: var(--text-color-dark);
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.submenu a:hover {
  background-color: var(--tertiary-color);
  color: var(--text-color-light);
}

.has-submenu:hover .submenu {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Estilos del ícono de hamburguesa (SVG) --- */
.hamburger-icon {
  fill: white;
  stroke-linecap: round;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.hamburger-icon .line {
  transition: all var(--transition-speed) ease;
  transform-origin: center;
}

.dropbtn:hover .line.top {
  transform: translateY(20px) rotate(45deg);
}

.dropbtn:hover .line.middle {
  opacity: 0;
}

.dropbtn:hover .line.bottom {
  transform: translateY(-20px) rotate(-45deg);
}

/* --- Encabezado y Logo --- */
.header-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50px;
  padding: 30px 0;
}

.header-home {
  padding-top: 50px;
}

.header-contact {
  padding: 20px 0 20px 0;
}

.header-wrapper .logo {
  max-width: 400px;
  width: 100%;
  height: auto;
}

h1.servicios {
  /* FUENTE PARA TÍTULOS PRINCIPALES */
  font-family: 'Saira', sans-serif;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--text-color-light);
  text-align: center;
}

.servicios .rethink {
  font-weight: 700;
}

.servicios .validate {
  /* ROBOTO para texto secundario en el H1 */
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
}

/* --- Contenido Principal --- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0px;
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* --- Página de Inicio (Tira de Imágenes) --- */
.image-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  padding: 10px 0;
}

.image-strip img {
    /* Nueva propiedad para evitar Layout Shift */
    aspect-ratio: attr(width) / attr(height);
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
    margin-top: 50px; 
}

.image-strip img:hover {
  transform: translateY(-10px);
  box-shadow: 0 4px 12px var(--shadow-strong);
  filter: brightness(1.15) grayscale(0.75);
}

.contact-info {
  text-align: center;
  margin-top: 30px;
  padding: 10px;
}

.contact-link {
  color: var(--link-color-light);
  text-decoration: none;
  font-size: 1.1rem;
  transition: color var(--transition-speed) ease;
}

.contact-link:hover {
  color: #cce0ff;
  text-decoration: underline;
}

/* --- Páginas de Servicios (Tarjetas) --- */
.card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px var(--shadow-light);
  color: var(--text-color-dark);
  margin-top: 20px;
}

.card h2 {
  /* SAIRA PARA TÍTULOS DE TARJETA */
  font-family: 'Saira', sans-serif;
  font-weight: 600;
  text-align: center;
  margin-top: 0;
}

.card ul {
  margin: 10px 0 20px 20px;
  list-style: none;
  padding-left: 0;
}

.card ul li::before {
  content: '•';
  color: var(--secondary-color);
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

.card p {
  text-align: center;
  font-size: 16px;
}

.centered-text {
  font-size: 1.25rem;
  font-weight: 500;
  padding: 10px 0;
}

.card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
}

/* --- Página de Contacto (Formulario) --- */
.form-container {
  background-color: var(--card-background);
  padding: 30px;
  border-radius: var(--border-radius);
  color: var(--text-color-dark);
  box-shadow: 0 2px 8px var(--shadow-light);
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  margin-top: 20px;
}

.form-container h2,
.form-container p {
  text-align: center;
  margin-bottom: 20px;
}

.form-container form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-container label {
  font-size: 14px;
  color: var(--text-color-dark);
  margin-bottom: -10px;
  font-weight: 500;
}

.form-container input,
.form-container textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f7f7f7;
  color: var(--text-color-dark);
  font-size: 14px;
  /* ROBOTO para campos de formulario */
  font-family: 'Roboto', sans-serif; 
  transition: all var(--transition-speed) ease;
}

.form-container input:focus,
.form-container textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  background-color: #fff;
}

.form-container input::placeholder,
.form-container textarea::placeholder {
  color: #a0a0a0;
}

.form-container .button-group {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

/* --- Botones y Enlaces Comunes --- */
.cta, .link-azul {
  padding: 12px 24px;
  border-radius: 5px;
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
  transition: all var(--transition-speed) ease;
  text-align: center;
}

.cta {
  background-color: var(--primary-color);
  color: var(--text-color-light);
  border: 1px solid var(--primary-color);
  box-shadow: 0 3px 6px var(--shadow-medium);
}

.cta:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px var(--shadow-strong);
}

.link-azul {
  color: var(--link-color-dark);
  text-decoration: underline;
  transition: color var(--transition-speed) ease;
}

.link-azul:hover {
  color: var(--secondary-color);
}

.small-link {
  font-size: 14px;
  color: var(--text-color-light);
  text-decoration: underline;
  text-align: center;
  display: block;
  margin-top: 20px;
  transition: color var(--transition-speed) ease;
}

.small-link:hover {
  color: #cce0ff;
}

/* --- Pie de Página --- */
.footer {
  text-align: center;
  font-size: 14px;
  color: var(--footer-text-color);
  padding: 10px 0;
  background-color: var(--footer-color);
  border-top: 1px solid var(--footer-text-color);
  margin-top: auto;
}

/* --- Media Queries para la Responsividad --- */
@media (max-width: 768px) {
  .menu {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
  }

  .dropdown-content {
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 250px;
    text-align: center;
  }

  .has-submenu .submenu {
    top: auto;
    left: 0;
    position: relative;
    width: 100%;
  }

  .has-submenu:hover .submenu {
    display: block;
  }

  .header-home {
    padding-top: 80px;
  }
}

@media (max-width: 500px) {
  .form-container {
    padding: 10px;
  }

  .form-container h2,
  .form-container p {
    margin-bottom: 10px;
  }

  .form-container form {
    gap: 10px;
  }

  .form-container label {
    margin-bottom: -5px;
  }
}

/* --- NUEVOS ESTILOS PARA LA PÁGINA DE EXPERIENCIA --- */
.experience-intro {
  color: var(--text-color-light);
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
  text-align: justify;
}

.experience-intro p {
  line-height: 1.8;
  font-size: 1.1rem;
}

.experience-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px var(--shadow-light);
  color: var(--text-color-dark);
  padding: 20px;
  text-align: center;
  transition: transform var(--transition-speed) ease;
  margin-top: 20px;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px var(--shadow-medium);
}

.project-card h2 {
  /* SAIRA PARA TÍTULOS DE PROYECTO */
  font-family: 'Saira', sans-serif;
  font-weight: 600;
  margin-top: 10px;
  margin-bottom: 5px;
}

.project-card p {
  font-size: 0.95rem;
  margin-bottom: 15px;
}

.project-image {
    /* La propiedad aspect-ratio asegura que no haya Layout Shift */
    aspect-ratio: attr(width) / attr(height);
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius);
    max-width: 100%;
}

@media (max-width: 768px) {
  .experience-container {
    grid-template-columns: 1fr;
    padding: 10px;
  }
}


/* ------------------------------------------- */
/* --- COLORES DE FONDO Y MENÚ DINÁMICOS --- */
/* ------------------------------------------- */

/* Fondo para 'index' */
.body-index{
  background-color: #1f4282; 
  .body-index .dropbtn,
}
.body-index .dropbtn{
  background-color:#1f4282 ;
}
/* y 'advisory'*/
.body-advisory {
  background-color: #78AEDE; 
}

/* AHORA EL BOTÓN DEL MENÚ EN INDEX/ADVISORY COINCIDE CON EL FONDO */
.body-advisory .dropbtn {
    background-color: #78AEDE;
}


/* Fondo para 'drive' */
.body-drive {
  background-color: #151845;
}

/* AJUSTE CLAVE: EL BOTÓN DEL MENÚ EN DRIVE COINCIDE CON EL FONDO */
.body-drive .dropbtn {
    background-color: #151845;
}


/* Fondo para 'validate' (Blanco) */
.body-validate {
  background-color:#f5f5f3; 
  /* CAMBIO DE CONTRASTE: Todo el texto del body es oscuro */
  color: var(--text-color-dark); 
}

/* --- AJUSTES ESPECÍFICOS DEL MENÚ PARA FONDO BLANCO (.body-validate) --- */

/* El botón del menú en fondo blanco usa primary-color para destacarse */
.body-validate .dropbtn {
    background-color: var(--primary-color); 
    color: var(--text-color-light); /* Texto/número del botón blanco */
}

/* El ícono de la hamburguesa debe ser blanco para contrastar con el fondo oscuro del botón */
.body-validate .hamburger-icon {
    fill: var(--text-color-light); 
}

/* AJUSTES ADICIONALES DE CONTRASTE PARA EL BODY-VALIDATE */

/* El encabezado principal (H1) debe ser oscuro sobre el fondo blanco */
.body-validate h1.servicios {
    color: var(--text-color-dark);
}

/* Los enlaces de contacto en el footer/contacto deben usar el color oscuro */
.body-validate .contact-link,
.body-validate .small-link {
    color: var(--text-color-dark);
}
.body-validate .contact-link:hover,
.body-validate .small-link:hover {
    color: var(--secondary-color);
}