/* ==== BEGIN CSS – REEMPLAZA TODO EL CONTENIDO DEL FICHERO ==== */
/* ==========================================================================
   Raquel Fernández Espinosa - Fisioterapeuta Website Styles - VERSIÓN CORREGIDA
   ========================================================================== */

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #f1f5f9;
    --accent: #10b981;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 16px;
    --radius-sm: 8px;
    /* alturas totales (2 filas) */
    --header-height: 120px;          /* desktop */
    --header-height-mobile: 100px;   /* móvil */
    --section-top-padding: 32px;     /* espacio superior de cada sección */
    --wa-green: #25D366;             /* verde oficial WhatsApp */
    --wa-green-hover: #1EB656;
}

/* Compensación nativa de anclas bajo el header sticky */
[id] { 
  scroll-margin-top: calc(var(--header-height) + 8px);
}

/* Ajuste específico para cabecera del blog */
.blog-header{
  padding-top: var(--header-height);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a { text-decoration: none; color: inherit; }

ul { list-style: none; }

button { font-family: inherit; }

/* Espaciado vertical base de secciones */
section { padding-top: var(--section-top-padding); }

/* Móvil <640px: ligero ajuste de padding superior */
@media (max-width: 640px){
  section { padding-top: calc(var(--section-top-padding) - 6px); }
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    min-height: 70px;
}

.brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary);
    transition: color 0.3s ease;
}
.brand:hover { color: var(--primary-dark); }

.header-actions { display: flex; align-items: center; gap: 1rem; }

/* Segunda fila de navegación */
.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.98);
}

.nav a {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

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

.nav a:hover::after,
.nav a.active::after { width: 80%; }

.nav a:hover {
    color: var(--primary);
    background: var(--gray-50);
}

.menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}
.menu:hover { background-color: var(--gray-100); }

/* ===== MODIFICADO: Menú lateral para móvil (se mantiene tal cual) ===== */
@media (max-width: 768px) {
    :root { --header-height: 60px; }

    .menu { display: block; }

    .nav {
        position: fixed;
        top: 0; left: -280px;
        width: 280px; height: 100vh;
        background: var(--white);
        flex-direction: column;
        padding: 80px 20px 20px;
        box-shadow: var(--shadow-xl);
        gap: 0; border-top: none;
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }
    .nav.active { left: 0; }

    .nav a {
        padding: 16px 12px;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid var(--border);
    }
    .nav a:last-child { border-bottom: none; }
    .nav a::after { display: none; }

    .nav-overlay {
        position: fixed; top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0; visibility: hidden;
        transition: all 0.3s ease;
    }
    .nav-overlay.active { opacity: 1; visibility: visible; }
}

/* ==========================================================================
   Language Selector
   ========================================================================== */

.language-selector { position: relative; }

.lang-toggle {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
}
.lang-toggle:hover { background: var(--gray-50); border-color: var(--primary); }
.lang-toggle:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.lang-current { font-weight: 600; color: var(--primary); }

