/* ============================================= */
/* ========= 1. VARIABLES Y ESTILOS GLOBALES ===== */
/* ============================================= */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --white-color: #ffffff;
    --success-color: #28a745;
    --font-family: 'Poppins', sans-serif;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.7;
    background-color: var(--white-color);
    color: var(--dark-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1, h2, h3, h4 {
    line-height: 1.3;
    font-weight: 600;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; margin-bottom: 1.5rem; text-align: center; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

section {
    padding: 5rem 0;
}


/* ============================================= */
/* =============== 2. COMPONENTES ================ */
/* ============================================= */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    color: var(--white-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--dark-color);
    border: 2px solid var(--dark-color);
}

.btn-secondary:hover {
    background-color: var(--dark-color);
    color: var(--white-color);
}

/* ============================================= */
/* ============= 3. HEADER Y NAVEGACIÓN ========== */
/* ============================================= */
.header {
    height: var(--header-height);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.header.scrolled {
    background-color: var(--white-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo img {
    height: 40px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--dark-color);
    font-weight: 600;
    position: relative;
    padding: 5px 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a.active {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

/* ============================================= */
/* ============= 4. SECCIONES DE PÁGINA ========== */
/* ============================================= */

/* --- Hero Section --- */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white-color);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/hero-background.jpg') no-repeat center center/cover;
    z-index: -1;
    animation: kenburns 30s ease-out infinite alternate;
}

.hero-content {
    max-width: 800px;
    padding: 0 1.5rem; /* MODIFICADO: Añade espacio horizontal para que el texto no toque los bordes */
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    min-height: 100px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* MODIFICADO: Se añade un contenedor flex para los botones para un mejor espaciado */
.hero-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Permite que los botones se apilen en pantallas pequeñas */
    gap: 1rem; /* Espacio uniforme entre botones (vertical y horizontal) */
}

.hero-buttons .btn {
    margin: 0; /* Se elimina el margen individual, ahora 'gap' lo controla */
}

/* --- REGLA AÑADIDA PARA CORREGIR SUPERPOSICIÓN DEL MENÚ --- */
main > section:first-of-type:not(.hero) {
    padding-top: calc(var(--header-height) + 4rem);
}

.page-hero {
    background-color: var(--light-color);
    text-align: center;
    padding-top: 0; /* Se anula el padding-top original para que no se sume con el de la regla anterior */
    padding-bottom: 4rem;
}

.page-hero h1 {
    margin-bottom: 1rem;
}

.page-hero p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

/* --- Value Proposition --- */
.value-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: var(--white-color);
    padding: 2rem;
    text-align: center;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card-icon {
    width: 60px;
    margin-bottom: 1rem;
}

/* --- Featured Services --- */
.featured-services {
    background-color: var(--light-color);
}

.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--white-color);
    padding: 2rem;
    border-left: 5px solid var(--primary-color);
}
.service-card a {
    font-weight: 600;
}

/* --- Testimonials --- */
.testimonial {
    max-width: 700px;
    margin: 2rem auto;
    text-align: center;
}
.testimonial blockquote {
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 1rem;
}
.testimonial cite {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.testimonial cite img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- Final CTA --- */
.final-cta {
    background-color: var(--dark-color);
    color: var(--white-color);
    text-align: center;
}
.final-cta h2 { color: var(--white-color); }
.final-cta p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* --- Team Section (Sobre Nosotros) --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    align-items: start;
}

.team-member {
    text-align: center;
    padding: 1.5rem;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.team-member .member-photo-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.team-member .member-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-member h3 {
    margin-bottom: 0.25rem;
}

.team-member .member-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.team-member .member-bio {
    font-size: 0.95rem;
    color: var(--secondary-color);
    line-height: 1.6;
}

/* --- Other Sections --- */
.service-entry { margin-bottom: 3rem; padding: 2rem; border: 1px solid #e9ecef; border-radius: 5px; }
.service-entry ul { list-style-type: '✓ '; padding-left: 1.5rem; }
.service-entry li { margin-bottom: 0.5rem; }

.work-process { background-color: var(--light-color); }
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; text-align: center; }
.process-step h3 { color: var(--primary-color); margin-bottom: 0.5rem; }

.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 0.8rem; border-radius: 5px; border: 1px solid #ccc; font-family: var(--font-family); }
.contact-info p { margin-bottom: 1.5rem; }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.blog-post-card { background: var(--white-color); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.08); transition: transform 0.3s ease; }
.blog-post-card:hover { transform: translateY(-5px); }
.blog-card-content { padding: 1.5rem; }
.blog-card-category { font-size: 0.8rem; font-weight: 600; color: var(--primary-color); text-transform: uppercase; margin-bottom: 0.5rem; }
.blog-card-title a { color: var(--dark-color); }
.blog-card-meta { font-size: 0.9rem; color: var(--secondary-color); margin-top: 1rem; }

.pagination { margin-top: 3rem; text-align: center; }
.pagination ul { display: inline-flex; gap: 0.5rem; }
.pagination a { display: block; padding: 0.5rem 1rem; border: 1px solid #ddd; border-radius: 5px; }
.pagination a.active { background-color: var(--primary-color); color: var(--white-color); border-color: var(--primary-color); }

/* ============================================= */
/* ================== 5. FOOTER ================== */
/* ============================================= */
.footer { background-color: var(--dark-color); color: var(--light-color); padding: 4rem 0 0; }
.footer a { color: var(--light-color); }
.footer a:hover { color: var(--primary-color); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-col h3 { margin-bottom: 1rem; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-bottom { margin-top: 3rem; padding: 1.5rem 0; text-align: center; border-top: 1px solid #444; }

/* ============================================= */
/* =============== 6. ANIMACIONES ============== */
/* ============================================= */
.fade-in-section { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in-section.visible { opacity: 1; transform: translateY(0); }

@keyframes kenburns {
    0% { transform: scale(1.0) translate(0, 0); }
    100% { transform: scale(1.1) translate(-2%, 2%); }
}

/* ============================================= */
/* ============= 7. FORMULARIO JS ============== */
/* ============================================= */
.form-message { padding: 1rem; margin-top: 1.5rem; border-radius: 5px; text-align: center; font-weight: 600; display: none; }
.form-message.success { display: block; background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.form-message.error { display: block; background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ============================================= */
/* ============= 8. RESPONSIVIDAD ============== */
/* ============================================= */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.8rem; }
    section { padding: 3rem 0; }

    .nav-menu { display: none; position: absolute; top: var(--header-height); left: 0; width: 100%; background-color: var(--white-color); flex-direction: column; align-items: center; padding: 2rem 0; box-shadow: 0 5px 10px rgba(0,0,0,0.1); }
    .nav-menu.active { display: flex; }

    .header .btn { display: none; }
    
    .hamburger { display: block; width: 30px; height: 22px; position: relative; }
    .hamburger span { display: block; width: 100%; height: 3px; background-color: var(--dark-color); position: absolute; border-radius: 3px; transition: all 0.3s; }
    .hamburger span:nth-child(1) { top: 0; }
    .hamburger span:nth-child(2) { top: 9px; }
    .hamburger span:nth-child(3) { bottom: 0; }
    
    .hamburger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
    
    .value-cards, .process-grid, .contact-grid, .team-grid { grid-template-columns: 1fr; }
}