/*
 * Archivo: assets/css/home.css
 * Mantenimiento Industrial e Informático (MII) - Estilos Base
 * Versión final: Menú Degradado, Formulario Transparente, Ajustes de color en SOMOS.
 */

/* --- Estilos Generales y Reseteo --- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
	font-family: 'Geological', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

section[id] {
    /* Compensación de la altura del menú fijo (70px) */
    scroll-margin-top: 70px;
}

/* --- HEADER Y MENÚ DE NAVEGACIÓN --- */

.main-header {
    /* AJUSTE: Aplicando degradado vertical de #002d5d a #003872 */
    background: linear-gradient(to bottom, #002d5d, #003872);
    
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: sticky; 
    top: 0;
    z-index: 1000;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
}

.logo-container {
    height: 100%;
    display: flex;
    align-items: center;
    padding-top: 0; 
}

.logo {
    height: 60px; 
    width: auto;
    display: block;
    opacity: 1; 
    transition: none; 
}

.logo:hover {
    opacity: 1;
}

/* Menú Toggle (Hamburguesa) - Oculto por defecto en escritorio */
.menu-toggle {
    display: none; 
    color: #cfe2f3; 
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    margin-left: 20px; 
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
    height: 70px;
    display: flex;
    align-items: stretch;
}

.nav-links a {
    display: block;
    color: #cfe2f3; 
    text-decoration: none;
    padding: 0 18px;
    line-height: 70px; 
    font-weight: 600;
    text-transform: uppercase;
    transition: color 0.3s ease;
    
    position: relative; 
    overflow: hidden; 
}

/* Fix de Visibilidad: Texto envuelto en span con z-index alto */
.nav-links a .nav-text {
    position: relative; 
    z-index: 5; 
    display: block;
    transition: inherit; 
    color: inherit; 
}

/* Efecto Hover: Rectángulo deslizable con pseudo-elemento ::before */
.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #cfe2f3; 
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); 
    transition: transform 0.3s ease-out;
    transform: translateY(100%); 
    z-index: 1; 
}

/* ESTILOS DE ESTADO ACTIVO (SECCIÓN SELECCIONADA) */
.nav-links li.active a::before {
    transform: translateY(0); 
}

.nav-links li.active .nav-text {
    color: #073763; 
}

.nav-links li:hover .nav-text {
    color: #073763; 
}

.nav-links li:hover a::before {
    transform: translateY(0);
}

/* --- SECCIÓN SLIDER (INICIO) --- */

.slider-section {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 550px; 
}

.slider-wrapper {
    overflow: hidden;
    height: 100%;
}

.slider-container {
    display: flex;
    width: 500%; 
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide {
    width: 20%; 
    flex-shrink: 0;
    position: relative;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
}

/* Caption (Descripciones del Slider) */
.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(41, 81, 139, 0.6);
    color: #FFFFFF;
    padding: 20px 40px;
    max-height: 35%; 
    box-sizing: border-box; 
}

.slide-caption h1 {
    color: #FFFFFF;
    margin-bottom: 5px;
    font-size: 1.8rem; 
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
    line-height: 1.2;
}

.slide-caption p {
    text-align: justify;
    margin: 0;
    font-size: 1.1rem; 
    line-height: 1.4;
}

/* Controles del Slider (Flechas) */
.prev-btn, .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* AJUSTE: Fondo completamente transparente */
    background: transparent; 
    border: none;
    
    color: white; 
    padding: 10px; 
    aspect-ratio: 1 / 1; 
    cursor: pointer;
    z-index: 50;
    font-size: 1.8rem;
    border-radius: 0; 
    transition: color 0.3s;
}

/* Efecto Hover: solo cambiar el color del icono */
.prev-btn:hover, .next-btn:hover {
    color: #cfe2f3; 
    background: transparent; 
}

.prev-btn { left: 15px; }
.next-btn { right: 15px; }

/* --- SECCIONES DE CONTENIDO --- */

.content-section {
    padding: 60px 20px;
    min-height: 400px;
    max-width: 1200px; 
    margin: 0 auto;
}

.content-section:nth-child(even) {
    /* AJUSTE: Fondo de la sección SOMOS */
    background-color: #FFF; 
}

.content-section h2 {
    color: #0b5394; 
    margin-bottom: 30px;
    text-align: center;
    font-size: 2.2rem; 
    font-weight: 700;
}

.content-section .text-center {
    text-align: center;
    margin-bottom: 20px;
}

