/* --- ESTILOS GENERALES Y VARIABLES --- */
:root {
    --primary-color: #D40000; /* Rojo extraído del logo */
    --secondary-color: #4A148C; /* Morado oscuro para contraste */
    --dark-color: #121212;      /* Negro/Gris oscuro para fondos y texto */
    --light-color: #FFFFFF;     /* Blanco */
    --text-color: #333;
    --header-bg: rgba(18, 18, 18, 0.85); /* Fondo del header casi negro */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

/* --- CINTILLO SUPERIOR / HEADER (MODIFICADO) --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 5%;
    background: var(--light-color); /* Fondo blanco */
    z-index: 1000;
    transition: background 0.3s ease;
    border-bottom: 1px solid #e0e0e0; /* Línea divisora sutil */
}

.logo a {
    display: inline-block;
}
.logo img {
    height: 60px; /* Ajusta la altura de tu logo */
    width: auto;
    transition: transform 0.3s ease;
}
.logo img:hover {
    transform: scale(1.05);
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li {
    margin-left: 2rem;
}

.main-nav ul li a {
    text-decoration: none;
    color: var(--dark-color); /* Texto del menú oscuro */
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.main-nav ul li a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.whatsapp-button {
    color: #25D366;
    font-size: 2.2rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    color: #4ADE80;
}


/* --- BANNER PANTALLA COMPLETA (Página de Inicio) --- */
.fullscreen-banner {
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: var(--dark-color);
}

.slider {
    width: 100%;
    height: 100%;
}

/* --- REGLAS DEL SLIDER (CORREGIDAS) --- */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slide.active {
    opacity: 1;
    animation: kenburns 20s infinite;
}


@keyframes kenburns {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}


/* --- CONTENIDO DE PÁGINAS INTERNAS --- */
.page-content {
    padding-top: 120px;
    width: 90%;
    max-width: 1200px;
    margin: 2rem auto;
}

.content-wrapper {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: flex-start;
}

.image-frame {
    flex: 1;
    min-width: 300px;
}

.image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.text-content {
    flex: 2;
}

.text-content h2 {
    font-size: 2.8rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.service-item {
    margin-bottom: 2rem;
}

.service-item h3 {
    font-size: 1.6rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

/* --- FORMULARIO Y DATOS DE CONTACTO --- */
.contact-info {
    margin: 2rem 0;
}

.contact-info p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.contact-info i {
    color: var(--primary-color);
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.contact-form h3 {
    font-size: 1.6rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.contact-form input,
.contact-form textarea,
.contact-form label {
    width: 100%;
    padding: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.contact-form label {
    display: block;
    text-align: left;
    padding: 0;
    margin-bottom: 0.5rem;
    border: none;
    font-weight: 500;
}


.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(212, 0, 0, 0.5);
}

.contact-form button {
    background: var(--primary-color);
    color: var(--light-color);
    border: none;
    padding: 0.9rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.contact-form button:hover {
    background: #A80000;
    transform: translateY(-2px);
}

.map-container {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
}

/* --- ESTILOS DEL POPUP --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: var(--light-color);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

.popup-content h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.popup-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.popup-email-link {
    display: inline-block;
    background: var(--primary-color);
    color: var(--light-color);
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
}

.popup-email-link:hover {
    background: #A80000;
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-popup:hover {
    color: var(--dark-color);
}

/* --- ESTILOS PARA PÁGINA DE PROYECTOS Y MARCAS --- */

/* Cuadrícula de Proyectos */
.text-content.full-width {
    flex-basis: 100%;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
}

.project-card {
    background: var(--light-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.project-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.4rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.project-info .project-category {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Texto de Partners */
.partners-text {
    max-width: 800px;
    margin: 0 auto 2rem auto;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Carrusel de Logos */
.logo-scroller {
    width: 100%;
    overflow: hidden;
    padding: 2rem 0;
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}

.scroller-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: scroll 70s linear infinite; /* Velocidad ajustada */
}

.scroller-track img {
    height: 60px;
    margin: 0 40px;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.scroller-track:hover img {
    filter: grayscale(0%);
}

.scroller-track img.logo-inverted {
    filter: grayscale(100%) invert(1);
}

.scroller-track:hover img.logo-inverted {
    filter: grayscale(0%) invert(0);
}

@keyframes scroll {
    to {
        transform: translateX(-50%);
    }
}


/* --- DISEÑO RESPONSIVO --- */
@media (max-width: 820px) {
    .main-header {
        padding: 0.5rem 2%;
    }
    .logo img {
        height: 50px;
    }
    .main-nav ul li {
        margin-left: 1rem;
    }
    .main-nav ul li a {
        font-size: 1rem;
    }
    .content-wrapper {
        flex-direction: column;
    }
    .page-content {
        padding-top: 100px;
    }
}