/* styles/css/style.css */

/* --- 1. Estilos Generales/Base --- */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #eef2f7;
    color: #333;
    line-height: 1.7;
    scroll-behavior: smooth;
}

/* Enlaces generales */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Estilos para el texto en negrita (general) */
p strong {
    color: #0056b3;
}

/* --- 2. Estilos del Encabezado (header) --- */
header {
    background-color: #004080;
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000; /* Asegura que el header esté sobre otros elementos */
}

.header-content {
    display: flex;
    justify-content: space-between; /* Distribuye el espacio entre logo y nav */
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Permite que el logo y el h1 se ajusten y empujen el menu-toggle al otro lado */
}

.logo {
    max-width: 80px;
    height: auto;
    margin-right: 15px;
}

header h1 {
    margin: 0 0 0 15px;
    font-size: 2.2em;
    white-space: nowrap;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

/* Navegación Principal (Escritorio) */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* Para poner los ítems del menú en fila */
}

.main-nav li {
    margin-left: 30px; /* Espacio entre los elementos del menú */
}

.main-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    padding: 5px 0;
    position: relative; /* Para el efecto de subrayado */
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background-color: #007bff; /* Color del subrayado */
    bottom: -5px; /* Posición debajo del texto */
    left: 0;
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%; /* El subrayado se expande al pasar el ratón */
}

/* Menú Hamburguesa (Icono) */
.menu-toggle {
    display: none; /* Oculto por defecto en escritorio */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    cursor: pointer;
    z-index: 1001; /* Asegura que esté sobre el header */
    margin-left: 20px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animación del icono de hamburguesa a "X" */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* --- 3. Menú Móvil Deslizable (Off-canvas) --- */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -280px; /* Inicialmente fuera de la pantalla */
    width: 280px; /* Ancho del menú móvil */
    height: 100%;
    background-color: #004080; /* Mismo color que el header */
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    transition: right 0.4s ease-in-out;
    z-index: 999; /* Por debajo del header, pero sobre el contenido */
    padding-top: 80px; /* Espacio para que el menú no quede debajo del header */
    box-sizing: border-box;
}

.mobile-nav.active {
    right: 0; /* Desliza el menú a la vista */
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Separador entre ítems */
}

.mobile-nav li:last-child {
    border-bottom: none;
}

.mobile-nav a {
    display: block;
    color: #fff;
    padding: 15px 20px;
    text-decoration: none;
    font-size: 1.2em;
    transition: background-color 0.3s ease;
}

.mobile-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Capa de Superposición Oscura (Overlay) */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 998; /* Por debajo del menú móvil */
    opacity: 0; /* Inicialmente invisible */
    visibility: hidden; /* También oculto */
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

.overlay.active {
    opacity: 1; /* Se hace visible cuando el menú móvil está abierto */
    visibility: visible;
}

/* --- 4. SECCIÓN DE HÉROE (CARRUSEL) --- */
.hero-section {
    position: relative;
    height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-container {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.8s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* El contenido del héroe va SOBRE el carrusel */
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 30px;
    border-radius: 8px;
    color: #fff;
}

.hero-content h2 {
    font-size: 2.8em;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    color: #fff;
    border-bottom: none;
    padding-bottom: 0;
}

.hero-content p {
    font-size: 1.3em;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    color: #fff;
    text-align: center;
}

/* Navegación del Carrusel (Flechas) */
.carousel-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 2em;
    z-index: 3;
    transition: background-color 0.3s ease;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-nav .prev {
    left: 20px;
}

.carousel-nav .next {
    right: 20px;
}

/* Puntos de Navegación del Carrusel */
.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 10px;
}

.carousel-dots .dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.carousel-dots .dot.active {
    background-color: #fff;
    transform: scale(1.2);
}

/* --- 5. Estilos para la Sección Principal (main) --- */
main {
    padding: 20px;
    max-width: 1100px;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

/* Estilos para las Secciones (section) dentro del main */
section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #fcfcfc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

section:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

/* Títulos de Sección (h2 y h3) */
section h2 {
    color: #004080;
    font-size: 2.2em;
    margin-bottom: 25px;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
}

section h3 {
    color: #0056b3;
    font-size: 1.5em;
    margin-top: 30px;
    margin-bottom: 15px;
    text-align: center;
}

/* Párrafos en main */
main p {
    text-align: center;
    margin-bottom: 1.2em;
    font-size: 1.1em;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* --- 6. ESTILOS DE LOS BOTONES DE SERVICIO (DOBLE DE GRANDES) --- */
.service-buttons-section {
    /* Puedes añadir estilos específicos para la sección si es necesario */
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 50px 0;
    flex-wrap: wrap;
}

.service-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 300px;
    background-color: transparent;
    color: #fff;
    text-decoration: none;
    border-radius: 50%;
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 20px;
    background-size: cover;
    background-position: center;
    border: 5px solid #007bff;
    box-sizing: border-box;
}

.service-button:first-child {
    background-image: url('../../images/imp.png');
}

.service-button:last-child {
    background-image: url('../../images/asc.png');
}

.service-button img {
    display: none;
}

.service-button span {
    display: block;
    margin-top: 15px;
    font-size: 1.1em;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
}

.service-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.5);
}

