/* =====================================================
   MODERN CLINIC WEBSITE STYLES
   Version: 2.0
   Author: Clinica Chinita
   ===================================================== */


/* ===== CSS VARIABLES ===== */

:root {
    --primary-color: #00a6ce;
    --secondary-color: #ff6b6b;
    --accent-color: #4a90e2;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --text-color: #333333;
    --text-light: #6c757d;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, #00a6ce 0%, #00a6ce 100%);
    --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ===== GLOBAL STYLES ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #ffffff;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* ===== TYPOGRAPHY ===== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
}


/* ===== PRELOADER ===== */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.loader {
    position: relative;
    width: 80px;
    height: 80px;
}

.loader-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-pulse::before,
.loader-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-pulse::before {
    animation-delay: -0.5s;
}

.loader-pulse::after {
    animation-delay: -1s;
}

@keyframes pulse {
    0% {
        width: 40px;
        height: 40px;
        opacity: 1;
    }
    100% {
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}


/* ===== TOP BAR ===== */

.top-bar {
    background: #4169E1;
    /* Azul Rey */
    color: white;
    padding: 10px 0;
    font-size: 14px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar .social-links {
    display: flex;
    gap: 10px;
}

.top-bar .social-links a {
    color: white;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.top-bar .social-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}


/* ===== NAVIGATION ===== */

.navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.navbar-brand img {
    height: 50px;
    width: auto;
}

.navbar-menu ul {
    display: flex;
    list-style: none;
    gap: 35px;
    margin: 0;
}

.navbar-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
    padding: 5px 0;
}

.navbar-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--primary-color);
}

.navbar-menu a:hover::after,
.navbar-menu a.active::after {
    width: 100%;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.navbar-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    margin: 5px 0;
    transition: var(--transition);
}


/* ===== BUTTONS ===== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 161, 156, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-outline-white {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline-white:hover {
    background: white;
    color: var(--primary-color);
}

.btn-white {
    background: white;
    color: var(--primary-color);
}

.btn-white:hover {
    background: var(--light-color);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 18px;
}


/* ===== HERO SECTION ===== */

.hero {
    position: relative;
    overflow: hidden;
    padding: 20px 0;
    /* Añadimos padding para reducir espacio vertical */
}

.hero-slider {
    height: 50vh;
    /* Reducido de 70vh a 50vh */
    min-height: 350px;
    /* Reducido de 450px a 350px */
    max-height: 500px;
    /* Añadimos altura máxima para evitar que sea demasiado grande en pantallas grandes */
}

.hero-slide {
    height: 50vh;
    /* Reducido de 70vh a 50vh */
    min-height: 350px;
    /* Reducido de 450px a 350px */
    max-height: 500px;
    /* Añadimos altura máxima */
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 550px;
    /* Reducido de 650px */
    padding: 0 15px;
    /* Añadimos padding para mejorar la visualización en móviles */
}

.hero-subtitle {
    display: inline-block;
    padding: 6px 16px;
    /* Reducido de 8px 20px */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    margin-bottom: 15px;
    /* Reducido de 20px */
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    /* Añadido tamaño de fuente más pequeño */
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    /* Reducido de clamp(2.5rem, 6vw, 4rem) */
    font-weight: 800;
    margin-bottom: 15px;
    /* Reducido de 20px */
    line-height: 1.1;
    color: white;
}

.hero-title span {
    color: var(--secondary-color);
    position: relative;
}

.hero-description {
    font-size: 1.1rem;
    /* Reducido de 1.25rem */
    margin-bottom: 25px;
    /* Reducido de 30px */
    opacity: 0.95;
    line-height: 1.4;
    /* Añadido para mejorar legibilidad */
}

.hero-buttons {
    display: flex;
    gap: 15px;
    /* Reducido de 20px */
    flex-wrap: wrap;
}


/* Ajustes para botones más pequeños */

.hero-buttons .btn {
    padding: 10px 20px;
    /* Reducido padding de botones */
    font-size: 0.9rem;
    /* Reducido tamaño de fuente */
}


/* Ajustes para controles del slider */

.hero .swiper-button-next,
.hero .swiper-button-prev {
    width: 40px;
    height: 40px;
}

