/* ------------------------------------------------- */
/* Estilos globales y para pantallas grandes (>= 992px) */
/* ------------------------------------------------- */

/* Cabecera de la sección de “Servicios” */
.tittle {
    position: relative;
    overflow: hidden;
    max-height: 190px;
    text-align: center;
  }
  .tittle .overlay {
    background-color: rgba(17, 60, 98, 0.2);
  }
  .tittle img {
    display: block;
    width: 115%;
    height: auto;
    margin: 0 auto;
  }
  .tittle h2 {
    position: absolute;
    top: 50%;
    left: 32%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: serif;
    margin: 0;
    font-size: 59px;
    font-weight: 300;
  }
  
  /* Contenedor principal “services” y su texto */
  .services {
    background: #e5e5e5;
    padding: 40px 5%;
    text-align: center;
    font-family: Arial, sans-serif;
  }
  .services > p {
    max-width: 780px;
    margin: 15px auto 60px;
    color: #043B63;
    text-align: center;
    font-family: system-ui;
    font-weight: 300;
    font-size: 21px;
    letter-spacing: 1px;
    line-height: 30px;
  }
  .services span {
    font-family: adobe-caslon-w01-smbd, serif;
    font-weight: bold;
  }
  
  /* “.boxes” para organizar las tarjetas (box) */
  .boxes {
    display: flex;
    flex-wrap: wrap; /* Permite que salten a la siguiente fila si no caben */
    gap: 10px;
    justify-content: center;
  }
  
  /* Cada tarjeta (box) */
  .box {
    background: #043B63;
    color: #fff;
    width: 200px;
    min-height: 400px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: default;
  }
  .box:hover {
    transform: translateY(-10px);
  }
  /* Número y título */
  .box-number {
    font-size: 50px;
    font-family: system-ui;
    font-weight: bold;
    margin: 0 0 5px;
    cursor: default;
  }
  .box-title {
    font-weight: 400;
    font-family: system-ui;
    font-size: 20px;
    text-transform: uppercase;
    cursor: default;
  }
  
  /* Texto largo que aparece en hover */
  .hover-text {
    display: none;
    font-size: 17px;
    font-weight: 300;
    font-family: system-ui;
    margin-top: 5px;
    text-align: justify;
    cursor: default;
  }
  .box:hover .hover-text {
    display: block;
  }
  .box:hover .box-number,
  .box:hover .box-title {
    display: none;
  }
  
  /* Transición de color (gradient) */
  .gradient {
    min-height: 50px;
    background: linear-gradient(to bottom, #e5e5e5, #9bb1d0);
  }
  
  /* Sección con imagen + texto */
  .info-section {
    width: 100%;
    display: flex;         /* Dos columnas: imagen + texto */
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    background-color: #9bb1d0;
    height: 620px;         /* Forzamos altura, OK en escritorio */
    overflow: hidden;
  }
  
  .info-section .info-image {
    position: relative;
    width: 40%;
    height: 100%;
    overflow: hidden;
  }
  .info-section .info-image .overlay-2 {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #9bb1d0, #9bb1d09d);
  }
  .info-section .info-image img {
    width: 100%;
    height: auto;
    display: block;
    transform: translateY(-10%); /* Sube un poco la imagen en escritorio */
  }
  /* Texto encima de la imagen */
  .info-section .info-image h2 {
    position: absolute;
    top: 40%;
    left: 60%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: #043B63;
    font-size: 72px;
    font-family: serif;
    margin: 0;
    font-weight: 600;
    text-align: justify;
  }
  
  /* Texto al lado de la imagen */
  .info-section .info-text {
    position: relative;
    width: 60%;
    margin: 0 auto;
  }
  
  .info-section .info-text .overlay-3 {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    max-width: 500px;
    height: 120%;
    background-color: #ebebeb;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    z-index: 0;
  }
  
  /* Contenedor real del texto */
  .info-section .info-text .text-space {
    position: relative;
    z-index: 1;
    margin: auto;
    color: #000;
    font-family: system-ui;
    max-width: 460px;
    display: flex;
    flex-direction: column;
  }
  .info-section .info-text .text-space h3 {
    margin: auto;
    color: #043B63;
    font-family: system-ui;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    padding-bottom: 0px;
  }
  .info-section .info-text .text-space p {
    width: 85%;
    margin: auto;
    padding-top: 0px;
    padding-bottom: 30px;
    text-align: justify;
    color: #043B63;
    font-family: system-ui;
    font-weight: 300;
    font-size: 16px;
    display: flex;
  }
  
  /* ========================================================= */
  /* ====================== MEDIA QUERIES ===================== */
  /* ========================================================= */
  
  /* ----- Pantallas medianas (tablets): <= 992px ----- */
  @media (max-width: 992px) {
  
    /* Ajustar la imagen y el texto de .info-section */
    .info-section .info-image,
  .info-section .info-text {
    width: 100%;       /* Cada uno toma todo el ancho */
    margin-bottom: 20px;
  }
  
  /* La imagen */
  .info-section .info-image {
    height: auto;      /* Deja que la altura se ajuste al ancho en móviles */
  }
  .info-section .info-image img {
    transform: none;   /* Desactivamos el -10% para que no “suba” la imagen */
  }
  
  /* El texto encima de la imagen (h2) puede romper en pantallas pequeñas 
     si sigue siendo absolute. Una opción es quitar el absolute: */
  .info-section .info-image h2 {
    position: static;
    transform: none;
    margin-top: 20px;      /* Algo de separación */
    text-align: center; 
    font-size: 2rem;       /* Reducimos la fuente en pantallas más pequeñas */
  }
  
  /* Quita o adapta el overlay de la imagen */
  .info-section .info-image .overlay-2 {
    display: none; /* Opcional: si no quieres overlay en móvil */
  }

  /* El overlay-3 (fondo blanco) detrás del texto 
     Puede meterse en conflicto con el “wrap”. Lo hacemos “static”. */
  .info-section .info-text .overlay-3 {
    position: static;
    transform: none;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
  }
  
  .info-section .info-text .text-space {
    position: static;
    margin: 0 auto;
    max-width: 100%;
    padding: 20px; /* Un padding para que no quede el texto pegado */
  }
  
  .info-section .info-text .text-space h3 {
    font-size: 1rem;
    margin-bottom: 5px;
  }
  .info-section .info-text .text-space p {
    font-size: 0.9rem;
    padding-bottom: 15px;
  }
}
  
@media (max-width: 768px) {
  /* Evita scroll horizontal para que no se muevan header/footer */
  html, body {
    overflow-x: hidden;
  }

  /* -------- Sección Título (.tittle) -------- */
  .tittle {
    position: relative;
    height: 200px;
    overflow: hidden;
  }
  .tittle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
  }
  .tittle .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 60, 98, 0.3);
    z-index: 1;
  }
  .tittle h2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: #fff;
    z-index: 2;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    margin: 0;
    text-align: center;
    padding: 0 10px;
  }

  /* -------- Sección de Servicios (.services) -------- */
  .services {
    padding: 30px 5%;
    background: #e5e5e5;
  }
  .services > p {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 20px auto;
    text-align: center;
    max-width: 90%;
    color: #043B63;
  }
  
  /* -------- Cajas de servicios (.boxes y .box) -------- */
  /* Ahora se organizan verticalmente */
  .boxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 5%;
  }
  .box {
    background: #043B63;
    color: #fff;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, max-height 0.3s ease;
    
    /* Estado por defecto: altura reducida para que se vean al menos 3 en pantalla */
    max-height: 120px;
    
    /* Para centrar el contenido */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    /* Animación de entrada */
    opacity: 0;
    transform: translateY(30px);
    animation: mobileFadeIn 0.6s forwards;
  }
  /* Retraso escalonado (ajusta si tienes más cajas) */
  .boxes .box:nth-child(1) { animation-delay: 0.2s; }
  .boxes .box:nth-child(2) { animation-delay: 0.3s; }
  .boxes .box:nth-child(3) { animation-delay: 0.4s; }
  .boxes .box:nth-child(4) { animation-delay: 0.5s; }
  
  /* Contenido interno de cada caja */
  /* Por defecto se muestran el número y el título */
  .box .box-number,
  .box .box-title {
    opacity: 1;
    transition: opacity 0.5s ease;
    font-size: 1rem;
    text-align: center;
  }
  /* El texto extendido (hover-text) está oculto inicialmente */
  .box .hover-text {
    opacity: 0;
    transition: opacity 0.5s ease;
    font-size: 0.9rem;
    margin-top: 5px;
    line-height: 1.2;
    text-align: center;
  }
  /* Cuando la caja tenga la clase “active”: */
  .box.active {
    transform: scale(1.03);
    /* Se expande para dar cabida al texto extra */
    max-height: 300px;
  }
  .box.active .hover-text {
    opacity: 1;
  }
  .box.active .box-number,
  .box.active .box-title {
    opacity: 0;
  }

  /* -------- Sección Gradient -------- */
  .gradient {
    height: 40px;
    background: linear-gradient(to bottom, #e5e5e5, #9bb1d0);
  }

  /* -------- Sección Información (.info-section) -------- */
  .info-section {
    flex-direction: column;
    height: auto;
    padding: 20px 5%;
    background: #9bb1d0;
  }
  .info-section .info-image,
  .info-section .info-text {
    width: 100%;
  }
  .info-section .info-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    margin-bottom: 20px;
  }
  .info-section .info-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
  }
  .info-section .info-image h2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #043B63;
    z-index: 2;
    text-align: center;
    padding: 0 10px;
  }
  .info-section .info-text .text-space {
    padding: 15px;
    background: #ebebeb;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  .info-section .info-text .text-space h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #043B63;
  }
  .info-section .info-text .text-space p {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #043B63;
    margin-bottom: 15px;
  }
}

/* Animación de entrada para los boxes en móviles */
@keyframes mobileFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

  