/* --- ESTILOS: Sección SOMOS (Aplicando color de texto) --- */
.somos-content h3 {
    /* AJUSTE: Color de texto azul oscuro */
    color: #073763; 
    font-size: 1.6rem;
    margin-top: 20px;
    margin-bottom: 15px;
}

.somos-content p {
    text-align: justify;
    font-size: 1.1rem;
    /* AJUSTE: Color de texto azul oscuro */
    color: #073763;
}

.somos-list-container ul {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.somos-list-container li {
    padding: 5px 0;
    font-size: 1.1rem;
    /* AJUSTE: Color de texto azul oscuro */
    color: #073763;
}

.somos-list-container li i.icon-list {
    display: inline-block;
    width: 25px; 
    text-align: center;
    font-family: inherit; 
    font-style: normal;
    margin-right: 10px;
}

/* --- ESTILOS: Sección SERVICIOS (Tarjetas) */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(22, 59, 111, 0.2); 
}

.icon-box {
    color: #0b5394; 
    font-size: 3rem;
	font-style: normal;
    margin-bottom: 15px;
    width: 60px;
    height: 60px;
    line-height: 60px; 
    margin: 0 auto 15px auto;
}

.service-card h3 {
    color: #163b6f;
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.service-card p {
    color: #555;
    font-size: 1rem;
    line-height: 1.4;
}

/* --- ESTILOS: Fondo de Imagen para la Sección CLIENTES --- */
#clientes {
    background-image: url('../img/bg_clientes.jpg'); 
    background-size: cover; 
    background-position: center; 
    background-attachment: fixed; 
    position: relative; 
    padding-top: 80px;
    padding-bottom: 80px;
    max-width: none; 
    margin: 0;
    color: #163b6f; 
}

#clientes h2,
#clientes p,
.client-slider-container {
    position: relative;
    z-index: 2; 
}

#clientes h2 {
    color: #0b5394; 
}

/* --- ESTILOS: Fondo de Imagen para la Sección Contacto --- */
#contacto {
    background-color: #163b6f; 
    background-image: url('../img/bg_contacto.jpg'); 
    background-size: cover;      
    background-position: center; 
    background-repeat: no-repeat; 
    background-attachment: scroll; 
    position: relative; 
    padding-top: 80px;
    padding-bottom: 80px;
    max-width: none; 
    margin: 0;
}

/* Capa de Overlay */
#contacto::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(22, 59, 111, 0.5); 
    z-index: 1;
}

#contacto h2,
#contacto p,
.contact-form-container {
    position: relative;
    z-index: 2; 
    color: white; 
}

#contacto h2 {
    color: #fff; 
}

/* --- ESTILOS DEL FORMULARIO DE CONTACTO (Con Transparencia) --- */
.contact-form-container {
    max-width: 1200px; 
    width: 100%;
    margin: 40px auto;
    padding: 30px;
    /* Fondo blanco con 85% de opacidad (transparente) */
    background-color: rgba(255, 255, 255, 0.85); 
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    
    border-top: none; 
    border-image-slice: 1; 
    border-width: 5px;
    border-style: solid;
    border-image-source: linear-gradient(to right, 
        #6093cf, 
        rgba(96, 147, 207, 0.07) 
    );
}

/* Cuadrícula de 3 columnas para escritorio */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; 
    gap: 20px;
}

/* Mensaje ocupa las 3 columnas */
.form-message-group {
    grid-column: 1 / -1; 
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #163b6f; 
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #6093cf; 
    outline: none;
    box-shadow: 0 0 5px rgba(96, 147, 207, 0.5);
}

/* Estado de error: borde rojo y sombra si está marcado como inválido */
.form-group input.is-invalid,
.form-group select.is-invalid,
.form-group textarea.is-invalid {
    border-color: #dc3545; 
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}

/* Estilo para mensajes de error debajo del campo */
.error-message {
    color: #dc3545; 
    font-size: 0.85rem;
    margin-top: 4px;
    margin-bottom: 20px; 
    height: 1.2em; 
    font-weight: 500;
}

/* Estilos del botón de envío */
button[type="submit"] {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #163b6f; 
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s;
    font-weight: 700;
    margin-top: 20px; 
}

button[type="submit"]:hover:not(:disabled) {
    background-color: #073763; 
}

button[type="submit"]:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* --- ESTILOS DE NOTIFICACIÓN TOAST (Flotante) --- */
#toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.4s, transform 0.4s;
    transform: translateY(100px); 
}

#toast-notification.success {
    background-color: #28a745; 
}

