:root {
    --primary: #003366;
    --secondary: #D32F2F;
    --light: #f4f7f6;
    --dark: #1f2937;
    --text-gray: #4b5563;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 8px;
}

/* ===== RESET Y BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; line-height: 1.6; color: var(--dark); background: var(--white); }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; border-radius: var(--radius); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }

/* ===== TÍTULOS Y BOTONES ===== */
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { font-size: 2.2rem; color: var(--primary); margin-bottom: 10px; }
.section-title p { color: var(--text-gray); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

.btn { display: inline-block; padding: 12px 28px; border-radius: var(--radius); font-weight: 600; cursor: pointer; border: none; }
.btn-primary { background: var(--secondary); color: var(--white); }
.btn-primary:hover { background: #b71c1c; }
.btn-outline-w { border: 2px solid var(--white); color: var(--white); }
.btn-outline-w:hover { background: var(--white); color: var(--primary); }

/* ===== BARRA SUPERIOR Y HEADER ===== */
.top-bar { background: var(--primary); color: var(--white); padding: 8px 0; font-size: 0.9rem; text-align: center; }
.top-bar a { color: var(--white); text-decoration: underline; }

header { background: var(--white); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 1000; }
nav { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; max-width: 1200px; margin: 0 auto; }
.logo-text { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.logo-text span { color: var(--text-gray); font-weight: 400; }
.nav-links { display: flex; gap: 25px; align-items: center; }
.nav-links a { font-weight: 500; }
.nav-links a.active { color: var(--secondary); font-weight: 700; position: relative; }
.nav-links a.active::after {
    content: ''; position: absolute; bottom: -5px; left: 50%;
    transform: translateX(-50%); width: 70%; height: 3px;
    background: var(--secondary); border-radius: 2px;
}
.nav-links .btn { padding: 8px 20px; color: var(--white); }
.menu-toggle { display: none; font-size: 1.5rem; cursor: pointer; color: var(--primary); background: none; border: none; }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(rgba(0,51,102,0.50), rgba(0,51,102,0.50)), url('../img/fondo-principal.png');
    background-size: cover; background-position: center;
    color: var(--white); padding: 50px 0; text-align: center;
}
.hero h1 { font-size: 2.8rem; margin-bottom: 20px; line-height: 1.2; }
.hero p { font-size: 1.2rem; margin-bottom: 30px; max-width: 700px; margin: 0 auto; }
.hero-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

/* ===== GRIDS Y CARDS ===== */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; }

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.3s; }
.card:hover { transform: translateY(-5px); }
.card-header { background: var(--primary); color: var(--white); padding: 20px; display: flex; align-items: center; gap: 12px; }
.card-body { padding: 25px; }
.card-body p { color: var(--text-gray); font-size: 0.95rem; }

/* ===== FEATURES ===== */
.features { background: var(--light); }
.feature-item { text-align: center; padding: 20px; }
.feature-icon { font-size: 2rem; color: var(--primary); margin-bottom: 10px; }

/* ===== SERVICIOS ===== */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; margin-bottom: 50px; }
.service-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; border: 1px solid #eee;
}
.service-card:hover { transform: translateY(-5px); box-shadow: 0 12px 30px rgba(0,51,102,0.15); border-color: var(--primary); }
.service-header {
    background: linear-gradient(135deg, var(--light) 0%, #e8f0f5 100%);
    padding: 20px 25px; display: flex; align-items: center; gap: 12px; color: var(--primary); border-bottom: 2px solid var(--primary);
}
.service-header i { font-size: 1.4rem; width: 25px; text-align: center; }
.service-header h3 { font-size: 1.15rem; margin: 0; font-weight: 600; line-height: 1.3; }
.service-body { padding: 20px 25px; }
.service-body p { color: var(--text-gray); line-height: 1.6; margin: 0; font-size: 0.95rem; }
.service-body strong { color: var(--dark); font-weight: 600; }

.category-header {
    display: flex; align-items: center; gap: 15px; margin-bottom: 40px;
    padding-bottom: 20px; border-bottom: 3px solid var(--secondary);
}
.category-header i { font-size: 2rem; color: var(--primary); }
.category-header h2 { color: var(--primary); font-size: 1.8rem; margin: 0; }

/* ===== PROYECTOS ===== */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.project-item { position: relative; border-radius: var(--radius); overflow: hidden; height: 250px; }
.project-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.project-item:hover img { transform: scale(1.05); }
.project-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8)); padding: 20px; color: var(--white);
}

