/* Variables de color */
:root {
    --primary-color: #01725a;
    --secondary-color: #f8f8f8;
    --accent-color: #68c729;
    --white-color: #ffffff;
    --dark-text-color: #333333;
    --light-text-color: rgb(255, 255, 255);

    /* Fuentes */
    --heading-font: 'Poppins', sans-serif;
    --body-font: 'Poppins', sans-serif;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    color: var(--dark-text-color);
    background-color: var(--white-color);
    scroll-behavior: smooth;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    color: var(--dark-text-color);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Botones */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 0.9rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 1.5rem;
    letter-spacing: 0.5px;
    font-family: 'Poppins';
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* --- Sección Hero (Inicio) - AHORA CON SLIDER DE CONTENIDO --- */
.hero {
    height: 120vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem; 
    position: relative;
    overflow: hidden;
    background-color: var(--primary-color);

    /* Animación de líneas de fondo */
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.05) 0px,
        rgba(255, 255, 255, 0.05) 2px,
        transparent 2px,
        transparent 30px
    ),
    repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.05) 0px,
        rgba(255, 255, 255, 0.05) 2px,
        transparent 2px,
        transparent 30px
    );
    background-size: 60px 60px;
    animation: moveLines 1s linear infinite;
}

/* Definición de la animación de movimiento de líneas */
@keyframes moveLines {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 60px 60px;
    }
}

/* El overlay debe estar por encima de las líneas, pero por debajo del contenido del slider */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

/* Contenedor del slider */
.hero-content-slider {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    padding: 0 2rem;
}

.hero h1 {
    font-size: 4.2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--light-text-color);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    line-height: 1.2;
}

.hero p {
    font-size: 1.6rem;
    margin-top: 0.5rem;
    font-weight: 300;
    color: var(--light-text-color);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;

}

.hero-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 900px; 
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
    
    /* CENTRADO DE LA IMAGEN DENTRO DEL SLIDE */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

/* Estilos para el texto dentro de las diapositivas */
.hero-slide .hero-title {
    font-size: 4.2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--light-text-color);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    line-height: 1.2;
}


.hero-slide .hero-description {
    font-size: 1.6rem;
    margin-top: 0.5rem;
    font-weight: 300;
    color: var(--light-text-color);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Y para la imagen en sí: */
.hero-image {
    max-width: 150vh;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Estilos para pantallas grandes*/
@media (min-width: 1200px) {
    .hero {
        height: 100vh;
        padding: 5rem 3rem;
    }
    .hero-content-slider {
        max-width: 1500px;
    }
    .hero-slide .hero-title {
        font-size: 5rem;
    }
    .hero-slide .hero-description {
        font-size: 2rem;
    }
    .hero-image {
        max-height: 75vh;
    }
}

/* Estilos para pantallas medianas-grandes */
@media (min-width: 993px) and (max-width: 1199px) {
    .hero {
        height: 90vh;
        padding: 4.5rem 2.5rem;
    }
    .hero-content-slider {
        max-width: 1200px;
    }
    .hero-slide .hero-title {
        font-size: 4rem;
    }
    .hero-slide .hero-description {
        font-size: 1.7rem;
    }
    .hero-image {
        max-height: 65vh;
    }
}


/* Estilos para tablets y pantallas medianas */
@media (min-width: 768px) and (max-width: 992px) {
    .hero {
        height: 85vh;
        min-height: 70vh;
        padding: 4rem 2rem;
    }
    .hero-content-slider {
        padding: 0 1.5rem;
    }
    .hero-slide .hero-title {
        font-size: 3.2rem;
    }
    .hero-slide .hero-description {
        font-size: 1.3rem;
    }
    .hero-image {
        max-height: 55vh;
    }
}

/* Estilos para móviles grandes */
@media (min-width: 481px) and (max-width: 767px) {
    .hero {
        height: auto;
        min-height: 60vh;
        padding: 3rem 1.5rem;
    }
    .hero-content-slider {
        padding: 0 1rem;
    }
    .hero-slide .hero-title {
        font-size: 2.8rem;
    }
    .hero-slide .hero-description {
        font-size: 1.1rem;
    }
    .hero-image {
        max-height: 45vh;
    }
}

/* Estilos para móviles pequeños */
@media (max-width: 480px) {
    .hero {
        height: auto;
        min-height: 50vh;
        padding: 2.5rem 1rem;
    }
    .hero-content-slider {
        padding: 0 0.5rem;
    }
    .hero-slide .hero-title {
        font-size: 2.2rem;
    }
    .hero-slide .hero-description {
        font-size: 0.95rem;
    }
    .hero-image {
        max-height: 35vh;
    }
}

/* Secciones Generales */
.section {
    padding: 5rem 0;
    text-align: center;
}

.section h2 {
    font-size: 2.8rem;
    margin-bottom: 2.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.section h2::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.about-us {
    background-color: var(--secondary-color);
}

.about-us p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--dark-text-color);
}

/* Sección de Prestaciones - Diseño de lista 3x3 */
.services {
    background-color: var(--white-color);
}

.service-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
    padding: 0 1rem;
}