.lang-menu {
    position: absolute; top: 100%; right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 1001;
    opacity: 0; visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 4px;
}
.language-selector.active .lang-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.lang-option {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.2s ease;
    cursor: pointer;
}
.lang-option:last-child { border-bottom: none; }
.lang-option:hover { background: var(--gray-50); color: var(--primary); }
.lang-option.active { background: var(--primary); color: var(--white); }
.lang-option.active:hover { background: var(--primary-dark); color: var(--white); }
.lang-flag { font-size: 1rem; line-height: 1; }
.lang-name { font-weight: 500; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500; font-size: 0.95rem;
    transition: all 0.3s ease;
    border: none; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:focus { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn-primary { background: var(--primary); color: var(--white); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.btn-wa { background: var(--wa-green); color: var(--white); font-size: 0.9rem; }
.btn-wa:hover { background: var(--wa-green-hover); }

.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    padding: 15px 0 80px;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    position: relative; overflow: hidden;
    min-height: calc(100vh - var(--header-height));
    display: flex; align-items: flex-start;
}
.hero::before {
    content: '';
    position: absolute; top: 0; right: -50%;
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
    z-index: 0;
}
.hero-content {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
    position: relative; z-index: 1;
}
.hero-text h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem; line-height: 1.2; font-weight: 700;
    color: var(--text-primary); margin-bottom: 1.5rem;
    opacity: 0; animation: fadeInUp 1s ease forwards;
}
.hero-text .subtitle {
    font-size: 1.25rem; font-weight: 500; color: var(--primary); margin-bottom: 1rem;
    opacity: 0; animation: fadeInUp 1s ease 0.2s forwards;
}
.hero-text .location {
    font-size: 0.95rem; color: var(--text-light); margin-bottom: 1.5rem;
    opacity: 0; animation: fadeInUp 1s ease 0.4s forwards;
}
.hero-text .description {
    font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 2rem; line-height: 1.8;
    opacity: 0; animation: fadeInUp 1s ease 0.6s forwards;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; opacity: 0; animation: fadeInUp 1s ease 0.8s forwards; }

.hero-photo { position: relative; opacity: 0; animation: fadeInRight 1s ease 1s forwards; width: 511px; height: 511px; }
.hero-img {
    width: 100%; height: 100%; object-fit: cover; object-position: center bottom;
    border-radius: var(--radius); box-shadow: var(--shadow-xl); transition: transform 0.3s ease;
}
.hero-img:hover { transform: scale(1.02); }

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: 20px 0 40px; }
.section-alt { background: var(--gray-50); }

.section-header {
    text-align: center; margin-bottom: 3.5rem; max-width: 800px; margin-left: auto; margin-right: auto;
}
.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem; font-weight: 600; color: var(--text-primary); margin-bottom: 1rem; line-height: 1.3;
}
#blog .section-header { padding-top: 10px; }
.section-header p { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.7; }

/* ==========================================================================
   Cards Grid
   ========================================================================== */

.cards-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem; margin-top: 3rem;
}
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    height: 100%;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-xl); }
.card h3 {
    font-size: 1.3rem; font-weight: 600; color: var(--text-primary); margin-bottom: 1rem;
    display: flex; align-items: center; gap: 0.5rem; line-height: 1.4;
}
.card-image { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 1.5rem; }
.pill { background: var(--primary); color: var(--white); padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 500; white-space: nowrap; }

/* ==========================================================================
   Services Grid
   ========================================================================== */

.services-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem; margin-top: 3rem;
}
.service {
    background: var(--white); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: all 0.3s ease; height: 100%;
    display: flex; flex-direction: column;
}
.service:hover { transform: translateY(-8px); box-shadow: var(--shadow-xl); }
.service-img { width: 100%; height: 200px; object-fit: cover; }
.service-text { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.service-text h3 { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.75rem; line-height: 1.4; }
.service-text p { color: var(--text-secondary); line-height: 1.6; flex-grow: 1; }

/* ==========================================================================
   PNIE Section
   ========================================================================== */

.pnie-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white); position: relative; overflow: hidden;
}
.pnie-section::before {
    content: ''; position: absolute; top: 0; left: -50%;
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    z-index: 0;
}
.pnie-content { position: relative; z-index: 1; }
.pnie-header { text-align: center; margin-bottom: 3rem; }
.badge { background: rgba(255, 255, 255, 0.2); color: var(--white); padding: 8px 20px; border-radius: 30px; font-size: 0.9rem; font-weight: 500; display: inline-block; margin-bottom: 1rem; }
.pnie-header h2 { font-family: 'Playfair Display', serif; font-size: 2.5rem; font-weight: 600; margin-bottom: 1rem; line-height: 1.3; }
.pnie-header p { font-size: 1.1rem; opacity: 0.9; line-height: 1.7; max-width: 700px; margin: 0 auto; }

