:root {
    --primary-dark: #2c3e50;
    --secondary-dark: #34495e;
    --primary-white: #fcfdfd;
    --light-text: #ecf0f1;
    --accent-blue: #3498db;
    --logo-blue: #2980b9;
    --light-background: #f4f4f4;
    --menu-light-bg: #ecf0f1;
    --border-light: #ddd;
    --white: #fff;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.2);
    --lighter-grey: #f0f0f0;
    --lightest-grey: #eee;
    --dark-text: #333;
    --text-color: #333;
    --text-light: #ffffff;
    --faded-background: #f9f9f9;
    --transparency-light: rgba(0, 0, 0, 0.2);
    --tansparency-medium: rgba(0, 0, 0, 0.7);
}

/* Basic Reset and Body Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

    body {
        background-color: var(--light-background);
        min-height: 100vh;
        line-height: 1.6;
    }


    .container {
        max-width: 1600px;
        margin: 0 auto;
        padding: 0 20px;
    }

    .top-bar {
        background-color: var(--primary-white);
        color: var(--dark-text);
        padding: 10px 0;    
        font-size: 0.9em;
    }

   .top-bar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
    }

    /* Right */
    .top-bar .mail-info a {
        text-decoration: none;
        color: var(--dark-text);
        border-radius: 5px;
        transition: color 0.3s ease;
    }

    .top-bar .mail-info a:hover {
        color: var(--accent-blue);;
    }

    /* Center */
    .top-bar .tele-info a {
        text-decoration: none;
        border-radius: 5px;
        color: var(--dark-text);
        transition: color 0.3s ease;
    }

    .top-bar .tele-info a:hover {
        color: var(--accent-blue);
    }

    /* Left */
    .top-bar .social-icons a {
        text-decoration: none;
        color: var(--dark-text);
        border-radius: 5px;
        margin-left: 20px;
        transition: color 0.3s ease;
    }

    .top-bar .social-icons a:hover {
        color: var(--accent-blue);
    }

        /* --- Main Bar Styling --- */
    .main-bar {
        background-color: rgba(252, 253, 253, 0.8); /* Blanco semi-transparente */
        padding: 15px 0;
        box-shadow: 0 2px 5px var(--shadow-medium);
        position: relative; /* Asegura que z-index funcione */
        z-index: 10; /* Lo coloca por encima del slider */
    }

    .main-bar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    
    .main-bar .logo {
        height: 100px;
        display: flex;
        align-items: center;
    }

    .main-bar .logo img {
        height: 100%;
    }

     .button-toggle {
        display: none;
        background: none;
        border: none;
        color: var(--dark-text); /* Changed to a visible color against white background */
        font-size: 24px;
        cursor: pointer;
    }

    .main-menu {
        transition: all 0.3s ease;
    }
    .main-menu ul {
        list-style: none;
        display: flex;
        gap: 30px;
    }

    .main-menu ul li {
        position: relative;
    }

    .main-menu  ul li a {
        color: var(--dark-text);
        text-decoration: none;
        font-weight: bold;
        display: block;
        padding: 10px 15px;
        border-radius: 5px;
        transition: color 0.3s ease;
    }

        .main-menu  ul a:hover {
        color: var(--accent-blue);
        background-color: rgba(40, 183, 219, 0.39); /* Intensidad transparencia efecto hover */
    }

    /* --- SecondaryMenu Bar Styling --- */
    .secondary-bar {
        background-color: rgba(236, 240, 241, 0.8); /* Fondo claro semi-transparente */
        border-bottom: 1px solid var(--border-light);
        padding: 12px 0;
        box-shadow: 0 2px 5px var(--shadow-light);
        position: relative; /* Asegura que z-index funcione */
        z-index: 10; /* Lo coloca por encima del slider */
    }
    .secondary-menu ul {
        list-style: none;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }

    .secondary-menu ul li {
        position:relative;
        margin: 0 30px;
        min-height: 40px;
        white-space: nowrap;
    }

    .secondary-menu ul li a {
        color: var(--dark-text);
        text-decoration: none;
        font-weight: bold;
        display: block;
        padding: 10px 0;
        display: block;
        border-radius: 5px;
        transition: color 0.3s ease;
    }

    .secondary-menu ul li a:hover {
        color: var(--logo-blue);
    }
    
