/* =========================================
   VARIABLES & RESET
   ========================================= */
:root {
    /* Colores Corporativos (Logo Rojo) */
    --primary-color: #C62828; 
    --primary-dark: #8E1C1C;
    --secondary-color: #37474F; 
    --accent-color: #FFC107;
    --bg-light: #F5F7FA;
    --white: #FFFFFF;
    --text-main: #333333;
    --text-light: #666666;
    
    /* Configuración */
    --container-width: 1200px;
    --header-height: 80px;
    --border-radius: 8px;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 16px;
    color: var(--text-main);
    line-height: 1.6;
}

body {
    background-color: var(--white);
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* =========================================
   UTILIDADES
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* =========================================
   BOTONES
   ========================================= */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn-secondary-cta {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn-secondary-cta:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* =========================================
   HEADER & TOP BAR
   ========================================= */
.top-bar {
    background-color: var(--secondary-color);
    color: var(--white);
    font-size: 0.85rem;
    padding: 10px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.logo svg { width: 40px; height: 40px; fill: var(--primary-color); }

.nav-menu { display: flex; gap: 30px; align-items: center; }
.nav-link { font-weight: 500; color: var(--secondary-color); }
.nav-link:hover { color: var(--primary-color); }
.mobile-toggle { display: none; font-size: 1.8rem; cursor: pointer; }

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    /* Placeholder de construcción */
    background: linear-gradient(rgba(55, 71, 79, 0.85), rgba(55, 71, 79, 0.7)), url('https://images.unsplash.com/photo-1541888946425-d81bb19240f5?auto=format&fit=crop&w=1950&q=80');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}

.hero h1 { font-size: 3rem; margin-bottom: 1.5rem; font-weight: 800; line-height: 1.2; }
.hero p { font-size: 1.25rem; margin-bottom: 2.5rem; color: #E0E0E0; max-width: 800px; margin-left: auto; margin-right: auto; }

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.badge {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.3);
}

.hero-buttons { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }

/* =========================================
   TRUST SECTION (Datos)
   ========================================= */
.trust-section { margin-top: -50px; position: relative; z-index: 10; padding-bottom: 4rem; }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.trust-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    text-align: center;
    border-top: 4px solid var(--primary-color);
}
.trust-card strong { display: block; font-size: 1.5rem; color: var(--secondary-color); margin-bottom: 5px; }
.trust-card p { color: var(--text-light); font-size: 0.9rem; }

/* =========================================
   SERVICIOS
   ========================================= */
.services { padding: 80px 0; background-color: var(--bg-light); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 30px; }
.service-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card); }
.service-icon {
    width: 50px; height: 50px;
    background-color: rgba(198, 40, 40, 0.1);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.service-icon svg { width: 28px; height: 28px; fill: var(--primary-color); }
.service-card h3 { font-size: 1.2rem; margin-bottom: 10px; color: var(--secondary-color); }
.service-card p { font-size: 0.9rem; color: var(--text-light); line-height: 1.5; }

/* =========================================
   NOSOTROS / MISION
   ========================================= */
.about-section { padding: 80px 0; background-color: var(--white); }
.mission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.about-card h3 { color: var(--primary-color); margin-bottom: 15px; font-size: 1.4rem; }
.values-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.value-tag {
    background-color: var(--bg-light);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-color);
}

/* =========================================
   PROYECTOS (Tabla y Cards)
   ========================================= */
.projects { padding: 80px 0; background-color: var(--secondary-color); color: var(--white); }
.projects .section-title h2 { color: var(--white); }
.projects .section-title h2::after { background-color: var(--accent-color); }

.table-wrapper {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    margin-top: 30px;
}