.pnie-explanation {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 2.5rem; margin: 3rem 0; text-align: left; backdrop-filter: blur(10px);
}
.pnie-explanation h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1.5rem; color: var(--white); }
.pnie-explanation p { font-size: 1.05rem; line-height: 1.7; margin-bottom: 1.5rem; opacity: 0.95; }
.pnie-explanation strong { font-weight: 600; color: var(--white); }

.pnie-why-revolutionary { margin-top: 2rem; }
.pnie-why-revolutionary h4 { font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; color: var(--white); }
.pnie-benefits-list { display: grid; gap: 1rem; }
.pnie-benefits-list li { padding-left: 1.5rem; position: relative; opacity: 0.9; line-height: 1.6; }
.pnie-benefits-list li::before { content: '✦'; position: absolute; left: 0; color: var(--white); font-weight: 600; }

.pnie-columns {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius); padding: 2rem; backdrop-filter: blur(5px);
}
.pnie-columns h3 { font-size: 1.4rem; font-weight: 600; margin-bottom: 1.5rem; }

.pnie-conditions, .pnie-benefits { display: flex; flex-direction: column; gap: 2rem; }
.condition-group, .benefit-group {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 1.5rem; backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}
.condition-group:hover, .benefit-group:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }
.condition-group h4, .benefit-group h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; color: var(--white); }
.condition-group ul, .benefit-group ul { display: flex; flex-direction: column; gap: 0.5rem; }
.condition-group li, .benefit-group li { margin-bottom: 0.5rem; padding-left: 1.5rem; position: relative; opacity: 0.9; line-height: 1.6; }
.condition-group li::before, .benefit-group li::before { content: '→'; position: absolute; left: 0; color: var(--white); font-weight: 600; }

.pnie-process { margin-top: 4rem; text-align: left; }
.pnie-process h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 2rem; text-align: center; }
.process-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.step {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 2rem; text-align: center; backdrop-filter: blur(5px);
}
.step-number {
    background: var(--white); color: var(--primary);
    width: 50px; height: 50px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; margin: 0 auto 1rem;
}
.step-content h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--white); }
.step-content p { font-size: 0.95rem; opacity: 0.9; line-height: 1.6; }

/* ==========================================================================
   Testimonials
   ========================================================================== */

.testimonials-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem; margin-top: 2rem;
}
.testimonial {
    background: var(--white); border-radius: var(--radius);
    padding: 2rem; box-shadow: var(--shadow); position: relative;
    border-left: 4px solid var(--primary); height: 100%;
    display: flex; flex-direction: column;
}
.testimonial::before {
    content: '"';
    position: absolute; top: 1rem; left: 1.5rem;
    font-size: 3rem; color: var(--primary); font-family: 'Playfair Display', serif; opacity: 0.3; line-height: 1;
}
.testimonial-text { font-style: italic; color: var(--text-secondary); margin-bottom: 1rem; padding-top: 1rem; line-height: 1.6; flex-grow: 1; }
.testimonial-author { font-weight: 600; color: var(--text-primary); margin-top: auto; }

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem; margin-top: 3rem;
}
.contact-card {
    background: var(--white); border-radius: var(--radius);
    padding: 2rem; box-shadow: var(--shadow); transition: all 0.3s ease; height: 100%;
}
.contact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.contact-card h3 { font-size: 1.3rem; font-weight: 600; color: var(--primary); margin-bottom: 1rem; }
.contact-card p { color: var(--text-secondary); margin-bottom: 0.5rem; line-height: 1.6; }
.clinic-zone { font-size: 0.9rem; color: var(--text-light); margin-top: 1rem; }
.map { color: var(--primary); font-weight: 500; }
.map:hover { text-decoration: underline; }
.contact-cta { text-align: center; margin-top: 3rem; }

/* ==========================================================================
   Blog
   ========================================================================== */