/* ===== TESTIMONIOS ===== */
.testimonials { background: var(--primary); color: var(--white); }
.testimonials .section-title h2 { color: var(--white); }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.testimonial-card {
    background: rgba(255,255,255,0.1); padding: 30px; border-radius: var(--radius);
    backdrop-filter: blur(5px);
}
.quote { font-size: 3rem; opacity: 0.3; margin-bottom: 15px; line-height: 1; }
.testimonial-card p { margin-bottom: 25px; line-height: 1.6; }
.client-info { display: flex; align-items: center; gap: 15px; margin-top: 20px; }
.client-photo {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3); flex-shrink: 0;
}
.client-name { font-weight: 700; font-size: 1rem; margin-bottom: 3px; }
.client-profession, .client-comuna { font-size: 0.85rem; opacity: 0.8; font-weight: 400; }

/* ===== CONTACTO ===== */
.contact-wrapper { display: grid; grid-template-columns: 1fr 1.2fr; gap: 50px; align-items: start; }
.contact-info h3 { margin-bottom: 20px; color: var(--primary); }
.info-item { display: flex; gap: 15px; margin-bottom: 20px; align-items: center; }
.info-item i { color: var(--secondary); font-size: 1.2rem; width: 25px; }
form { background: var(--light); padding: 30px; border-radius: var(--radius); }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px; border: 1px solid #d1d5db;
    border-radius: var(--radius); font-family: inherit;
}