/* Dropdown Submenu Styling */
.secondary-menu ul ul {
    display: none;
    position: absolute; /* Es absolute porque va dentro de un contenedor con posicion relative, se fija dentro del contenedor */
    background-color: var(--white);
    box-shadow: 0 8px 16px var(--shadow-heavy);
    min-width: 180px;
    z-index: 100;
    left: 0;
    top: 100%;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
}

.secondary-menu ul li:hover > ul,
.secondary-menu ul li.active > ul {
    display: flex;
}

.secondary-menu ul ul li{
    margin: 0;
    width: 100%;
} 

.secondary-menu ul ul li a {
    padding: 12px 20px;
    color: var(--dark-text);
    white-space: nowrap;
    border-bottom: 1px solid var(--lightest-grey);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.secondary-menu ul ul li:last-child a {
    border-bottom: none;
}

.secondary-menu ul ul li a:hover {
    background-color: var(--lighter-grey);
    color: var(--logo-blue);
}

/* Rotación de la flecha del dropdown */
.secondary-menu ul li.dropdown > a .fa-chevron-down {
    transition: transform 0.3s ease;
}

.secondary-menu ul li.dropdown.active > a .fa-chevron-down {
    transform: rotate(180deg);
}



/* Estilos para el Slider de Pantalla Completa */
.fullscreen-slider {
    position: relative; /* Fija el slider en el viewport */ /*position: fixed; se cambia a position: relative; cpn el objetivo de generar hacia abajo nuevas secciones*/
    top: 0;
    left: 0;
    width: 100vw; /* Ancho de la ventana */
    height: 100vh; /* Alto de la ventana */
    overflow: hidden;
    z-index: -1; /* Lo coloca detrás de todo el contenido */
}


.fullscreen-slider .slide {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0; /* Inicia oculto */
    transition: opacity 1s ease-in-out; /* Transición suave de fundido */
    display: flex; /* Para centrar el contenido */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.fullscreen-slider .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cubre toda el área del slide */
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1; /* Mantiene la imagen detrás del texto */
}

.fullscreen-slider .slide-content {
    position: relative;
    z-index: 1; /* Asegura que el texto esté por encima de la imagen */
    color: var(--primary-white); /* Texto blanco para contraste */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* Sombra para mejorar la legibilidad */
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.4); /* Fondo semi-transparente para el texto */
    border-radius: 8px;
    max-width: 80%; /* Limita el ancho del texto */
}

.fullscreen-slider .slide-content h3 {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.fullscreen-slider .slide-content p {
    font-size: 1.2em;
    margin-bottom: 5px;
}

/* Animación para el slider */
@keyframes slide-animation {
    0% { opacity: 1; } /* Primer slide visible */
    16% { opacity: 1; } /* Permanece visible por un tiempo */
    20% { opacity: 0; } /* Se desvanece */
    100% { opacity: 0; } /* Permanece oculto hasta el siguiente ciclo */
}

/* Aplicación de la animación a cada slide con un retraso */
/* Duración total de la animación: 5 slides * 5 segundos/slide = 25 segundos */
.fullscreen-slider .slide:nth-child(1) { animation: slide-animation 25s infinite; }
.fullscreen-slider .slide:nth-child(2) { animation: slide-animation 25s infinite; animation-delay: 5s; }
.fullscreen-slider .slide:nth-child(3) { animation: slide-animation 25s infinite; animation-delay: 10s; }
.fullscreen-slider .slide:nth-child(4) { animation: slide-animation 25s infinite; animation-delay: 15s; }
.fullscreen-slider .slide:nth-child(5) { animation: slide-animation 25s infinite; animation-delay: 20s; }


/* --- SECCIONES --- */
.section, .section-highlight {
    padding: 4rem 0;
}
.section-highlight {
    background-color: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}
.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.section-header p {
    font-size: 1.125rem;
    color: var(--text-medium);
    max-width: 48rem;
    margin: 0 auto;
}

/* --- CLASES DE UTILIDAD --- */
.hidden { display: none; }
.text-center { text-align: center; }
.section-footer { margin-top: 3rem; }

/* --- SISTEMA DE GRID --- */
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(1, 1fr); }