.service-item {
    background-color: var(--white-color);
    color: var(--dark-text-color);
    padding: 2.5rem;
    border-radius: 8px;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    background-color: rgba(1, 114, 90, 0.05);
}

.service-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    transition: color 0.3s ease, transform 0.2s ease;
}

.service-item:hover .service-icon {
    color: var(--accent-color);
    transform: scale(1.1);
}

.service-item h3 {
    color: var(--dark-text-color);
    margin-bottom: 0.8rem;
    font-size: 1.6rem;
}

.service-item p {
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
}

/* Colaboradores - Animación de Carrusel */
.partners {
    background-color: var(--white-color);
    padding-bottom: 5rem; 
}

.partners p {
    font-size: 1.1rem;
    color: var(--dark-text-color);
    margin-bottom: 3rem;
}

.logo-carousel {
    display: flex;
    overflow: hidden;
    mask-image: linear-gradient(
        to right,
        transparent,
        black 10%,
        black 90%,
        transparent
    ); /* Efecto desvanecido en los bordes */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent,
        black 10%,
        black 90%,
        transparent
    ); /* Compatibilidad con navegadores basados en WebKit */
}

.logo-track {
    display: flex;
    white-space: nowrap; /* Evita que los logos salten a la siguiente línea */
    will-change: transform; /* Optimización de rendimiento para animaciones */
    animation: scrollLogos 30s linear infinite;
}

/* Pausar animación al pasar el ratón */
.logo-carousel:hover .logo-track {
    animation-play-state: paused;
}

.logo-track img {
    height: 90px;
    width: auto;
    margin: 0 2rem;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: filter 0.3s ease, opacity 0.3s ease;
    flex-shrink: 0; /* Evita que las imágenes se encojan */
}

.logo-track img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* Definición de la animación de scroll */
@keyframes scrollLogos {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Responsividad */
@media (max-width: 1200px) {
    .service-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }
}

/* Media query para pantallas más grandes */
@media (min-width: 993px) {
    .hero {
        height: 110vh; 
    }
    .hero h1 {
        font-size: 4.5rem;
    }

    .hero p {
        font-size: 1.8rem;
    }
}

