:root {
    --primary: #1a4f8c;
    --secondary: #f5f7fa;
    --accent: #ff6b35;
    --dark: #333333;
    --light: #ffffff;
    --gray: #6c757d;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--dark);
    line-height: 1.6;
    background-color: var(--light);
}

/* Cross-browser base improvements */
html {
    -webkit-text-size-adjust: 100%; /* iOS Safari text zoom */
    text-size-adjust: 100%;
    scroll-behavior: smooth; /* native smooth scroll in modern browsers */
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Better font rendering on WebKit */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Make media elements fluid */
img, svg, video, canvas, audio, iframe, embed, object {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Accessible focus styles */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Offset for in-page anchors with fixed header */
section, header + section, main > section {
    scroll-margin-top: 90px; /* approximate header height */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
}

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

/* Header Styles */
header {
    background-color: var(--light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

/* Reducir padding lateral del contenedor SOLO en el header */
header .container {
    padding-left: 0px;
    padding-right: 0px;
    max-width: 100%; /* usar todo el ancho en el header */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0; /* 0px por lado */
    padding-left: 0; /* pegar el logo al borde izquierdo */
    width: 100%;
    position: relative; /* ancla para posicionar el botón móvil */
}

/* Ajustes solo para escritorio para pegar elementos a los bordes */
@media (min-width: 993px) {
    .header-container {
        justify-content: space-between; /* logo a la izquierda, menú a la derecha */
    }
    .header-container .logo {
        margin-left: 12px; /* misma distancia que definimos para el logo */
    }
    .header-container nav {
        margin-left: auto; /* empujar menú hacia el borde derecho */
    }
    /* Separación del CTA respecto al borde derecho */
    .header-container nav ul li:last-child a.nav-cta {
        margin-right: 12px;
    }
}

.logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-left: 12px; /* separación un poco mayor del borde izquierdo */
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
    line-height: 1;
    color: var(--primary);
}

.logo span {
    color: var(--accent);
}

/* Subtítulo bajo el logo */
.logo-subtitle {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--gray);
    margin-top: -2px;
    text-align: left;
    line-height: 1.05;
    white-space: nowrap;
    display: block;
    font-family: 'Oswald', Arial, sans-serif;
    text-transform: uppercase;
    padding-left: 1px; /* micro-indente para la 'C' */
}

/* Ajuste del tamaño visual del ampersand para igualarlo al resto */
.logo-subtitle .amp {
    display: inline-block;
    font-size: 0.9em;      /* reduce levemente el tamaño del & */
    line-height: 1;
    transform: translateY(0.02em); /* microajuste vertical */
}

/* Estilos del menú de navegación */
nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: var(--transition);
    display: block;
    padding: 10px 0;
}

nav ul li a:hover {
    color: var(--accent);
}

.nav-cta {
    background-color: var(--accent);
    color: var(--light) !important;
    padding: 10px 20px !important;
    border-radius: 4px;
}

.nav-cta:hover {
    background-color: var(--primary);
    color: var(--light) !important;
}

/* Estilos para el botón de menú móvil */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
    z-index: 1001;
    border: none;              /* quitar borde por defecto */
    outline: none;             /* quitar outline por defecto (seguimos usando :focus-visible global) */
    background: transparent;   /* sin fondo */
    box-shadow: none;          /* sin sombras por defecto */
    appearance: none;          /* normaliza en Firefox/otros */
    -webkit-appearance: none;  /* normaliza en WebKit/Chrome iOS */
    padding: 0;                /* evita padding por defecto del botón */
}

/* Estilos para móviles */
@media (max-width: 992px) {
    .mobile-menu-btn {
        display: block;
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        width: 44px; /* objetivo táctil recomendado */
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        color: var(--primary);
        background: transparent;
    }
    
    nav {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh; /* fallback */
        height: 100dvh; /* use dynamic viewport on mobile browsers (Chrome/Android, iOS 16+) */
        background-color: var(--light);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease-in-out;
        z-index: 1000;
        padding: 80px 20px 20px; /* espacio para el header */
        overflow-y: auto;
    }
    
    nav.active {
        right: 0;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin: 0 0 15px 0;
    }
    
    nav ul li a {
        padding: 10px 15px;
        border-radius: 4px;
    }
    
    .nav-cta {
        margin-top: 10px;
        text-align: center;
    }
    
    /* Fondo oscuro cuando el menú está abierto */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .menu-overlay.active {
        display: block;
    }
}