table { width: 100%; border-collapse: collapse; min-width: 800px; color: var(--text-main); }
th { background-color: #ECEFF1; padding: 15px; text-align: left; font-weight: 700; color: var(--secondary-color); border-bottom: 2px solid var(--primary-color); }
td { padding: 15px; border-bottom: 1px solid #eee; font-size: 0.95rem; }
tr:last-child td { border-bottom: none; }

/* Mobile Cards (Ocultas en desktop) */
.mobile-project-cards { display: none; gap: 20px; flex-direction: column; }
.project-card-mobile { background: white; color: var(--text-main); padding: 15px; border-radius: 8px; }
.project-card-mobile strong { color: var(--primary-color); display: block; margin-bottom: 5px; }
.project-data-row { display: flex; justify-content: space-between; font-size: 0.9rem; margin-top: 5px; border-bottom: 1px solid #eee; padding-bottom: 5px;}

/* =========================================
   CTA BAND
   ========================================= */
.cta-band { background-color: var(--primary-color); color: var(--white); padding: 60px 0; text-align: center; }
.cta-band h2 { font-size: 2rem; margin-bottom: 20px; }

/* =========================================
   CONTACTO
   ========================================= */
.contact-section { padding: 80px 0; background-color: var(--bg-light); }
.contact-container {
    display: grid; grid-template-columns: 1fr 1.5fr; gap: 50px;
    background: var(--white); padding: 40px;
    border-radius: var(--border-radius); box-shadow: var(--shadow-card);
}
.contact-info h3 { font-size: 1.5rem; margin-bottom: 20px; color: var(--secondary-color); }
.info-item { display: flex; gap: 15px; margin-bottom: 20px; align-items: flex-start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: var(--secondary-color); }
input, select, textarea {
    width: 100%; padding: 12px;
    border: 1px solid #ddd; border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-color); }
.checkbox-group { display: flex; align-items: center; gap: 10px; }
.checkbox-group input { width: auto; }

/* =========================================
   FAQ
   ========================================= */
.faq-section { padding: 60px 0; max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid #ddd; padding: 20px 0; }
.faq-question { font-weight: 700; cursor: pointer; position: relative; padding-right: 30px; color: var(--secondary-color); }
.faq-question::after { content: '+'; position: absolute; right: 0; font-size: 1.2rem; color: var(--primary-color); }
.faq-answer { display: none; padding-top: 10px; color: var(--text-light); }
.faq-item.active .faq-answer { display: block; }
.faq-item.active .faq-question::after { content: '-'; }

/* =========================================
   FOOTER
   ========================================= */
footer { background-color: #263238; color: #B0BEC5; padding: 60px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 40px;}
.footer-col h4 { color: var(--white); margin-bottom: 20px; font-size: 1.2rem;}
.footer-links li { margin-bottom: 10px; }
.footer-links a:hover { color: var(--primary-color); }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; }

/* =========================================
   WIDGETS (Toast & Whatsapp)
   ========================================= */
.whatsapp-float {
    position: fixed; bottom: 30px; right: 30px;
    background-color: #25D366; color: white;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); z-index: 1001;
    transition: transform 0.3s;
}
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 35px; height: 35px; fill: white; }

.toast {
    position: fixed; top: 20px; right: 20px;
    background-color: #43A047; color: white;
    padding: 15px 25px; border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 2000;
    opacity: 0; transform: translateY(-20px); transition: all 0.4s ease;
    display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* =========================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================= */

/* Tablets y Laptops Pequeñas (max 992px) */
@media (max-width: 992px) {
    .hero h1 { font-size: 2.5rem; }
    .contact-container { grid-template-columns: 1fr; }
    /* Ajuste en sección Trust para tablets */
    .trust-section { margin-top: 0; background-color: var(--bg-light); padding-top: 40px;}
    .trust-card { border-top: none; border-left: 4px solid var(--primary-color); text-align: left; }
}

/* Tablets Verticales y Móviles (max 768px) */
@media (max-width: 768px) {
    /* Menú Móvil */
    .mobile-toggle { display: block; color: var(--secondary-color); }
    
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        padding: 20px 0;
        border-bottom: 1px solid #ddd;
        display: none; /* Oculto por defecto */
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }
    
    .nav-menu.active { display: flex; }
    
    .nav-cta { width: 80%; margin-top: 10px; }

    /* Tipografía y Layouts */
    .hero h1 { font-size: 2rem; }
    .form-row { grid-template-columns: 1fr; }
    
    /* Transformación de Tabla a Cards (Vital para UX móvil) */
    .table-wrapper { display: none; }
    .mobile-project-cards { display: flex; }
}

/* Móviles Pequeños (max 480px) */
@media (max-width: 480px) {
    .top-bar { display: none; } /* Ocultar barra superior para espacio */
    .hero h1 { font-size: 1.8rem; }
    .hero-badges { flex-direction: column; align-items: center; }
    .trust-grid { grid-template-columns: 1fr; }
    
    .whatsapp-float {
        width: 50px; height: 50px;
        bottom: 20px; right: 20px;
    }
    .whatsapp-float svg { width: 28px; height: 28px; }
}