@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Montserrat:wght@700&family=Aptos:wght@400;700&display=swap');

:root {
    --primary-color: #2196f3;
    --primary-dark: #1976D2;
    --dark-blue: #0A2A43;
    --white: #FFFFFF;
    --light-gray: #F8F9FA;
    --text-color: #333;
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Lato', sans-serif;

    /* Variables configurables */
    --overlay-hero: rgba(10, 42, 67, 0.7);
    --overlay-services: rgba(248, 249, 250, 0.9);
    --overlay-plant-solutions: rgba(255, 255, 255, 0.8);
    --overlay-projects: rgba(255, 255, 255, 0.4);
    --overlay-about: rgba(248, 249, 250, 0.9);
}

/* Reset y Estilos Generales */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-secondary);
    color: var(--text-color);
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 20px;
}

h2 {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--dark-blue);
}

/* Barra de Navegación */
.navbar {
    background-color: var(--white);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease, transform 0.4s ease;
    will-change: background-color, box-shadow, backdrop-filter, transform;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    transform: translate3d(0, -100%, 0);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Arial Black', sans-serif;
    font-style: italic;
    font-size: 2.9rem;
    color: #1a1a7e;
    text-decoration: none;
    transition: color 0.3s;
    padding: 0;
    margin: 0;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--dark-blue);
    text-decoration: none;
    font-size: 1rem;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: var(--primary-color);
    color: var(--white) !important; 
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--dark-blue);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

/* Sección de Héroe */
.hero {
    position: relative;
    color: var(--white);
    text-align: center;
    padding-top: 180px;
    padding-bottom: 120px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(var(--overlay-hero), var(--overlay-hero));
    z-index: 1;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 0;
    will-change: opacity;
}

.background-image.active {
    opacity: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-family: var(--font-primary);
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero h1 span {
    transition: transform 0.3s ease;
    display: inline-block;
    will-change: transform;
}

.hero h1 span:hover {
    transform: scale3d(1.2, 1.2, 1);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    will-change: background-color, transform;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translate3d(0, -2px, 0);
}

/* Secciones Generales */
main {
    padding-top: 0;
}

.hero, .services, .plant-solutions, .projects, .about, .contact {
}

.services {
    padding: 80px 0;
    height: 100vh;
}

.plant-solutions {
    background: linear-gradient(var(--overlay-plant-solutions), var(--overlay-plant-solutions)), url('../Images/background_5.jpg') center/cover fixed no-repeat;
    color: var(--dark-blue);
    padding: 80px 0;
    height: 100vh;
}

.plant-solutions .intro-text {
    color: var(--white);
}

.plant-solutions .solution-card {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--dark-blue);
}

.plant-solutions .solution-card h3,
.plant-solutions .solution-card p {
    color: var(--dark-blue);
}

.projects {
    background: linear-gradient(var(--overlay-projects), var(--overlay-projects)), url('../Images/background_6.jpg') center/cover fixed no-repeat;
    color: var(--dark-blue);
    padding: 80px 0;
    height: 100vh;
}

.projects .project-card {
    background-color: rgba(255, 255, 255, 0.9);
}

.projects .project-content h3,
.projects .project-content p {
    color: var(--dark-blue);
}

.about, .contact {
    padding: 80px 0;
    height: 100vh;
}

.services {
    background: linear-gradient(var(--overlay-services), var(--overlay-services)), url('../Images/background_4.jpg') center/cover fixed no-repeat;
}

.about {
    background: linear-gradient(var(--overlay-about), var(--overlay-about));
}

/* Sección de Servicios */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 30px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    will-change: transform, box-shadow;
}

.service-card:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark-blue);
}

/* Sección de Soluciones */
.plant-solutions .intro-text {
    text-align: center;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.solution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.solution-card {
    background-color: var(--dark-blue);
    color: var(--white);
    padding: 30px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    will-change: transform, box-shadow;
}

.solution-card:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.solution-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.solution-card h3 {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--white);
}

/* Sección de Proyectos */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    will-change: transform, box-shadow;
}

.project-card:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.project-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover img {
    transform: scale(1.05);
}

.project-content {
    padding: 25px;
}

.project-content h3 {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--dark-blue);
}

.project-content p {
    margin-bottom: 20px;
}

.project-content .btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.project-card:hover .project-content .btn {
    opacity: 1;
    transform: translateY(0);
}