.blog-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem; margin-top: 3rem;
}
.blog-card {
    background: var(--white); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    transition: all 0.3s ease; display: block; height: 100%;
}
.blog-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-xl); }
.blog-card-img { width: 100%; height: 200px; object-fit: cover; }
.blog-card-content { padding: 1.5rem; height: 100%; display: flex; flex-direction: column; }
.blog-card h3 { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.75rem; line-height: 1.4; }
.blog-card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; flex-grow: 1; }
.blog-meta { font-size: 0.85rem; color: var(--text-light); margin-top: 1rem; }
.blog-card.featured { background: var(--primary); }
.blog-card.featured h3, .blog-card.featured p { color: var(--white); }
.blog-card-cta { justify-content: center; text-align: center; padding: 3rem 1.5rem; }

/* ==========================================================================
   Curriculum
   ========================================================================== */

.curriculum-content { max-width: 1000px; margin: 0 auto; }
.curriculum-section { margin-bottom: 4rem; }
.curriculum-section:last-child { margin-bottom: 0; }

.curriculum-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid var(--primary);
}
.curriculum-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem; font-weight: 600; color: var(--text-primary); margin: 0;
}
.curriculum-section > h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem; font-weight: 600; color: var(--text-primary);
    margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid var(--primary);
}

.experience-badge { background: var(--primary); color: var(--white); padding: 8px 16px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; }

.experience-grid { display: flex; flex-direction: column; gap: 2rem; }

.experience-item {
    display: grid; grid-template-columns: 150px 1fr; gap: 2rem; padding: 2rem;
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    border-left: 4px solid var(--primary); transition: all 0.3s ease;
}
.experience-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.experience-item.highlight { border-left-color: var(--accent); background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%); }

.experience-period {
    font-weight: 600; color: var(--primary); font-size: 0.95rem; text-align: right; padding-right: 1rem; position: relative;
}
.experience-period::after {
    content: ''; position: absolute; right: -1rem; top: 0.5rem;
    width: 8px; height: 8px; background: var(--primary); border-radius: 50%;
}
.experience-content h4 { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); margin-bottom: 1rem; }
.experience-places { display: flex; flex-direction: column; gap: 1rem; }
.place strong { color: var(--primary); font-weight: 600; display: block; margin-bottom: 0.5rem; }
.place p { color: var(--text-secondary); line-height: 1.6; margin: 0; }

.education-timeline { display: flex; flex-direction: column; gap: 1.5rem; position: relative; }
.education-timeline::before { content: ''; position: absolute; left: 100px; top: 0; bottom: 0; width: 2px; background: var(--border); }

.education-item {
    display: grid; grid-template-columns: 100px 1fr; gap: 2rem; padding: 1.5rem 0; position: relative;
}
.education-item::before { content: ''; position: absolute; left: 99px; top: 2rem; width: 4px; height: 4px; background: var(--primary); border-radius: 50%; z-index: 1; }
.education-item.current::before { background: var(--accent); width: 8px; height: 8px; left: 97px; }

.education-year { font-weight: 600; color: var(--primary); font-size: 0.95rem; text-align: right; padding-right: 1rem; }
.education-content h4 { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; }
.institution { color: var(--primary); font-weight: 500; margin-bottom: 0.75rem; font-size: 0.95rem; }
.description { color: var(--text-secondary); line-height: 1.6; margin-bottom: 1rem; }
.education-badge { background: var(--accent); color: var(--white); padding: 4px 12px; border-radius: 15px; font-size: 0.8rem; font-weight: 500; display: inline-block; margin-top: 0.5rem; }
.education-badge.current { background: var(--accent); animation: pulse 2s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.skills-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.skill-tag { background: var(--gray-100); color: var(--text-primary); padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 500; }

.complementary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.complementary-item { background: var(--white); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); border-top: 4px solid var(--primary); }
.complementary-item h4 { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 1rem; }
.complementary-item ul { list-style: none; }
.complementary-item li { color: var(--text-secondary); margin-bottom: 0.5rem; padding-left: 1.2rem; position: relative; line-height: 1.5; }
.complementary-item li::before { content: '▪'; position: absolute; left: 0; color: var(--primary); font-weight: 600; }

