/* ================= VARIABLES ================= */
:root {
    --primary: #041222;
    --primary-light: #0A2540;
    --accent: #00D4FF; /* Cyan para detalles mínimos */
    --accent-hover: #00b3d8;
    --text-main: #1E293B; /* Más oscuro para legibilidad premium */
    --text-muted: #475569;
    --bg-light: #F8FAFC;
    --bg-white: #FFFFFF;
    --bg-dark: #0F172A;
    --wa-color: #25D366;
    
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
    
    --radius-lg: 30px;
    --radius-md: 16px;
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-sm: 0 10px 30px rgba(0,0,0,0.05);
    --shadow-md: 0 20px 40px rgba(10,37,64,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--text-main); background: var(--bg-light); line-height: 1.6; overflow-x: hidden; }

/* ================= TIPOGRAFÍA Y UTILIDADES ================= */
.container { max-width: 1300px; margin: 0 auto; padding: 0 5%; }
.section-padding { padding: 120px 0; }
.text-center { text-align: center; }
.bg-light { background: var(--bg-light); }
.bg-white { background: var(--bg-white); }
.bg-dark { background: var(--bg-dark); }
.w-100 { width: 100%; }

.heading-xl { font-family: var(--font-heading); font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700; color: var(--primary); margin-bottom: 20px; line-height: 1.1; }
.heading-xl span { color: var(--primary-light); border-bottom: 3px solid var(--accent); } 
.subheading { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; }
.section-header { margin-bottom: 60px; }

/* Botones */
.btn-primary, .btn-secondary, .btn-outline {
    display: inline-flex; justify-content: center; align-items: center; gap: 10px;
    padding: 16px 36px; border-radius: 50px; font-weight: 700; text-decoration: none;
    transition: var(--transition); border: none; cursor: pointer; font-size: 0.95rem;
    text-transform: uppercase; letter-spacing: 1px;
}
.btn-primary { background: var(--primary); color: #FFFFFF; box-shadow: 0 10px 20px rgba(4,18,34,0.2); }
.btn-primary:hover { transform: translateY(-3px); background: var(--primary-light); box-shadow: 0 15px 30px rgba(4,18,34,0.3); }

.btn-secondary { background: rgba(255,255,255,0.15); color: var(--bg-white); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.3); }
.btn-secondary:hover { background: var(--bg-white); color: var(--primary); }

.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--bg-white); }
.btn-sm { padding: 10px 24px; font-size: 0.85rem; }

/* Botón de Retorno Especializado */
.btn-back {
    display: inline-flex; align-items: center; gap: 10px; color: var(--primary);
    text-decoration: none; font-weight: 700; font-size: 0.9rem; text-transform: uppercase;
    letter-spacing: 1px; padding: 12px 20px; border-radius: var(--radius-md);
    background: var(--bg-white); box-shadow: var(--shadow-sm); transition: var(--transition);
}
.btn-back:hover { background: var(--primary); color: var(--bg-white); transform: translateX(-5px); }

/* ================= NAVEGACIÓN ================= */
nav {
    position: fixed; top: 0; left: 0; width: 100%; padding: 20px 5%;
    display: flex; justify-content: space-between; align-items: center;
    background: transparent; z-index: 1000; transition: var(--transition);
}
nav.scrolled { background: rgba(255,255,255,0.98); backdrop-filter: blur(20px); box-shadow: var(--shadow-sm); padding: 12px 5%; }

.nav-brand { display: flex; align-items: center; gap: 15px; text-decoration: none; }
.nav-logo { height: 50px; transition: var(--transition); }

.brand-text { display: flex; flex-direction: column; }
.brand-text .title { font-family: var(--font-heading); font-weight: 700; font-size: 1.3rem; color: var(--bg-white); line-height: 1; transition: var(--transition); }
nav.scrolled .brand-text .title { color: var(--primary); }
.brand-text .subtitle { font-size: 0.75rem; color: rgba(255,255,255,0.85); letter-spacing: 2px; text-transform: uppercase; font-weight: 700; }
nav.scrolled .brand-text .subtitle { color: var(--text-muted); }

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--bg-white); text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: var(--transition); }
nav.scrolled .nav-links a { color: var(--primary); }
.nav-links a:hover { color: var(--accent); }
.btn-nav { background: var(--primary) !important; color: #FFFFFF !important; padding: 12px 28px; border-radius: 50px; font-weight: 700; }

.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; color: var(--bg-white); cursor: pointer; }
nav.scrolled .mobile-menu-btn { color: var(--primary); }