#toast-notification.error {
    background-color: #dc3545; 
}

#toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- SLIDER DE CLIENTES --- */
.client-slider-container {
    width: 100%;
    overflow: hidden; 
    margin: 40px auto;
    padding: 20px 0;
    white-space: nowrap;
    position: relative;
    min-height: 140px; 
    mask-image: linear-gradient(to right, 
        rgba(0,0,0,0), 
        rgba(0,0,0,1) 10%, 
        rgba(0,0,0,1) 90%, 
        rgba(0,0,0,0)
    );
}

.client-slider-track {
    display: inline-block; 
    animation: slide 30s linear infinite; 
}

.client-slider-track:hover {
    animation-play-state: paused;
}

.client-logo {
    display: inline-block;
    width: 180px; 
    height: 100px;
    margin: 0 30px;
    text-align: center;
    line-height: 100px;
}

.client-logo img {
    max-width: 100%;
    max-height: 100%;
    vertical-align: middle;
    filter: none; 
    opacity: 1; 
    transition: filter 0.3s, opacity 0.3s;
}

.client-logo img:hover {
    opacity: 1; 
    filter: none; 
}

@keyframes slide {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-50%, 0, 0); 
    }
}

/* --- FOOTER --- */

.main-footer {
    background-color: #163b6f; 
    color: #cfe2f3; 
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

/* --- RESPONSIVIDAD (Media Queries) --- */

@media (max-width: 768px) {
    .menu-toggle {
        display: block; 
    }

    .main-nav {
        flex-direction: column; 
        align-items: flex-start;
        height: auto; 
        padding: 10px 20px; 
    }
    
    .logo-container {
        width: 100%;
        justify-content: space-between; 
    }

    .nav-links {
        display: none; 
        flex-direction: column;
        width: 100%; 
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    }

    .nav-links.open {
        display: flex; 
        max-height: 400px; 
        padding-top: 10px;
    }

    .nav-links li {
        width: 100%;
        height: auto;
    }

    .nav-links a {
        padding: 10px 0;
        line-height: 1.4;
        width: 100%;
        text-align: left;
        background-color: rgba(22, 59, 111, 0.95); 
        border-bottom: 1px solid #073763;
    }
    
    .nav-links li:last-child a {
        border-bottom: none;
    }
    
    .nav-links li:hover a::before,
    .nav-links li.active a::before {
        transform: translateY(100%); 
        background-color: transparent;
    }

    .nav-links li:hover a,
    .nav-links li.active a {
        background-color: #073763; 
        color: #fff; 
    }
    
    .nav-links li:hover .nav-text,
    .nav-links li.active .nav-text {
        color: #fff;
    }

    .slider-section {
        height: 400px; 
    }

    .slide-caption {
        padding: 15px 20px;
    }
    .slide-caption h1 {
        font-size: 1.5rem;
    }
    .slide-caption p {
        font-size: 1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .contact-form-container {
        max-width: 100%; 
        padding: 20px 15px; 
        margin-left: auto;
        margin-right: auto;
    }

    .form-grid {
        grid-template-columns: 1fr; 
    }

    #clientes {
        background-attachment: scroll; 
        background-position: center;
    }
    
    .client-logo {
        width: 140px; 
        margin: 0 15px;
    }

    #toast-notification {
        bottom: auto;
        top: 20px;
        right: 50%;
        transform: translateX(50%) translateY(-100px); 
        width: 90%;
        text-align: center;
    }

    #toast-notification.show {
        transform: translateX(50%) translateY(0);
    }
    
}

/* Ajuste de responsividad para que no choque con el Toast en móvil */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px; /* Más cerca del borde inferior */
        right: 20px; /* Más cerca del borde derecho */
        font-size: 24px;
    }
}

/* 9. Botón Flotante de WhatsApp */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 25px; /* Separación del fondo */
    right: 25px; /* Separación de la derecha */
    background-color: #25d366; /* Verde de WhatsApp */
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.3);
    z-index: 1000; /* Asegura que esté por encima de todo */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease-in-out;
	text-decoration: none;
}

.whatsapp-float:hover {
    color: #FFF; /* Mantiene el color blanco al pasar el ratón */
    transform: scale(1.1); /* Efecto de crecimiento al pasar el ratón */
    background-color: #3c94d2; /* Azul al pasar el ratón */
	text-decoration: none;
}

/* Responsivo para dispositivos más pequeños */
@media (max-width: 576px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
        font-size: 25px;
    }
}