@media (max-width: 992px) {
    /* Estilos del menú hamburguesa lateral derecho */
    .nav-links {
        position: fixed;
        top: 0;
        right: -250px;
        width: 250px;
        height: 100vh;
        background-color: var(--primary-color);
        box-shadow: -4px 0 15px rgba(0,0,0,0.2);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 6rem 1.5rem 2rem;
        transition: right 0.4s ease-in-out;
        z-index: 999;
        display: flex;
    }

    .nav-links.active {
        right: 0;
    }

    /* Oculta la barra de scroll cuando el menú está abierto */
    body.no-scroll {
        overflow: hidden;
    }

    .nav-links li {
        width: 100%;
        margin-bottom: 1rem;
    }

    .nav-links a {
        color: var(--light-text-color);
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
        display: block;
        text-align: left;
        text-decoration: none;
        transition: color 0.3s ease;
    }

    .nav-links a:hover {
        color: var(--white-color);
        border-bottom: 2px solid var(--white-color);
    }
    
    .hamburger {
        display: block;
        position: relative;
        z-index: 1001;
    }

    .hero {
        height: auto;
        min-height: 80vh;
        padding-top: 80px;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .section {
        padding: 4rem 0;
    }
    .section h2 {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }
    .about-us p, .contact p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .service-list {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .contact form {
        padding: 2rem 1.5rem;
    }

    /* Ajustes para las imágenes de colaboradores en pantallas pequeñas */
    .logo-track img {
        height: 70px;
        margin: 0 1rem;
    }

    .footer .container {
        flex-direction: column;
        gap: 0.8rem;
    }
    .social-icons {
        margin-top: 0.8rem;
    }
}

@media (max-width: 600px) {
    .service-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo img {
        max-height: 35px;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .btn {
        padding: 0.8rem 1.6rem;
        font-size: 0.9rem;
    }
    .section h2 {
        font-size: 1.8rem;
    }
    .service-item h3 {
        font-size: 1.4rem;
    }
    .service-item p {
        font-size: 0.85rem;
    }
    .contact input,
    .contact textarea,
    .contact button {
        padding: 0.9rem;
        font-size: 0.9rem;
    }

    .nav-links {
        width: 200px;
        right: -200px;
    }
}

.itemslider {
    display: flex;
    overflow: hidden;
    width: 100%;
    gap: 3em;

    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE/Edge antiguo */
}

.itemslider::-webkit-scrollbar {
    display: none;                /* Chrome / Safari */
}
.grupo {
    display: flex;
    align-items: center;
    gap: 3em;
    animation: rotar 25s linear infinite;
}

/* Pausar animación al hacer hover */
.itemslider:hover .grupo {
    animation-play-state: paused;
}
.itemslider .card {
    flex: 0 0 auto;               
    height: 80px;                 
    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: none;
    padding: 5px;
}

.itemslider .card img {
    height: 100%;
    width: auto;
    max-width: none;

    object-fit: contain;
    display: block;

    filter: grayscale(100%);
    transition: filter 0.3s ease-in-out;
}

/* Quitar grayscale al logo bajo el cursor */
.itemslider .card:hover img {
    filter: grayscale(0%);
}

@keyframes rotar {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(-100% - 3em));
    }
}


/* ====================== NUESTROS SERVICIOS ====================== */
.servicios {
    padding: 6rem 2rem;
    text-align: center;
    background-color: var(--primary-color); /* Fondo base verde para las líneas */
    position: relative;
    overflow: hidden;
    
    /* Fondo de líneas */
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.05) 0px,
        rgba(255, 255, 255, 0.05) 2px,
        transparent 2px,
        transparent 30px
    ),
    repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.05) 0px,
        rgba(255, 255, 255, 0.05) 2px,
        transparent 2px,
        transparent 30px
    );
    background-size: 60px 60px;
    animation: moveLines 7s linear infinite;
}

/* Overlay */
.servicios::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

/* Forzamos que el contenido esté por encima del fondo */
.servicios .container {
    position: relative;
    z-index: 1;
}

.servicios h2 {
    font-size: clamp(2.6rem, 6vw, 4rem);
    margin-bottom: 1rem;
    color: var(--light-text-color);
    font-weight: 800;
}

.servicios p {
    max-width: 720px;
    margin: 0 auto 4rem;
    font-size: 1.15rem;
    color: var(--accent-color);
    line-height: 1.6;
}

.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* --- Tarjeta normal --- */
.servicio-card {
    display: block;
    position: relative; /* Para el badge */
    text-decoration: none;
    color: var(--dark-text-color);
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    height: 100%;
}

.servicio-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 50px rgba(1, 114, 90, 0.25);
}

.servicio-img {
    height: 220px;
    overflow: hidden;
}

.servicio-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.servicio-card:hover .servicio-img img {
    transform: scale(1.12);
}

.servicio-card h3 {
    font-size: 1.65rem;
    margin: 1.5rem 1.2rem 0.8rem;
    color: var(--primary-color);
    font-weight: 700;
}

.servicio-card p {
    padding: 0 1.5rem 2rem;
    font-size: 1rem;
    line-height: 1.55;
    color: #555;
}

/* --- TARJETA DESTACADA - BOLETINES --- */
.servicio-card.destacado {
    grid-column: span 2;
    background: linear-gradient(135deg, #01725a, #20A100);
    color: white;
    box-shadow: 0 15px 40px rgba(1, 114, 90, 0.4);
}

.servicio-card.destacado:hover {
    transform: translateY(-18px);
    box-shadow: 0 30px 60px rgba(1, 114, 90, 0.5);
}

.servicio-card.destacado h3 {
    color: white;
}

.servicio-card.destacado p {
    color: rgba(255,255,255,0.95);
}

/* Badge "Destacado" */
.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ffcc00;
    color: #01725a;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 2;
}

/* Responsive */
@media (max-width: 1200px) {
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .servicio-card.destacado {
        grid-column: span 2;
    }
}

@media (max-width: 650px) {
    .servicios-grid {
        grid-template-columns: 1fr;
    }
    .servicio-card.destacado {
        grid-column: span 1;
    }
}