/* ================= HERO & VIDEO BACKGROUND ================= */
.hero { 
    position: relative; 
    min-height: 100vh; 
    display: flex; 
    align-items: center; /* Centrado vertical para que no flote al fondo si no es necesario */
    padding: 0 5%; 
    overflow: hidden; 
    gap: 30px;
}
.video-bg-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; }
.video-bg { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8); }
.video-overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: linear-gradient(90deg, rgba(4,18,34,0.92) 0%, rgba(4,18,34,0.6) 50%, rgba(4,18,34,0.3) 100%); 
    z-index: -1; 
}

.hero-content { 
    position: relative; 
    flex: 1;
    max-width: 650px; 
    z-index: 2; 
}
.hero-content h1 { color: var(--bg-white); text-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.hero-content p { color: rgba(255,255,255,0.9); font-size: 1.3rem; margin-bottom: 40px; }

/* FIX FINAL: ENMARCADO DE IMAGEN DEL DOCTOR */
.hero-image {
    flex: 0 0 40%; /* Ocupa exactamente el 40% del ancho, sin empujar el texto */
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1;
    height: 100vh;
}

.hero-image img {
    max-height: 90vh; /* Altura máxima para no romper el layout */
    width: 100%;
    max-width: 450px; /* Evita que la imagen sea gigante en pantallas grandes */
    object-fit: contain;
    filter: drop-shadow(0 20px 50px rgba(0,0,0,0.5));
    display: block;
    margin-top: auto;
}

.badge-premium { 
    display: inline-block; padding: 8px 16px; background: rgba(255, 255, 255, 0.1); 
    border: 1px solid var(--accent); color: #FFFFFF; border-radius: 50px; 
    font-size: 0.8rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 20px; 
}

.hero-stats-floating {
    position: absolute; right: 2%; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 20px; z-index: 5;
}
.stat-item {
    background: rgba(255, 255, 255, 0.08); backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px; border-radius: var(--radius-md); display: flex; align-items: center; gap: 15px; color: white; transition: var(--transition);
}
.stat-item:hover { transform: translateX(-10px); border-color: var(--accent); }
.stat-item i { color: var(--accent); font-size: 1.3rem; }
.stat-item strong { display: block; font-size: 1.2rem; font-family: var(--font-heading); line-height: 1; }

.scroll-indicator { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 5; }
.mouse { width: 26px; height: 42px; border: 2px solid rgba(255,255,255,0.3); border-radius: 20px; display: flex; justify-content: center; }
.wheel { width: 4px; height: 8px; background: var(--accent); border-radius: 2px; margin-top: 8px; animation: scrollWheel 2s infinite; }
@keyframes scrollWheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(15px); } }

/* ================= RESEÑA DOCTOR (NUEVO BLOQUE AÑADIDO) ================= */
.dr-section { 
    padding: 100px 5%; 
    background: var(--bg-white); 
}

.dr-grid { 
    display: grid; 
    grid-template-columns: 1fr 1.2fr; 
    gap: 60px; 
    align-items: center; 
    max-width: 1200px; 
    margin: 0 auto; 
}

/* Control estricto de la foto del doctor */
.dr-image { 
    text-align: center; 
    position: relative; 
}

.dr-image img { 
    width: 100%; 
    max-width: 420px; /* <--- AQUÍ SE EVITA QUE SEA GIGANTE */
    height: auto; 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-md); 
    object-fit: cover; 
    border: 8px solid var(--bg-light); /* Borde estético */
}