/* ===== NOSOTROS ===== */
.about-content { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.about-text h3 { color: var(--primary); margin: 20px 0 10px; }
.about-values { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; }
.value-box { background: var(--light); padding: 20px; border-radius: var(--radius); border-left: 4px solid var(--secondary); }

/* ===== FOOTER ===== */
footer { background: #111827; color: #9ca3af; padding: 40px 0 20px; text-align: center; }
.footer-logo { font-size: 1.5rem; color: var(--white); font-weight: bold; margin-bottom: 15px; }
.footer-links { margin: 20px 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; }
.footer-links a:hover { color: var(--white); }
.copyright { border-top: 1px solid #374151; padding-top: 20px; font-size: 0.85rem; }

/* ===== BOTONES FLOTANTES (SOCIAL + WHATSAPP) ===== */
.whatsapp-float {
    position: fixed; bottom: 20px; right: 20px; background: #25D366; color: white;
    width: 55px; height: 55px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 28px; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 2000; transition: 0.3s; border: 2px solid white;
}
.whatsapp-float:hover { transform: scale(1.1); background: #128C7E; }

.social-float {
    position: fixed; right: 20px; bottom: 90px; display: flex; flex-direction: column;
    gap: 12px; z-index: 1999; align-items: flex-end;
}
.social-float-item {
    width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; color: white; font-size: 1.1rem; transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25); text-decoration: none; border: 2px solid white;
}
.social-float-item:hover { transform: scale(1.15) translateY(-2px); box-shadow: 0 5px 20px rgba(0,0,0,0.35); }
.social-float-item.tiktok { background: #000000; }
.social-float-item.tiktok:hover { background: #fe2c55; }
.social-float-item.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}
.social-float-item.instagram:hover {
    background: linear-gradient(45deg, #bc1888, #cc2366, #dc2743, #e6683c, #f09433);
}
.social-float-item.facebook { background: #1877f2; }
.social-float-item.facebook:hover { background: #166fe5; }

/* ===== GALERÍA ===== */
.gallery-filters { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; flex-wrap: wrap; }
.filter-btn {
    padding: 10px 20px; border: 2px solid var(--primary); background: transparent;
    color: var(--primary); border-radius: 30px; cursor: pointer; font-weight: 600; transition: 0.3s;
}
.filter-btn:hover, .filter-btn.active { background: var(--primary); color: white; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.gallery-item {
    position: relative; overflow: hidden; border-radius: var(--radius);
    cursor: pointer; height: 250px; box-shadow: var(--shadow);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.1); }
.gallery-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,51,102,0.8); display: flex; flex-direction: column;
    justify-content: center; align-items: center; opacity: 0; transition: 0.3s;
    color: white; text-align: center; padding: 20px;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay h3 { margin: 0 0 5px; }
.gallery-overlay i { margin-top: 10px; font-size: 1.5rem; }

/* Lightbox */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 2000; display: none;
    justify-content: center; align-items: center; padding: 20px;
}
.lightbox.active { display: flex; }
.lightbox-img { max-width: 90%; max-height: 90vh; border-radius: 5px; }
.lightbox-close { position: absolute; top: 20px; right: 30px; color: white; font-size: 3rem; cursor: pointer; }

/* ===== CTA BOX ===== */
.cta-box {
    background: linear-gradient(135deg, var(--primary) 0%, #004080 100%);
    padding: 40px; border-radius: var(--radius); text-align: center; color: white; margin-top: 30px;
}
.cta-box h3 { margin-bottom: 15px; font-size: 1.5rem; }
.cta-box p { margin-bottom: 25px; max-width: 600px; margin: 0 auto; opacity: 0.95; }
.cta-box .btn-primary { background: var(--secondary); color: white; }
.cta-box .btn-primary:hover { background: #b71c1c; }

/* ===== BADGE MERCADO PÚBLICO ===== */
.mercado-publico-badge {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--primary); padding: 25px 30px; border-radius: var(--radius);
    display: flex; align-items: center; gap: 20px; margin: 40px auto;
    max-width: 800px; box-shadow: var(--shadow);
}
.badge-icon {
    font-size: 2.2rem; color: var(--primary); background: rgba(0,51,102,0.08);
    width: 70px; height: 70px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
}
.badge-content h3 { color: var(--primary); font-size: 1.25rem; margin-bottom: 8px; font-weight: 700; }
.badge-content p { color: var(--text-gray); margin-bottom: 12px; line-height: 1.5; font-size: 0.95rem; }
.badge-link {
    color: var(--secondary); font-weight: 600; font-size: 0.9rem;
    display: inline-flex; align-items: center; gap: 6px; transition: 0.3s;
}
.badge-link:hover { text-decoration: underline; color: #b71c1c; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--white); flex-direction: column; padding: 20px;
        box-shadow: var(--shadow); gap: 15px;
    }
    .nav-links.active { display: flex; }
    .menu-toggle { display: block; }
    
    .hero h1 { font-size: 2rem; }
    .contact-wrapper, .about-content, .about-values { grid-template-columns: 1fr; }
    .section { padding: 60px 0; }
    
    .services-grid, .project-grid, .testimonials-grid { grid-template-columns: 1fr; }
    .category-header { flex-direction: column; text-align: center; }
    .cta-box { padding: 30px 20px; }
    .cta-box h3 { font-size: 1.3rem; }
    
    .client-photo { width: 60px; height: 60px; }
    .client-name { font-size: 0.95rem; }
    .client-profession { font-size: 0.8rem; }
    
    .social-float { right: 15px; bottom: 85px; gap: 10px; }
    .social-float-item { width: 40px; height: 40px; font-size: 1rem; }
    .whatsapp-float { width: 50px; height: 50px; font-size: 24px; bottom: 15px; right: 15px; }
    
    .mercado-publico-badge { flex-direction: column; text-align: center; padding: 25px 20px; margin: 30px auto; }
    .badge-icon { margin-bottom: 10px; }
}

@media (max-width: 360px) {
    .social-float { bottom: 80px; right: 10px; }
    .social-float-item { width: 38px; height: 38px; font-size: 0.9rem; }
    .whatsapp-float { width: 48px; height: 48px; font-size: 24px; }
}