/* Reset y variables */
:root {
    --color-azul: rgb(22, 82, 163);
    --color-fondo: rgb(245, 247, 250);
    --color-blanco: #ffffff;
    --color-gris-claro: #f5f7fa;
    --color-texto: #333333;
    --color-enlace: var(--color-azul);
    --sombra-ligera: 0 2px 4px rgba(0, 0, 0, 0.1);
    --sombra-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
    --radio-borde: 8px;
    --transicion: all 0.3s ease;
}

.intro {
    font-size: 1.1rem;
    color: #555555;
    line-height: 1.5;
    margin-top: 0.5rem;
    text-align: justify;
    font-size: medium;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--color-texto);
    background-color: var(--color-fondo);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-enlace);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* Header */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--color-azul);
    color: var(--color-blanco);
    z-index: 1000;
    height: 64px;
    box-shadow: var(--sombra-ligera);
}

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

.logo .full-logo {
    color: var(--color-blanco);
    font-size: 1.5rem;
    font-weight: bold;
}

.logo .short-logo {
    color: var(--color-blanco);
    display: none;
    font-size: 1.25rem;
    font-weight: bold;
}

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

.desktop-nav a {
    color: var(--color-blanco);
    font-weight: 500;
    transition: var(--transicion);
}

.desktop-nav a:hover {
    opacity: 0.8;
}

.mobile-nav {
    display: none;
    gap: 1rem;
}

.mobile-nav button {
    color: var(--color-blanco);
    padding: 8px;
    border-radius: 4px;
    transition: var(--transicion);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-nav button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.search-text {
    display: none;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Show text on Android/small screens */
@media (max-width: 600px) and (-webkit-min-device-pixel-ratio: 1.5) {
    .search-text {
        display: inline;
    }
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-azul);
    padding: 1rem;
}

.mobile-menu.open {
    display: block;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-menu a {
    color: var(--color-blanco);
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transicion);
}

.mobile-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main content */
main {
    flex: 1;
    margin-top: 64px;
}

.section {
    padding: 2rem 0;
}

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

/* Sobre nosotros */
#sobre-nosotros .container {
    background-color: var(--color-blanco);
    border-radius: var(--radio-borde);
    padding: 24px;
    box-shadow: var(--sombra-ligera);
    margin-bottom: 2rem;
}

#sobre-nosotros h2 {
    margin-bottom: 1rem;
    color: var(--color-azul);
}

/* Barra de búsqueda */
.search-bar {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

.search-bar input {
    flex: 1;
    padding: 12px 40px 12px 16px;
    border: 1px solid #ddd;
    border-radius: var(--radio-borde);
    font-size: 1rem;
    background-color: var(--color-blanco);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--color-azul);
    box-shadow: 0 0 0 2px var(--color-foco);
}

#clear-search {
    position: absolute;
    right: 12px;
    color: #666;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transicion);
}

#clear-search:hover {
    background-color: #f0f0f0;
}

/* =========================
   VARIABLES Y RESET
   ========================= */
:root {
    --color-azul: rgb(22, 82, 163);
    --color-fondo: rgb(245, 247, 250);
    --color-blanco: #ffffff;
    --color-gris-claro: #f5f7fa;
    --color-texto: #333;
    --color-enlace: var(--color-azul);
    --radio-borde: 8px;
    --sombra: 0 2px 4px rgba(0,0,0,0.1);
    --sombra-hover: 0 4px 8px rgba(0,0,0,0.15);
    --transicion: all .3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--color-fondo);
    color: var(--color-texto);
}

/* =========================
   CARRUSEL — CÓDIGO LIMPIO
   ========================= */
.carousel {
    width: 100%;
    position: relative;
}

.carousel-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    display: flex;
    gap: 20px;
    padding: 10px 0;
}

/* Botones */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: gainsboro;
    color: var(--color-azul);
    opacity: 0.6;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transicion);
    cursor: pointer;
    z-index: 10;
}

.carousel-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

/* =========================
   TARJETAS DE CURSOS
   ========================= */
.curso-card {
    flex: 0 0 300px;
    background: var(--color-blanco);
    border-radius: var(--radio-borde);
    box-shadow: var(--sombra);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transicion);
}

.curso-card:hover {
    transform: scale(1.03);
    box-shadow: var(--sombra-hover);
}