/* Diseño hermoso para la reseña y texto */
.badge-brasil {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: var(--accent);
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.dr-content h2 { 
    font-family: var(--font-heading); 
    font-size: clamp(2rem, 4vw, 3.5rem); 
    color: var(--primary); 
    margin-bottom: 10px; 
    line-height: 1.1; 
}

.dr-content h3 { 
    font-size: 1.2rem; 
    color: var(--text-muted); 
    margin-bottom: 25px; 
    font-weight: 500; 
}

.dr-content p { 
    font-size: 1.1rem; 
    color: var(--text-muted); 
    line-height: 1.8; 
    margin-bottom: 30px; 
}

.dr-content ul { 
    list-style: none; 
    margin-bottom: 35px; 
}

.dr-content li { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 15px; 
    color: var(--primary); 
    font-weight: 600; 
    font-size: 1.05rem;
}

.dr-content li i { 
    color: var(--accent); 
    font-size: 1.2rem; 
    background: var(--bg-light);
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

/* ================= ESPECIALIDADES (PÁGINA INTERNA) ================= */
.section-title { text-align: center; margin-bottom: 50px; padding: 0 5%; }
.section-title h2 { font-family: var(--font-heading); font-size: clamp(2rem, 4vw, 3rem); color: var(--primary); font-weight: 700; margin-bottom: 15px; }
.divider { width: 80px; height: 4px; background: var(--accent); margin: 0 auto 20px; border-radius: 2px; }

.specialty-grid { 
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px; padding: 0 5%; margin-bottom: 80px;
}
.specialty-card {
    background: var(--bg-white); padding: 40px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid rgba(4,18,34,0.05);
}
.specialty-card:hover { transform: translateY(-10px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.specialty-card i { font-size: 2.5rem; color: var(--accent); margin-bottom: 20px; display: block; }
.specialty-card h3 { font-family: var(--font-heading); margin-bottom: 15px; color: var(--primary); }
.specialty-card ul { list-style: none; }
.specialty-card li { margin-bottom: 10px; font-size: 0.95rem; color: var(--text-muted); display: flex; align-items: center; gap: 10px; }
.specialty-card li::before { content: "→"; color: var(--accent); font-weight: bold; }

/* Especialidades en Index (Cards Simples) */
.spec-card { background: var(--bg-white); padding: 45px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid rgba(4,18,34,0.05); transition: var(--transition); }
.spec-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.spec-icon { width: 65px; height: 65px; background: var(--bg-light); border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--primary); margin-bottom: 25px; transition: var(--transition); }
.spec-card:hover .spec-icon { background: var(--primary); color: #FFF; transform: scale(1.1) rotate(-5deg); }
.spec-link { color: var(--primary); font-weight: 800; text-decoration: none; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; transition: var(--transition); text-transform: uppercase; letter-spacing: 1px; }

/* ================= GALERÍA DE SOFTWARE (TECNOLOGÍA) ================= */
.software-preview {
    position: relative; border-radius: var(--radius-md); overflow: hidden;
    background: var(--primary); cursor: pointer; box-shadow: var(--shadow-md);
    border: 2px solid transparent; transition: var(--transition);
}
.software-preview:hover { transform: scale(1.02); border-color: var(--accent); }
.software-preview img { width: 100%; height: 280px; object-fit: cover; opacity: 0.9; transition: var(--transition); display: block; }
.software-preview:hover img { opacity: 1; }
.software-info { padding: 20px; background: var(--bg-white); border-top: 1px solid rgba(0,0,0,0.05); }
.software-info h4 { font-family: var(--font-heading); color: var(--primary); margin-bottom: 5px; }

/* ================= GALERÍA MASONRY & LIGHTBOX ================= */
.gallery-masonry { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.gallery-item { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4/5; cursor: pointer; background: var(--primary); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.gallery-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(4,18,34,0.95) 0%, transparent 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 30px; opacity: 0; transition: var(--transition); }
.gallery-item:hover .gallery-overlay { opacity: 1; }

.lightbox-modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(4, 18, 34, 0.98); backdrop-filter: blur(15px); }
.lightbox-modal.active { display: flex; justify-content: center; align-items: center; }
.lightbox-content { max-width: 90%; max-height: 85vh; border-radius: var(--radius-md); box-shadow: 0 25px 50px rgba(0,0,0,0.5); animation: zoomIn 0.3s ease; object-fit: contain; border: 2px solid rgba(255,255,255,0.1); }
.lightbox-close { position: absolute; top: 30px; right: 40px; color: #FFF; font-size: 40px; cursor: pointer; transition: var(--transition); }
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ================= SEDES ================= */
.locations-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.location-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-lg); padding: 40px; backdrop-filter: blur(10px); transition: var(--transition); color: #FFF; }
.location-card:hover { border-color: var(--accent); background: rgba(255,255,255,0.06); }
.location-card p, .location-card h3 { opacity: 1; color: #FFF; }

.loc-header { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; }

/* TAMAÑO DE ICONO EN SEDES */
.loc-icon { 
    width: 60px !important; 
    height: 60px !important; 
    background: #FFF; 
    border-radius: 50%; 
    padding: 0; 
    object-fit: cover; 
    flex-shrink: 0;
    border: 2px solid var(--accent);
}

.map-wrapper { width: 100%; height: 260px; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 25px; border: 1px solid rgba(255,255,255,0.1); }
.map-wrapper iframe { width: 100%; height: 100%; filter: grayscale(1) invert(0.9) contrast(1.2); opacity: 0.6; transition: var(--transition); border: none; }
.location-card:hover .map-wrapper iframe { opacity: 1; filter: none; }

/* ================= COOKIE BANNER ================= */
.cookie-banner { position: fixed; bottom: 30px; left: 30px; max-width: 450px; background: #FFF; border-radius: var(--radius-md); padding: 25px; box-shadow: 0 20px 50px rgba(0,0,0,0.2); border: 1px solid rgba(0,0,0,0.05); z-index: 9999; transform: translateY(150%); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; gap: 20px; }
.cookie-banner.show { transform: translateY(0); }
.cookie-banner.hidden { display: none; }

/* ================= FLOATERS & FOOTER ================= */
.wa-float { position: fixed; bottom: 30px; right: 30px; width: 65px; height: 65px; background: var(--wa-color); color: #FFF; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; z-index: 1000; box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4); text-decoration: none; transition: var(--transition); }
.wa-float:hover { transform: scale(1.1) translateY(-5px); }
.wa-tooltip { position: absolute; right: 80px; background: #FFF; color: var(--primary); padding: 10px 18px; border-radius: 12px; font-size: 0.9rem; font-weight: 800; opacity: 0; pointer-events: none; transition: var(--transition); box-shadow: var(--shadow-md); white-space: nowrap; }
.wa-float:hover .wa-tooltip { opacity: 1; transform: translateX(-10px); }

.footer { background: var(--primary); padding: 100px 0 30px; color: rgba(255,255,255,0.6); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px; margin-bottom: 60px; }
.footer-logo { height: 65px; filter: brightness(0) invert(1); margin-bottom: 25px; opacity: 0.95; }
.social-links { display: flex; gap: 15px; margin-top: 25px; }
.social-links a { width: 45px; height: 45px; border-radius: 50%; background: rgba(255,255,255,0.07); color: #FFF; display: flex; align-items: center; justify-content: center; transition: var(--transition); border: 1px solid rgba(255,255,255,0.1); }
.social-links a:hover { background: var(--accent); color: var(--primary); transform: translateY(-5px); }
.footer-links a { color: rgba(255,255,255,0.7); text-decoration: none; transition: var(--transition); display: block; margin-bottom: 12px; }
.footer-links a:hover { color: var(--accent); padding-left: 8px; }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.9rem; }
.powered-by strong { color: var(--accent); letter-spacing: 1.5px; }

/* ================= RESPONSIVE ================= */
@media (max-width: 992px) {
    .hero { text-align: center; padding-top: 120px; flex-direction: column; align-items: center; }
    .hero-content { max-width: 100%; margin-bottom: 5vh; flex: none; }
    .hero-image { flex: none; height: auto; }
    .hero-image img { max-height: 50vh; margin-top: 20px; max-width: 300px; }
    .hero-actions { justify-content: center; }
    .hero-stats-floating { position: relative; right: 0; top: 0; transform: none; flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: 40px; }
    
    /* Responsive para la Reseña del Doctor */
    .dr-grid { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .dr-content ul { display: inline-block; text-align: left; }
    
    .nav-links { position: fixed; top: 0; right: -100%; width: 80%; height: 100vh; background: #FFF; flex-direction: column; justify-content: center; box-shadow: -15px 0 40px rgba(0,0,0,0.15); transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1); padding: 50px; }
    .nav-links.active { right: 0; }
    .nav-links a { color: var(--primary); font-size: 1.3rem; font-weight: 700; }
    .mobile-menu-btn { display: block; z-index: 1001; }
    .mobile-menu-btn.active { color: var(--primary); }
    .locations-grid, .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) { .hero-stats-floating { display: none; } }