/* Sección Acerca de */
.about p {
    max-width: 800px;
    margin-inline: auto;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Sección Contacto */
.contact h2 {
    text-align: left;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    align-items: flex-start;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form input, 
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-family: var(--font-secondary);
    font-size: 1rem;
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-form button {
    width: 100%;
}

.contact-info h3 {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: var(--dark-blue);
    margin-bottom: 20px;
}

.contact-info p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.contact-info i {
    color: var(--primary-color);
    margin-right: 15px;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.contact-info .social-links a {
    color: var(--dark-blue);
    margin-right: 15px;
    font-size: 1.8rem;
    transition: color 0.3s;
}

.contact-info .social-links a:hover {
    color: var(--primary-color);
}

/* Pie de Página */
.footer {
    background-color: var(--dark-blue);
    color: var(--white);
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

.footer .association-logos {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.footer .association-logos img {
    max-height: 50px; 
    width: auto;
    filter: grayscale(100%) brightness(200%); /* Para que los logos se vean blancos en el footer oscuro */
    opacity: 0.8;
    transition: opacity 0.3s, filter 0.3s;
}

.footer .association-logos img:hover {
    opacity: 1;
    filter: grayscale(0%) brightness(100%); /* Color original en hover */
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: rgba(255, 255, 255, 0.9) url('Images/pattern-2.jpg') center/cover no-repeat;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #888;
    width: 90%;
    max-width: 1100px;
    border-radius: 10px;
    font-family: 'Aptos', sans-serif;
    font-size: 20px;
    text-align: left;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    text-align: justify;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

.modal-inner {
    position: relative;
    height: 600px;
    padding: 20px;
    box-sizing: border-box;
}

.modal-inner.left .modal-logo {
    left: 0;
}

.modal-inner.right .modal-logo {
    right: 0;
}

.modal-inner.left .modal-text {
    right: 0;
}

.modal-inner.right .modal-text {
    left: 0;
}

.modal-logo {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    object-fit: cover;
    border-radius: 10px;
    animation: zoomIn 1s ease;
    will-change: transform, opacity;
}

@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale3d(0, 0, 0);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

.modal-text {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 1;
}

/* Botón WhatsApp */
.whatsapp-btn {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #25d366;
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, transform 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    will-change: background-color, transform;
}

.whatsapp-btn:hover {
    background-color: #128c7e;
    transform: scale3d(1.1, 1.1, 1);
}

/* Botón Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    will-change: opacity, visibility, transform;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background-color: var(--primary-dark);
    transform: translate3d(0, -2px, 0);
}

/* Indicador de secciones */
#section-indicator {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

#section-indicator span {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

#section-indicator span.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

#section-indicator span:hover {
    background-color: var(--primary-color);
}

/* Media Queries para Responsividad */
@media (max-width: 992px) {
    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        position: absolute;
        top: 65px; /* Ajuste para el nuevo padding del navbar */
        left: 0;
        width: 100%;
        padding: 20px 0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .hero {
        min-height: 100vh;
        height: auto;
        padding-top: 100px;
        padding-bottom: 80px;
    }

    .hero h1 {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }

    .btn-primary {
        padding: 12px 25px;
        font-size: 1rem;
    }

    main {
        padding-top: 0;
    }

    .services,
    .plant-solutions,
    .projects,
    .about,
    .contact {
        min-height: 100vh;
        height: auto;
    }

    .services {
        padding: 60px 0;
    }

    h2 {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .service-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-card {
        padding: 20px;
    }

    .service-card i {
        font-size: 2.5rem;
    }

    .service-card h3 {
        font-size: 1.3rem;
    }

    .solution-grid,
    .project-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .solution-card,
    .project-card {
        padding: 20px;
    }

    .solution-card i {
        font-size: 2rem;
    }

    .solution-card h3 {
        font-size: 1.2rem;
    }

    .project-content h3 {
        font-size: 1.2rem;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .contact-info p {
        font-size: 1rem;
    }

    .modal-content {
        width: 95%;
        height: auto;
        max-height: 80vh;
    }

    .modal-inner {
        height: auto;
        padding: 15px;
    }

    .modal-logo {
        width: 100%;
        height: 200px;
        position: relative;
        margin-bottom: 15px;
    }

    .modal-text {
        width: 100%;
        position: relative;
    }

    .background-image {
        background-attachment: scroll;
    }

    #section-indicator {
        display: none;
    }

    .whatsapp-btn,
    .scroll-to-top {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .footer .association-logos img {
        max-height: 35px;
    }
}