.highlight-section { background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%); border-radius: var(--radius); padding: 2rem; margin-top: 2rem; }

.sports-background { background: var(--white); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); border-left: 4px solid var(--accent); }
.sports-content h4 { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); margin-bottom: 1rem; }
.sports-content p { color: var(--text-secondary); line-height: 1.7; margin-bottom: 1.5rem; }
.sports-values { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.value-tag { background: var(--accent); color: var(--white); padding: 6px 12px; border-radius: 15px; font-size: 0.85rem; font-weight: 500; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { background: var(--text-primary); color: var(--white); padding: 3rem 0 1rem; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-main h3 { font-family: 'Playfair Display', serif; font-size: 1.5rem; margin-bottom: 1rem; color: var(--white); }
.footer-main p { color: rgba(255, 255, 255, 0.8); line-height: 1.6; margin-bottom: 0.5rem; }
.footer-contact h4, .footer-locations h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; color: var(--white); }
.footer-contact p, .footer-locations li { color: rgba(255, 255, 255, 0.8); margin-bottom: 0.5rem; line-height: 1.6; }
.footer-contact a { color: rgba(255, 255, 255, 0.8); transition: color 0.3s ease; }
.footer-contact a:hover { color: var(--white); }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem; text-align: center;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: rgba(255, 255, 255, 0.8); transition: color 0.3s ease; }
.footer-links a:hover { color: var(--white); }

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInFromTop {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ==========================================================================
   Responsive – TABLET (<=1024px)
   ========================================================================== */

@media (max-width: 1024px) {
    .hero-content { gap: 3rem; }
    .hero-text h1 { font-size: 3rem; }
    .pnie-columns { gap: 3rem; }
    .section { padding: 45px 0; }
    .process-steps { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* ==========================================================================
   Responsive – MOBILE (<=768px) — BLOQUE CONSOLIDADO
   ========================================================================== */

@media (max-width: 768px) {
    /* Header responsivo */
    .header-main { padding: 12px 0; min-height: 60px; }
    .brand { font-size: 1.4rem; }
    .header-actions { gap: 0.5rem; }

    /* Hero responsivo */
    .hero { padding: 70px 0 60px; min-height: auto; align-items: flex-start; }
    .hero-content { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    .hero-text h1 { font-size: 2.5rem; line-height: 1.2; }
    .hero-text .subtitle { font-size: 1.1rem; }
    .hero-text .description { font-size: 1rem; }
    .hero-photo { width: 100vmin; height: 100vmin; max-width: 511px; max-height: 511px; margin: 0 auto; }
    .hero-img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }

    /* Sections */
    .section { padding: 35px 0; }
    .section-header h2 { font-size: 2rem; }
    .section-header { margin-bottom: 2rem; }

    /* Grids 1 columna */
    .cards-grid, .services-grid, .testimonials-grid, .contact-grid, .blog-grid {
        grid-template-columns: 1fr; gap: 1.5rem; margin-top: 2rem;
    }

    /* PNIE */
    .pnie-columns { grid-template-columns: 1fr; gap: 2rem; padding: 1.5rem; }
    .pnie-header h2 { font-size: 2rem; }
    .pnie-explanation { padding: 2rem; }
    .process-steps { grid-template-columns: 1fr; gap: 1.5rem; }

    /* Curriculum */
    .experience-item { grid-template-columns: 1fr; gap: 1rem; text-align: left; }
    .experience-period { text-align: left; padding-right: 0; }
    .experience-period::after { display: none; }
    .education-timeline::before { left: 20px; }
    .education-item { grid-template-columns: 1fr; gap: 1rem; padding-left: 40px; }
    .education-item::before { left: 19px; }
    .education-item.current::before { left: 17px; }
    .education-year { text-align: left; padding-right: 0; }
    .complementary-grid { grid-template-columns: 1fr; }

    /* Footer */
    .footer-content { grid-template-columns: 1fr; gap: 1.5rem; text-align: center; }
    .footer-bottom { flex-direction: column; text-align: center; gap: 1rem; }

    /* Container */
    .container { padding: 0 15px; }

    /* Cards */
    .card { padding: 1.5rem; }
    .card-image { height: 180px; margin-bottom: 1rem; }

    /* Botones */
    .btn { text-align: center; justify-content: center; }

    /* Language selector */
    .lang-menu { right: auto; left: 0; }

    /* BLOG CARDS – layout columna + arreglos iOS */
    .blog-card { display: flex; flex-direction: column; }
    .blog-card a { display: flex !important; flex-direction: column !important; height: 100%; text-decoration: none; align-items: stretch; }
    .blog-card-img { display: block; width: 100%; height: 200px; object-fit: cover; flex-shrink: 0; }
    .blog-card-content { flex: 1; display: flex; flex-direction: column; padding: 1.5rem; }
    .blog-card h3 { font-size: 1.2rem; line-height: 1.4; margin-bottom: 0.75rem; }
    .blog-card p { font-size: 0.95rem; line-height: 1.6; margin-bottom: 0.75rem; flex-grow: 1; }
    .blog-meta { font-size: 0.85rem; margin-top: auto; padding-top: 0.5rem; }
    .blog-card a > * { min-width: 0; }
    .blog-card h3, .blog-card p { overflow-wrap: anywhere; }

    /* ====== CONTENIDO CONSOLIDADO (antes estaba en bloques 768 separados) ====== */

    /* MEJORAS RESPONSIVAS AVANZADAS – Hero Image */
    .hero-photo { width: 100%; max-width: 450px; height: auto; aspect-ratio: 1 / 1; margin: 0 auto; }
    .hero-img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }

    /* Mejoras tipográficas móvil */
    html { font-size: 15px; }
    .hero-text h1 { font-size: 2.2rem; line-height: 1.15; margin-bottom: 1rem; }
    .hero-text .subtitle { font-size: 1.15rem; margin-bottom: 0.75rem; }
    .hero-text .description { font-size: 1.05rem; line-height: 1.6; }
    .section-header h2 { font-size: 2.2rem; line-height: 1.2; }
    .section-header p { font-size: 1.05rem; }
    .card h3, .service-text h3 { font-size: 1.25rem; line-height: 1.35; }
    .card p, .service-text p { font-size: 1rem; line-height: 1.65; }

    /* Mejora de botones para touch */
    .btn { padding: 14px 24px; font-size: 1rem; min-height: 48px; width: 100%; justify-content: center; }
    .btn-wa { font-size: 0.95rem; font-weight: 600; }
    .hero-actions { width: 100%; gap: 1rem; }
    .hero-actions .btn { width: 100%; }
    .header-actions .btn-wa { padding: 10px 16px; font-size: 0.9rem; min-height: 40px; width: auto; }
    @media (min-width: 481px) and (max-width: 768px) {
      .header-actions .btn-wa span { display: inline; }
    }
    .btn { padding: 12px 20px; font-size: 0.95rem; min-height: 44px; } /* ajuste small */

    /* (4) SISTEMA DE ESPACIADO CONSISTENTE (MÓVIL) */
    .section { padding: 48px 0; }
    .section-header { margin-bottom: 2.5rem; padding: 0 10px; }
    .container { padding: 0 20px; }
    .card, .service, .testimonial, .contact-card { padding: 1.75rem; margin-bottom: 0; }
    .card-image, .service-img { height: 220px; margin-bottom: 1.25rem; }
    .blog-card-img { height: 200px; }
    .blog-card-content { padding: 1.75rem; }

    /* (5) PNIE MEJOR LEGIBLE EN MÓVIL */
    .pnie-section { padding: 48px 0; }
    .pnie-header h2 { font-size: 2rem; line-height: 1.25; margin-bottom: 1rem; }
    .pnie-header p { font-size: 1.05rem; line-height: 1.7; }
    .pnie-explanation { padding: 1.75rem; margin: 2rem 0; }
    .pnie-explanation h3 { font-size: 1.35rem; margin-bottom: 1.25rem; }
    .pnie-explanation p { font-size: 1rem; line-height: 1.7; margin-bottom: 1.25rem; }
    .pnie-columns { grid-template-columns: 1fr !important; gap: 2rem; padding: 1.75rem; }
    .condition-group, .benefit-group { padding: 1.5rem; }
    .condition-group h4, .benefit-group h4 { font-size: 1.15rem; margin-bottom: 1rem; }
    .condition-group li, .benefit-group li { font-size: 0.95rem; line-height: 1.6; margin-bottom: 0.65rem; }
    .process-steps { gap: 1.75rem; }
    .step { padding: 1.75rem; }
    .step-content h4 { font-size: 1.15rem; }
    .step-content p { font-size: 0.95rem; line-height: 1.65; }

    /* (6) MENÚ MÓVIL – OVERRIDE SIN BORRAR EL ANTERIOR */
    .menu { display: block; font-size: 1.8rem; }
    .nav {
      position: fixed; top: 0; left: -300px; width: 300px; height: 100vh;
      background: var(--white); flex-direction: column; padding: 100px 0 20px;
      box-shadow: var(--shadow-xl); gap: 0; border-top: none;
      transition: left 0.3s cubic-bezier(0.4,0,0.2,1); z-index: 999; overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    .nav.active { left: 0; }
    .nav a {
      padding: 18px 24px; width: 100%; text-align: left; border-bottom: 1px solid var(--gray-100);
      font-size: 1.05rem; display: flex; align-items: center; min-height: 56px; transition: all 0.2s ease;
    }
    .nav a:hover, .nav a:active { background: var(--gray-50); padding-left: 28px; }
    .nav a.active { background: var(--primary); color: var(--white); font-weight: 600; }
    .nav a:last-child { border-bottom: none; }
    .nav a::after { display: none; }
    .nav-overlay {
      position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(0,0,0,0.6); z-index: 998; opacity: 0; visibility: hidden; transition: all 0.3s ease; backdrop-filter: blur(2px);
    }
    .nav-overlay.active { opacity: 1; visibility: visible; }

    /* (7) CURRÍCULUM – TIMELINE MÓVIL */
    .curriculum-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .experience-badge { align-self: flex-start; }
    .experience-item { grid-template-columns: 1fr; gap: 1rem; padding: 1.75rem; border-radius: var(--radius); }
    .experience-period {
      text-align: left; padding: 0 0 0.5rem 0; border-bottom: 2px solid var(--primary); margin-bottom: 0.75rem;
    }
    .experience-period::after { display: none; }
    .experience-content h4 { font-size: 1.2rem; margin-bottom: 1.25rem; }
    .place { margin-bottom: 1.25rem; }
    .place:last-child { margin-bottom: 0; }
    .education-timeline { padding-left: 0; }
    .education-timeline::before { left: 15px; width: 3px; background: var(--primary); opacity: 0.3; }
    .education-item { grid-template-columns: 1fr; padding-left: 45px; position: relative; }
    .education-item::before {
      left: 9px; width: 10px; height: 10px; background: var(--white);
      border: 3px solid var(--primary); border-radius: 50%;
    }
    .education-item.current::before {
      background: var(--accent); border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(16,185,129,0.2); animation: pulse 2s infinite;
    }
    .education-year { text-align: left; font-size: 0.9rem; font-weight: 700; color: var(--primary); margin-bottom: 0.5rem; }
    .complementary-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .complementary-item { padding: 1.75rem; }

    /* (8) FOOTER – ORGANIZACIÓN MÓVIL */
    .site-footer { padding: 2.5rem 0 1.5rem; }
    .footer-content { gap: 2rem; text-align: left; }
    .footer-main h3 { font-size: 1.35rem; }
    .footer-contact h4, .footer-locations h4 { font-size: 1.1rem; margin-top: 0.5rem; }
    .footer-bottom { padding-top: 1.5rem; flex-direction: column; text-align: center; font-size: 0.9rem; }
    .footer-links { flex-wrap: wrap; justify-content: center; gap: 1rem; }

    /* (10) ACCESIBILIDAD TÁCTIL */
    a:not(.btn), button:not(.btn) {
      min-height: 44px; display: inline-flex; align-items: center;
    }
    .map, .footer-links a, .lang-option { padding: 8px 4px; margin: -8px -4px; }
    .nav a + a { margin-top: 2px; }
    .lang-option + .lang-option { border-top: 1px solid var(--gray-100); }
    .btn:active, .nav a:active, .lang-option:active { transform: scale(0.98); opacity: 0.9; }
    input, textarea, select { font-size: 16px !important; }
}

/* ==========================================================================
   Small Mobile (<=480px)
   ========================================================================== */

@media (max-width: 480px) {
    .hero-photo { width: 100vmin; height: 100vmin; max-width: 511px; max-height: 511px; margin: 0 auto; }
    .hero-text h1 { font-size: 2rem; }
    .section-header h2 { font-size: 1.75rem; }
    .btn { padding: 10px 20px; font-size: 0.9rem; }
    .btn-large { font-size: 1rem; padding: 14px 28px; }
    .hero { padding: 70px 0 40px; }
    .section { padding: 32px 0; }
    .card, .service-text, .testimonial { padding: 1.25rem; }
    .pnie-header h2 { font-size: 1.75rem; }
    .hero-img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
    .brand { font-size: 1.2rem; }
    .header-actions { gap: 0.25rem; }
    .btn-wa { padding: 8px 12px; font-size: 0.8rem; }

    /* Blog cards ajustes small */
    .blog-card-img { height: 180px; }
    .blog-card-content { padding: 1.25rem; }
    .blog-card h3 { font-size: 1.1rem; }
    .blog-card p { font-size: 0.9rem; }
}

/* ==========================================================================
   Large Screens (>=1200px)
   ========================================================================== */

@media (min-width: 1200px) {
    .container { max-width: 1400px; }
    .hero-text h1 { font-size: 4rem; }
    .section-header h2 { font-size: 3rem; }
    .hero-content { gap: 5rem; }
}

/* ==========================================================================
   Tablets (769–1024px) y landscape
   ========================================================================== */

@media (min-width: 769px) and (max-width: 1024px) {
  .hero-content { grid-template-columns: 1.2fr 1fr; gap: 3rem; }
  .hero-text h1 { font-size: 3rem; }
  .hero-photo { width: 380px; height: 380px; }

  .cards-grid, .testimonials-grid, .contact-grid { grid-template-columns: repeat(2,1fr); gap: 2rem; }
  .services-grid { grid-template-columns: repeat(2,1fr); }
  .blog-grid { grid-template-columns: repeat(2,1fr); }

  .pnie-columns { grid-template-columns: 1fr; gap: 2.5rem; }
  .process-steps { grid-template-columns: repeat(2,1fr); }

  .experience-item { grid-template-columns: 180px 1fr; }
  .education-item { grid-template-columns: 120px 1fr; }
  .complementary-grid { grid-template-columns: repeat(2,1fr); }
}

@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 60px 0; }
  .section { padding: 50px 0; }
}

/* ==========================================================================
   Accessibility (motion/contrast/focus)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
        --border: #666;
    }
    .card, .service, .testimonial, .contact-card { border: 2px solid var(--border); }
}
/* ==== END CSS ==== */