.curso-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.curso-card h3 {
    margin: 16px 20px 6px 20px;
    font-size: 1.15rem;
    color: var(--color-azul);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.curso-card p {
    margin: 0 20px;
    font-size: 0.9rem;
    color: #666;
    text-align: justify;
    flex: 1;
}

/* Enlace */
.enlace-curso {
    margin-top: auto;
    padding: 12px 0;
    text-align: center;
    background: var(--color-azul);
    color: var(--color-blanco);
    font-weight: 500;
    transition: var(--transicion);
}
.enlace-curso:hover {
    background: #1a5a99;
}

/* Reportar */
.reportar-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    z-index: 5;
    transition: var(--transicion);
}

.reportar-btn:hover {
    background: white;
    box-shadow: var(--sombra);
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 768px) {
    .curso-card {
        flex: 0 0 240px;
    }
}

@media (max-width: 600px) {

    /* CARRUSEL MÓVIL */
    .carousel-container {
        overflow-x: auto;
        overflow-y: hidden;
        height: auto;
    }

    .carousel-track {
        flex-direction: row;
    }

    .curso-card {
        flex: 0 0 260px;
        min-height: 350px;
    }

    .carousel-btn {
        display: none; /* botones se ocultan en móvil */
    }
}

.menu-opciones {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--color-blanco);
    border-radius: var(--radio-borde);
    box-shadow: var(--sombra-ligera);
    display: none;
    z-index: 10;
    min-width: 150px;
}

.menu-opciones.visible {
    display: block;
}

.menu-opciones button {
    width: 100%;
    padding: 8px 16px;
    text-align: left;
    color: var(--color-texto);
    font-size: 0.9rem;
    transition: var(--transicion);
}

.menu-opciones button:hover {
    background-color: var(--color-gris-claro);
}

.enlace-curso {
    display: block;
    background-color: var(--color-azul);
    color: var(--color-blanco);
    padding: 12px 16px;
    text-align: center;
    font-weight: 500;
    margin-top: auto;
    transition: var(--transicion);
}

.enlace-curso:hover {
    background-color: #1a5a99;
    text-decoration: none;
}

/* Blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.blog-post {
    background-color: var(--color-blanco);
    border-radius: var(--radio-borde);
    overflow: hidden;
    box-shadow: var(--sombra-ligera);
    transition: var(--transicion);
}

.blog-post:hover {
    transform: scale(1.02);
    box-shadow: var(--sombra-hover);
}

.blog-post img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-post-content {
    background-color: var(--color-azul);
    color: var(--color-blanco);
    padding: 2rem 0;
    margin-top: auto;
}

#footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

#footer p {
    margin: 0;
}

.facebook-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: var(--color-blanco);
    border-radius: 50%;
    transition: var(--transicion);
    box-shadow: var(--sombra-ligera);
}

.facebook-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--sombra-hover);
}

/* Responsive */
@media (max-width: 1024px) {
    .header-content {
        padding: 0 16px;
    }

    .desktop-nav {
        gap: 1.5rem;
    }

    .curso-card {
        flex: 0 0 240px;
        margin: 0 12px;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 12px;
    }

    .desktop-nav {
        gap: 1rem;
    }

    .curso-card {
        flex: 0 0 220px;
        margin: 0 10px;
    }
}

@media (max-width: 600px) {
    #header {
        height: 56px;
    }

    main {
        margin-top: 56px;
    }

    .header-content {
        padding: 0 12px;
    }

    .logo .full-logo {
        display: none;
    }

    .logo .short-logo {
        display: block;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-nav {
        display: flex;
    }

    .search-bar {
        display: none;
    }

    .search-bar.visible {
        display: flex;
        margin-bottom: 1rem;
    }

    .carousel-container {
        height: auto;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .carousel-track {
        flex-direction: row;
        width: max-content;
    }

    .carousel-btn {
        display: flex;
        width: 40px;
        height: 40px;
    }

    .curso-card {
        flex: 0 0 260px;
        margin: 0 10px;
        min-height: 350px;
    }

    #footer .container {
        flex-direction: column;
        text-align: center;
    }
}

/* Accesibilidad */
*:focus {
    outline: 2px solid var(--color-foco);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid var(--color-foco);
    outline-offset: 2px;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.curso-card {
    animation: fadeIn 0.5s ease-out;
    min-height: 400px;
}

/* Marca de agua sutil */
body::before {
    content: '';
    position: fixed;
    bottom: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50" y="50" font-family="Arial" font-size="12" fill="%23f0f0f0" text-anchor="middle">BSC</text></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
}