.hero .swiper-pagination {
    bottom: 15px;
    /* Reducido espacio inferior */
}


/* Ajustes adicionales para reducir el espacio vertical */

.hero {
    margin-bottom: 30px;
    /* Reducido espacio después del hero */
}


/* Ajustes para pantallas pequeñas */

@media (max-width: 768px) {
    .hero-slider {
        height: 40vh;
        min-height: 300px;
    }
    .hero-slide {
        height: 40vh;
        min-height: 300px;
    }
    .hero-content {
        max-width: 90%;
    }
    .hero-title {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
    }
    .hero-description {
        font-size: 1rem;
    }
}


/* Swiper Customization */

.swiper-pagination-bullet {
    background: white;
    opacity: 0.5;
    width: 12px;
    height: 12px;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--secondary-color);
}

.swiper-button-next,
.swiper-button-prev {
    color: white;
    background: rgba(0, 0, 0, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 20px;
}


/* ===== QUICK INFO CARDS ===== */

.quick-info {
    padding: 60px 0;
    margin-top: -80px;
    position: relative;
    z-index: 10;
}

.quick-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.info-card {
    background: white;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

.info-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.info-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.info-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.info-card p {
    margin: 0;
    color: var(--text-light);
}


/* ===== SECTIONS ===== */

section {
    padding: 80px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-subtitle {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(0, 161, 156, 0.1);
    color: var(--primary-color);
    border-radius: 30px;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--dark-color);
}

.section-title span {
    color: var(--primary-color);
}


/* ===== ABOUT SECTION ===== */

.about {
    background: var(--light-color);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.experience-badge {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: var(--gradient-primary);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.experience-badge .years {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.experience-badge .text {
    display: block;
    font-size: 14px;
    margin-top: 5px;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.about-features .feature {
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-features i {
    color: var(--primary-color);
    font-size: 20px;
}

.about-stats {
    display: flex;
    gap: 40px;
    margin-top: 30px;
}

.about-stats .stat {
    text-align: center;
}

.about-stats .number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.about-stats .label {
    display: block;
    color: var(--text-light);
    font-size: 14px;
}


/* ===== SERVICES SECTION ===== */

.services {
    background: white;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 161, 156, 0.05), rgba(0, 161, 156, 0.1));
    transition: width 0.5s ease;
    z-index: 0;
}

.service-card:hover::before {
    width: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.service-icon {
    position: relative;
    z-index: 1;
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-card h3 {
    position: relative;
    z-index: 1;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.service-card p {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
    color: var(--text-light);
}

.service-link {
    position: relative;
    z-index: 1;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.service-link:hover {
    gap: 12px;
}


/* ===== SPECIALTIES SECTION ===== */

.specialties {
    background: var(--light-color);
}

.specialties-slider .swiper-slide {
    height: auto;
}

.specialty-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.specialty-card:hover {
    box-shadow: var(--shadow-md);
}

.specialty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, rgba(0, 161, 156, 0.1), rgba(0, 161, 156, 0.2));
    border-radius: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--primary-color);
    transform: rotate(45deg);
    transition: var(--transition);
}

.specialty-icon i {
    transform: rotate(-45deg);
}

.specialty-card:hover .specialty-icon {
    transform: rotate(0);
    border-radius: 50%;
}

.specialty-card h4 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.specialty-card p {
    margin: 0;
    color: var(--text-light);
}


/* ===== CTA SECTION ===== */

.cta {
    background: var(--gradient-primary);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.cta-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.cta h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 15px;
    color: white;
}

.cta p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.95;
    color: white;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}


/* ===== FAQ SECTION ===== */

.faq {
    background: white;
}

.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.accordion-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.accordion-item.active {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.accordion-header {
    padding: 25px 30px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.accordion-header:hover {
    background: var(--light-color);
}

.accordion-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.accordion-header i {
    color: var(--primary-color);
    transition: var(--transition);
}

.accordion-item.active .accordion-header i {
    transform: rotate(45deg);
}

.accordion-body {
    padding: 0 30px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item.active .accordion-body {
    padding: 0 30px 25px;
    max-height: 500px;
}


/* ===== PARTNERS SECTION ===== */

.partners {
    background: var(--light-color);
}

.partners-slider .swiper-wrapper {
    align-items: center;
}

.partner-item {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
}

.partner-item img {
    max-width: 150px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.7;
    transition: var(--transition);
    filter: grayscale(0);
}

.partner-item:hover img {
    opacity: 1;
    transform: scale(1.1);
}


/* ===== CONTACT SECTION ===== */

.contact {
    background: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: start;
}

.contact-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.contact-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.contact-text h4 {
    margin-bottom: 5px;
    color: var(--dark-color);
}

.contact-text p {
    margin: 0;
    color: var(--text-light);
}


/* ===== CONTACT FORM ===== */

.contact-form {
    background: var(--light-color);
    padding: 40px;
    border-radius: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    background: white;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 161, 156, 0.1);
}

.form-group textarea {
    resize: vertical;
}


/* ===== MAP SECTION ===== */

.map {
    height: 400px;
    width: 100%;
}

.map iframe {
    width: 100%;
    height: 100%;
    border: none;
}


/* ===== FOOTER ===== */

.footer {
    background: var(--dark-color);
    color: rgba(255, 255, 255, 0.8);
}

.footer-top {
    padding: 60px 0 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 40px;
}

.footer-widget h3 {
    color: white;
    margin-bottom: 25px;
    font-size: 1.2rem;
}

.footer-logo {
    height: 50px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.footer-widget p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget ul li {
    margin-bottom: 12px;
}

.footer-widget ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-widget ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer .social-links {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.footer .social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.footer .social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.hours li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.hours li span:first-child {
    color: rgba(255, 255, 255, 0.5);
}

.emergency {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.emergency i {
    font-size: 30px;
    color: var(--secondary-color);
}

.emergency span {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.emergency strong {
    display: block;
    font-size: 18px;
    color: white;
    margin-top: 5px;
}

.footer-bottom {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
}


/* ===== BACK TO TOP ===== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}


/* ===== ANIMATIONS ===== */

[data-aos] {
    transition-duration: 800ms !important;
}


/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    .contact-content {
        grid-template-columns: 1fr;
    }
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .navbar-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: var(--shadow-md);
    }
    .navbar-menu.active {
        display: block;
    }
    .navbar-menu ul {
        flex-direction: column;
        padding: 20px;
        gap: 10px;
    }
    .navbar-toggle {
        display: block;
    }
    .top-bar-content {
        flex-direction: column;
        gap: 10px;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
    .quick-info-grid {
        grid-template-columns: 1fr;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer .social-links {
        justify-content: center;
    }
    .about-stats {
        justify-content: space-around;
    }
}

@media (max-width: 480px) {
    section {
        padding: 60px 0;
    }
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    .btn-lg {
        padding: 12px 24px;
        font-size: 16px;
    }
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.75rem;
    }
    h3 {
        font-size: 1.5rem;
    }
    .hero {
        height: 70vh;
        min-height: 500px;
    }
    .hero-slide {
        height: 70vh;
        min-height: 500px;
    }
    .experience-badge {
        bottom: 20px;
        right: 20px;
        padding: 20px;
    }
    .experience-badge .years {
        font-size: 2rem;
    }
    .about-features {
        grid-template-columns: 1fr;
    }
}


/*=====================================
  ESTILOS PARA SUBMENÚS VERTICALES (CORREGIDO)
=====================================*/


/* Contenedor principal del ítem del menú que tiene un submenú */

.navbar-menu ul li.dropdown {
    position: relative;
}


/* El submenú en sí - se oculta por defecto */

.navbar-menu ul li.dropdown .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 250px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 10px 0;
    border-radius: 8px;
    /* --- ESTADO OCULTO (por defecto) --- */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease-in-out;
    /* --- ¡LA CLAVE ESTÁ AQUÍ! --- */
    /* Forzamos a que el submenú sea un bloque y no flex */
    display: block;
}


/* --- CLAVE PARA EL DISEÑO VERTICAL --- */


/* Asegura que cada elemento del submenú ocupe una línea completa */

.navbar-menu ul li.dropdown .submenu li {
    display: block;
    width: 100%;
}


/* Enlaces dentro del submenú */

.navbar-menu ul li.dropdown .submenu li a {
    display: block;
    padding: 12px 25px;
    color: #555;
    font-size: 15px;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.2s ease;
}


/* Efecto hover en los enlaces del submenú */

.navbar-menu ul li.dropdown .submenu li a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    /* Usamos la variable de color de tu web */
    padding-left: 30px;
}


/* --- MOSTRAR EL SUBMENÚ AL PASAR EL CURSOR --- */

.navbar-menu ul li.dropdown:hover>.submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* Ajuste para el último menú para que no se salga de la pantalla */

.navbar-menu ul li:last-child.dropdown .submenu {
    right: 0;
    left: auto;
}


/*=====================================
  AJUSTES PARA MENÚ MÓVIL (RESPONSIVE)
=====================================*/

@media (max-width: 992px) {
    /* Hacemos que el submenú sea visible dentro del menú móvil */
    .navbar-menu ul li.dropdown .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: #f8f9fa;
        display: none;
        /* Lo ocultamos por defecto en móvil */
        border-radius: 0;
        padding: 0;
    }
    /* Mostramos el submenú cuando el padre está activo (lo controlaremos con JS) */
    .navbar-menu ul li.dropdown.active>.submenu {
        display: block;
    }
    /* Damos estilo a los enlaces del submenú en móvil */
    .navbar-menu ul li.dropdown .submenu li a {
        padding-left: 40px;
        font-size: 14px;
        color: #333;
    }
    .navbar-menu ul li.dropdown .submenu li a:hover {
        background-color: #e9ecef;
        padding-left: 45px;
    }
}


/*=====================================
  ESTILOS PARA LA VENTANA MODAL
=====================================*/


/* El fondo oscuro detrás del modal */

.modal {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    /* Se queda fijo en la pantalla */
    z-index: 9999;
    /* Se sitúa encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Habilita scroll si es necesario */
    background-color: rgba(0, 0, 0, 0.6);
    /* Fondo negro con transparencia */
    animation: fadeIn 0.4s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* El contenido del modal (la caja blanca) */

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    /* 5% desde arriba y centrado horizontalmente */
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s;
    overflow: hidden;
    /* Para que los bordes redondeados se apliquen bien */
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* La cabecera del modal */

.modal-header {
    background: var(--gradient-primary);
    /* Usamos el gradiente de tu web */
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}


/* El botón para cerrar (X) */

.close-btn {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    opacity: 0.8;
    transform: rotate(90deg);
}


/* El cuerpo del modal, donde irá el texto */

.modal-body {
    padding: 30px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
}

.modal-body p {
    margin-bottom: 15px;
}

.modal-body p:last-child {
    margin-bottom: 0;
}


/* Ajustes para pantallas pequeñas */

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    .modal-header {
        padding: 15px 20px;
    }
    .modal-body {
        padding: 20px;
    }
}


/*=====================================
  ESTILOS PARA SUBMENÚ HORIZONTAL (MEGA MENÚ)
=====================================*/


/* El contenedor del submenú horizontal */

.navbar-menu ul li.dropdown .submenu-horizontal {
    /* Hacemos que sea un contenedor flexible para alinear elementos horizontalmente */
    display: flex;
    justify-content: flex-start;
    /* Alinea los ítems al inicio */
    /* Ajustes de tamaño y posición */
    left: 0;
    min-width: 450px;
    /* Ancho mínimo para acomodar los ítems */
    width: auto;
    padding: 15px;
}


/* Los ítems (<li>) dentro del submenú horizontal */

.navbar-menu ul li.dropdown .submenu-horizontal li {
    display: block;
    /* Los ítems siguen siendo bloques */
    width: auto;
    /* Permitimos que el ancho se ajuste al contenido */
    margin-right: 10px;
    /* Espacio entre los ítems */
    border-right: 1px solid #e0e0e0;
    /* Un separador visual */
    padding-right: 15px;
}

.navbar-menu ul li.dropdown .submenu-horizontal li:last-child {
    margin-right: 0;
    border-right: none;
    padding-right: 0;
}


/* Los enlaces (<a>) dentro del submenú horizontal */

.navbar-menu ul li.dropdown .submenu-horizontal li a {
    display: block;
    padding: 8px 15px;
    white-space: nowrap;
    /* Evita que el texto se rompa en varias líneas */
    text-align: center;
    border-radius: 8px;
    transition: var(--transition);
}


/* Efecto hover en los enlaces del submenú horizontal */

.navbar-menu ul li.dropdown .submenu-horizontal li a:hover {
    background-color: var(--primary-color);
    color: white;
    padding-left: 15px;
    /* Mantiene el padding consistente */
}


/* Ajuste para el último menú para que no se salga de la pantalla */

.navbar-menu ul li:last-child.dropdown .submenu-horizontal {
    right: 0;
    left: auto;
}


/*=====================================
  AJUSTE RESPONSIVE PARA MÓVIL
  (En móvil, volvemos a hacerlo vertical)
=====================================*/

@media (max-width: 992px) {
    /* Revertimos el submenú horizontal a su estado móvil (vertical) */
    .navbar-menu ul li.dropdown .submenu-horizontal {
        display: none;
        /* Lo ocultamos por defecto en móvil */
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: #f8f9fa;
        border-radius: 0;
        padding: 0;
        min-width: 100%;
    }
    /* Mostramos el submenú cuando el padre está activo */
    .navbar-menu ul li.dropdown.active>.submenu-horizontal {
        display: block;
    }
    /* Revertimos los estilos de los ítems para que sean verticales en móvil */
    .navbar-menu ul li.dropdown .submenu-horizontal li {
        width: 100%;
        margin-right: 0;
        border-right: none;
        padding-right: 0;
    }
    /* Estilos para los enlaces en móvil */
    .navbar-menu ul li.dropdown .submenu-horizontal li a {
        padding-left: 40px;
        /* Indentamos para mostrar jerarquía */
        font-size: 14px;
        color: #333;
        text-align: left;
    }
    .navbar-menu ul li.dropdown .submenu-horizontal li a:hover {
        background-color: #e9ecef;
        color: #333;
    }
}


/*=====================================
  ESTILOS ESPECÍFICOS PARA SUBMENÚ FLYOUT (LATERAL)
  (Solo para "Plataforma Estrategica")
=====================================*/


/* El submenú lateral en sí */

.navbar-menu ul li.dropdown .submenu-flyout {
    position: absolute;
    top: 0;
    /* Se alinea con la parte superior del elemento padre */
    left: 100%;
    /* ¡LA CLAVE! Se posiciona a la derecha del elemento padre */
    margin-top: 0;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    /* Un z-index ligeramente mayor para que esté por encima */
    padding: 10px 0;
    border-radius: 8px;
    /* --- ESTADO OCULTO (por defecto) --- */
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    /* Animación de entrada desde la derecha */
    transition: all 0.3s ease-in-out;
    /* Forzamos a que sea un bloque */
    display: block;
}


/* --- MOSTRAR EL SUBMENÚ FLYOUT AL PASAR EL CURSOR --- */

.navbar-menu ul li.dropdown:hover>.submenu-flyout {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}


/* Ajuste para que no se salga de la pantalla si está muy a la derecha */

.navbar-menu ul li.dropdown:last-child .submenu-flyout {
    right: 100%;
    left: auto;
}


/*=====================================
  AJUSTE RESPONSIVE PARA MÓVIL
  (En móvil, el flyout se vuelve vertical como los demás)
=====================================*/

@media (max-width: 992px) {
    /* Revertimos el submenú flyout a su estado móvil (vertical) */
    .navbar-menu ul li.dropdown .submenu-flyout {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: #f8f9fa;
        display: none;
        /* Lo ocultamos por defecto en móvil */
        border-radius: 0;
        padding: 0;
        left: 0;
        /* Reinicia la posición para móvil */
    }
    /* Mostramos el submenú cuando el padre está activo */
    .navbar-menu ul li.dropdown.active>.submenu-flyout {
        display: block;
    }
    /* Estilos para los enlaces del flyout en móvil */
    .navbar-menu ul li.dropdown .submenu-flyout li a {
        padding-left: 40px;
        /* Indentamos para mostrar jerarquía */
        font-size: 14px;
        color: #333;
    }
    .navbar-menu ul li.dropdown .submenu-flyout li a:hover {
        background-color: #e9ecef;
        padding-left: 45px;
    }
}


/*=====================================
  ESTILOS PARA ALINEAR EL DISPARADOR FLYOUT
=====================================*/


/* Aplica los mismos estilos de un enlace (<a>) al <span> del menú flyout */

.navbar-menu ul li.dropdown .submenu li.dropdown>span {
    display: block;
    padding: 12px 25px;
    color: #555;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}


/* Asegura que el icono de la flecha esté bien alineado */

.navbar-menu ul li.dropdown .submenu li.dropdown>span i {
    margin-left: 5px;
    font-size: 12px;
}


/* Añade el efecto hover al <span> para que sea interactivo */

.navbar-menu ul li.dropdown .submenu li.dropdown:hover>span {
    background-color: #f8f9fa;
    color: var(--primary-color);
    padding-left: 30px;
}


/* Objetivos Page Styles */

.objetivos-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.objetivos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.objetivo-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.objetivo-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.objetivo-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.objetivo-icon i {
    font-size: 30px;
    color: white;
}

.objetivo-content h3 {
    font-size: 22px;
    color: var(--dark-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.objetivo-content p {
    color: #666;
    line-height: 1.8;
    margin: 0;
}

.objetivo-number {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 48px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.05);
}

.compromiso-section {
    background: white;
    padding: 60px;
    border-radius: 20px;
    margin-top: 60px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.compromiso-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.compromiso-icon i {
    font-size: 50px;
    color: white;
}

.compromiso-content h3 {
    font-size: 32px;
    color: var(--dark-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.compromiso-content p {
    font-size: 18px;
    color: #666;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

.cta-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 60px;
    border-radius: 20px;
    margin-top: 60px;
    text-align: center;
    color: white;
}

.cta-banner-content h3 {
    font-size: 32px;
    margin-bottom: 15px;
    font-weight: 700;
}

.cta-banner-content p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .objetivos-grid {
        grid-template-columns: 1fr;
    }
    .compromiso-section,
    .cta-banner {
        padding: 40px 30px;
    }
}


/* Estilos para el submenú lateral (fly-out) */

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu>span {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    /* Ajusta el padding si es necesario */
    color: #333;
    transition: background-color 0.3s;
}

.dropdown-submenu>span:hover {
    background-color: #f0f0f0;
}

.dropdown-submenu>span i.fa-info-circle {
    font-size: 0.8em;
    color: #0078ff;
    margin-left: 10px;
}


/* Contenedor de la definición */

.dropdown-submenu .submenu {
    display: none;
    position: absolute;
    left: 100%;
    /* Aparece a la derecha del elemento padre */
    top: 0;
    min-width: 320px;
    /* Ancho definido para el recuadro de definición */
    background-color: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border-radius: 4px;
    border: 1px solid #ddd;
}


/* Mostrar el submenú al pasar el ratón sobre el padre */

.dropdown-submenu:hover .submenu {
    display: block;
}


/* Estilo para el contenido dentro del recuadro */

.submenu-content {
    padding: 15px 20px;
}

.submenu-content p {
    margin: 0;
    line-height: 1.6;
    color: #555;
    font-size: 0.95em;
}

.submenu-content strong {
    color: #333;
}


/* Separador visual en el menú */

.submenu-divider {
    height: 1px;
    background-color: #eee;
    margin: 10px 0;
}


/* ----- AJUSTE PARA MÓVILES (TOUCH) ----- */


/* En dispositivos táctiles, el hover no funciona bien. Usaremos una clase .show activada por JavaScript. */

@media (max-width: 992px) {
    /* Prevenimos que el hover se active en móviles para evitar conflictos */
    .dropdown-submenu:hover .submenu {
        display: none;
    }
    /* Mostramos el submenú cuando la clase .show está presente */
    .dropdown-submenu.show .submenu {
        display: block;
        position: static;
        /* En móvil, lo mostramos debajo en lugar de a la derecha */
        width: 100%;
        left: 0;
        box-shadow: none;
        border: none;
        background-color: #f9f9f9;
    }
}