/* Hero Section */
.hero {
    padding: 150px 0 100px;
    background: linear-gradient(rgba(26, 79, 140, 0.8), rgba(26, 79, 140, 0.9)), url('https://images.unsplash.com/photo-1523240795612-9a054b0db644?auto=format&fit=crop&q=80') no-repeat center center/cover;
    color: var(--light);
    text-align: center;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--light);
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 30px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--accent);
    color: var(--light);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--primary);
    transform: translateY(-3px);
}

/* Services Section */
.services {
    padding: 80px 0;
    background-color: var(--secondary);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--accent);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--light);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    text-align: center;
}

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

.service-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* About Section */
.about {
    padding: 80px 0;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 20px;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 1rem;
    color: var(--gray);
}

/* Portfolio Section */
.portfolio {
    padding: 80px 0;
    background-color: var(--secondary);
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.filter-btn {
    background: none;
    border: none;
    padding: 8px 15px;
    margin: 0 5px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.portfolio-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.portfolio-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 79, 140, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
    padding: 20px;
    text-align: center;
    color: var(--light);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-item:hover .portfolio-img {
    transform: scale(1.1);
}

/* Team Section */
.team {
    padding: 80px 0;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.team-member {
    text-align: center;
    background-color: var(--secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.team-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.team-info {
    padding: 20px;
}

.team-info h3 {
    margin-bottom: 5px;
}

.team-role {
    color: var(--accent);
    font-style: italic;
    margin-bottom: 15px;
}

/* Testimonials Section */
.testimonials {
    padding: 80px 0;
    background-color: var(--secondary);
}

.testimonial-slider {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.testimonial {
    text-align: center;
    padding: 30px;
    background-color: var(--light);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: none;
}

.testimonial.active {
    display: block;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 20px;
    position: relative;
    padding: 0 30px;
}

.testimonial-text::before,
.testimonial-text::after {
    font-size: 4rem;
    color: var(--accent);
    position: absolute;
    opacity: 0.2;
}

.testimonial-text::before {
    content: '“';
    top: -20px;
    left: 0;
}

.testimonial-text::after {
    content: '”';
    bottom: -40px;
    right: 0;
}

.testimonial-author {
    font-weight: 600;
    color: var(--primary);
}

.testimonial-role {
    color: var(--gray);
    font-size: 0.9rem;
}

.testimonial-controls {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.testimonial-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--gray);
    margin: 0 5px;
    cursor: pointer;
    transition: var(--transition);
}

.testimonial-dot.active {
    background-color: var(--accent);
    transform: scale(1.2);
}

/* Contact Section */
.contact {
    padding: 80px 0;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.contact-details {
    margin-bottom: 30px;
}

.contact-detail {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.contact-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary);
    color: var(--light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Open Sans', sans-serif;
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* Lista de Cursos */
.course-list {
    padding: 0;
    margin: 15px 0;
    text-align: left;
}

.course-item {
    padding: 6px 0;
    margin: 0;
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.5;
    border-bottom: 1px solid #f0f0f0;
}

.course-item:last-child {
    border-bottom: none;
}

.btn-small {
    display: inline-block;
    padding: 8px 20px;
    background-color: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: var(--transition);
    margin-top: 10px;
    border: none;
    cursor: pointer;
}

.btn-small:hover {
    background-color: #e05a1a;
    transform: translateY(-2px);
}

/* Ajustes para la sección de Cursos */
#cursos {
    background-color: #f9f9f9;
}

#cursos .service-card {
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

#cursos .service-card .service-icon {
    margin-bottom: 15px;
}

#cursos .service-card h3 {
    margin-bottom: 15px;
}

#cursos .btn-small {
    margin-top: auto;
    align-self: flex-start;
}
    .courses-category {
        padding: 20px 15px;
    }

/* Footer */
footer {
    background-color: var(--primary);
    color: var(--light);
    padding: 60px 0 30px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-col h3 {
    color: var(--light);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--light);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.social-links {
    display: flex;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: 10px;
    color: var(--light);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--accent);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .logo {
        margin-bottom: 15px;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin: 10px 0;
    }
    
    .mobile-menu-btn {
        display: block;
        position: absolute;
        top: 16px;
        right: 0px; /* 0px del borde derecho */
    }
    
    .mobile-menu {
        display: none;
    }
    
    .hero h2 {
        font-size: 2.2rem;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