/* --- CARDS --- */
.card {
    background-color: var(--bg-white);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease;
    overflow: hidden; /* Para que la imagen respete el borde redondeado */
}
.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.card-icon {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.card-icon img {
    margin-bottom: 1rem;
    border-radius: 50%;
}

.card-icon h3, .card-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827; /* gray-900 */
    margin-bottom: 0.5rem;
}
.card-icon p, .card-body p {
    color: var(--text-medium);
    margin-bottom: 1rem;
}

.learn-more {
    color: var(--color-primary);
    font-weight: 500;
}
.learn-more:hover {
    text-decoration: underline;
}

.card-img {
    width: 100%;
    height: 16rem;
    object-fit: cover;
}
.card-body {
    padding: 1.5rem;
}
.card-body-sm {
    padding: 1rem;
}
.card-body-sm h3 { font-size: 1.125rem; margin-bottom: 0.25rem; }
.card-body-sm p { font-size: 0.875rem; }


/* --- SECCIÓN ENERGÍA SOLAR (FEATURE LAYOUTS) --- */
.sub-section {
    padding: 2rem 0;
    border-top: 1px solid var(--color-secondary);
}
.sub-section:first-of-type {
    margin-top: 4rem;
}
.sub-section h3 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.feature-layout, .feature-layout-reverse {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}
.feature-image img {
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.feature-content p {
    font-size: 1.125rem;
    color: var(--text-medium);
    margin-bottom: 1rem;
}
.feature-content ul {
    list-style: disc;
    list-style-position: inside;
    color: var(--text-medium);
    margin-bottom: 1.5rem;
}
.feature-content ul li {
    margin-bottom: 0.5rem;
}

/* --- SECCIÓN NOSOTROS --- */
.about-us-grid .card {
    padding: 1.5rem;
}
.about-us-grid h3 {
    color: var(--color-primary-hover);
    margin-bottom: 0.5rem;
}
.values-list {
    text-align: left;
    list-style: disc;
    list-style-position: inside;
}


/* --- SECCIÓN CONTACTO --- */
.contact-section {
    padding: 4rem 0;
    background-color: var(--color-primary-hover);
    color: var(--text-light);
}
.contact-section h2 {
    margin-bottom: 1.5rem;
}
.contact-section > .container > p {
    margin-bottom: 2rem;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}
.contact-layout {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}
.contact-form-wrapper {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    color: var(--text-dark);
}
.contact-form-wrapper h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.contact-form label {
    display: block;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 0.25rem;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.375rem;
    font-size: 1rem;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.contact-form button {
    width: 100%;
}
.contact-info {
    text-align: center;
}
.contact-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.contact-info p {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}
.contact-info a {
    text-decoration: underline;
}
.social-media {
    margin-top: 2rem;
}
.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.social-icons img {
    border-radius: 50%;
}


/* --- FOOTER --- */
#main-footer {
    background-color: #1F2937; /* gray-800 */
    color: var(--text-light);
    padding: 2.5rem 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
}
.footer-col h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-col ul li {
    list-style: none;
}

.footer-col ul li a {
    color: var(--text-light);
    transition: color 0.2s;
    text-decoration: none
}

.footer-col a, .footer-col p {
    color: #9CA3AF; /* gray-400 */
    transition: color 0.2s;
}
.footer-col a:hover {
    color: var(--text-light);
}
.footer-col .logo {
    justify-content: center;
    margin-bottom: 1rem;
}
.footer-col .logo img { border-radius: 50%; }
.footer-col .logo span { font-size: 1.25rem; font-weight: 700; }
.footer-bottom {
    border-top: 1px solid #374151; /* gray-700 */
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #9CA3AF; /* gray-400 */
}

/* Small devices (tablets, 640px and up) */
@media (min-width: 640px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .hero-buttons { flex-direction: row; }
}

@media (max-width: 768px) {

    .main-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--secondary-dark); /* Changed from rgba(0,0,0,0.8) for better contrast */
        flex-direction: column;
        padding: 20px;
        gap: 10px; /* Espacio entre los ítems del menú */
        z-index: 99; /* Asegura que esté por encima de otros elementos */
        box-shadow: 0 5px 10px rgba(0,0,0,0.3); /* Sombra para destacarlo */
    }
            
    .main-menu.active {
        display: flex;
    }
    
    .main-menu ul {
        flex-direction: column; /* Stacks menu items vertically on small screens */
        width: 100%;
    }

    .main-menu ul li a {
        color: var(--primary-white); /* Ensures text is visible on dark background */
        padding: 12px 15px; /* Más relleno para facilitar el toque */
        width: 100%; /* Makes links take full width */
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1); /* Separador sutil */
    }

    .main-menu ul li:last-child a {
        border-bottom: none; /* Eliminar el borde inferior del último elemento */
    }

    .main-bar .container .button-toggle { /* Corrected class name */
        display: block;
        color: var(--dark-text); /* Asegura que el botón sea visible */
    }

    .top-bar .mail-info {
        display: none;
    }
    
    .secondary-menu ul {
        flex-direction: column; /* Stacks secondary menu items vertically */
        align-items: center; /* Centers secondary menu items */
    }

    .secondary-menu ul li {
        margin: 10px 0; /* Adds spacing between stacked secondary menu items */
        width: 90%; /* Adjust width for better appearance on small screens */
        text-align: center;
    }

    .secondary-menu ul ul {
        position: static; /* Allows submenu to flow naturally in document */
        box-shadow: none; /* Removes shadow for stacked dropdown */
        background-color: var(--lighter-grey); /* Fondo ligeramente diferente para submenú */
        border-radius: 0;
        padding: 5px 0;
        width: 100%; /* Asegura que el submenú ocupe el ancho de su padre */
    }

    .secondary-menu ul ul li a {
        padding: 10px 30px; /* Adjust padding for stacked submenu items */
        text-align: center;
        border-bottom: 1px solid var(--lightest-grey);
    }
    .secondary-menu ul ul li:last-child a {
        border-bottom: none;
    }
}

/* Medium devices (desktops, 768px and up) */
@media (min-width: 768px) {
    .menu-toggle { display: none; }
    #main-header .main-nav { display: flex; gap: 1.5rem; }
    #main-header .header-contact { display: flex; align-items: center; gap: 1rem; }

    .hero h1 { font-size: 3.75rem; }
    .hero p { font-size: 1.5rem; }

    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }

    .card-img { height: 16rem; }
    
    .feature-layout { flex-direction: row; text-align: left; }
    .feature-layout-reverse { flex-direction: row-reverse; text-align: left; }
    .feature-content, .feature-image { flex: 1; }

    .contact-layout { flex-direction: row; gap: 3rem; }
    .contact-info { text-align: left; }
    .social-icons { justify-content: flex-start; }

    .footer-grid { grid-template-columns: repeat(3, 1fr); text-align: left; }
    .footer-col .logo { justify-content: flex-start; }
}
/* Large devices (large desktops, 1024px and up) */
@media (min-width: 1024px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
} 