/* --- 7. ESTILOS DE LA SECCIÓN QUIÉNES SOMOS --- */
.about-us-section p {
    text-align: justify;
    margin-left: auto;
    margin-right: auto;
    max-width: 900px;
}
.about-us-section p strong {
    color: #004080;
}

/* --- 8. Estilos para la Información de Contacto --- */
.contact-info ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 20px 0;
    text-align: center;
}

.contact-info ul li {
    margin-bottom: 10px;
}

.contact-info ul li a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.contact-info ul li a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* --- 9. Estilos para el Pie de Página (footer) --- */
footer {
    background-color: #222;
    color: #eef2f7;
    text-align: center;
    padding: 25px 0;
    margin-top: 50px;
    font-size: 0.9em;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

/* --- 10. Botón Flotante de WhatsApp --- */
.whatsapp-float {
    position: fixed;
    width: 80px;
    height: 80px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-float img {
    width: 50px;
    height: 50px;
    filter: brightness(0) invert(1);
}

/* Estilo para el mensaje flotante (¡AHORA SIEMPRE VISIBLE!) */
.whatsapp-float::after {
    content: "¿En qué puedo ayudarte?";
    position: absolute;
    right: calc(100% + 15px);
    bottom: 50%;
    transform: translateY(50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    white-space: nowrap;
    font-size: 0.9em;
    pointer-events: none;
    z-index: 999;
}

.whatsapp-float:hover {
    background-color: #1da851;
    transform: scale(1.1);
    box-shadow: 3px 3px 6px rgba(0,0,0,0.6);
}

/* --- 11. Media Queries para Responsividad --- */

@media (max-width: 768px) {
    /* Ajustes del Header */
    header {
        padding: 10px 0;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
        flex-wrap: nowrap;
    }

    .logo-container {
        flex-grow: 0;
    }

    header h1 {
        display: none; /* OCULTA EL TÍTULO h1 EN PANTALLAS DE 768px O MENOS */
        font-size: 1.8em;
        margin-left: 10px;
    }

    .logo {
        max-width: 60px;
    }

    /* Ocultar el menú de escritorio y mostrar la hamburguesa */
    .main-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    /* Ajustes del Menú Móvil Deslizable */
    .mobile-nav {
        width: 250px;
        padding-top: 75px;
    }

    /* Ajustes en media queries para el carrusel */
    .hero-section {
        height: 350px;
    }
    .hero-content h2 {
        font-size: 1.8em;
    }
    .hero-content p {
        font-size: 1em;
    }
    .carousel-nav button {
        width: 40px;
        height: 40px;
        font-size: 1.5em;
        padding: 10px;
    }
    .carousel-dots .dot {
        width: 10px;
        height: 10px;
    }

    .button-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    .service-button {
        width: 250px;
        height: 250px;
        font-size: 1.1em;
    }

    main {
        margin: 10px auto;
        padding: 15px;
    }

    section {
        margin-bottom: 30px;
        padding: 15px;
    }

    section h2 {
        font-size: 1.8em;
    }

    main p {
        font-size: 1em;
    }

    .contact-info ul li a {
        font-size: 1em;
    }

    .whatsapp-float {
        width: 65px;
        height: 65px;
        bottom: 20px;
        right: 20px;
    }
    .whatsapp-float img {
        width: 40px;
        height: 40px;
    }
    /* El mensaje flotante (::after) se oculta en pantallas pequeñas */
    .whatsapp-float::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 300px;
    }
    .hero-content h2 {
        font-size: 1.5em;
    }
    .hero-content p {
        font-size: 0.9em;
    }
    .btn-primary {
        padding: 12px 25px;
        font-size: 1em;
    }
    .service-button {
        width: 200px;
        height: 200px;
        font-size: 1em;
    }
    .carousel-nav button {
        display: none;
    }
    .carousel-dots {
        bottom: 10px;
    }
} /* <--- ¡Esta era la llave de cierre que faltaba! */

/* Clase para deshabilitar el scroll del body cuando el menú móvil está abierto */
body.no-scroll {
    overflow: hidden;
}