/* ===== ESTILOS GENERALES ===== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

h1 {
    text-align: center;
    color: #007BFF;
    margin-top: 20px;
}

.hidden {
    display: none;
}

/* ===== BOTONES ===== */
.button-container3Grand {
    display: inline-block;
    position: relative;
    justify-content: center;
}

.button-container3Grand a {
    position: absolute;
    bottom: 6em;
    font-family: Verdana;
    background-color: #00004a;
    border-radius: 1.5em;
    color: white;
    text-transform: uppercase;
    padding: 1em 1.5em;
}

.button-container3Grand a:hover {
    background-color: darkblue;
    cursor: pointer;
    color: white;
}

.button-container4Grand {
    display: inline-block;
    margin-bottom: 2em;
    background-color: darkblue;
    cursor: pointer;
    color: white;
}

.button-container4Grand a {
    font-family: Verdana;
    position: relative;
    bottom: 0em;
    background-color: #00004a;
    color: white;
    font-size: 1em;
    padding: 1em 1.5em;
    text-transform: uppercase;
    border-color: white;
    border-radius: 1.5em;
}

.button-container4Grand a:hover {
    background-color: darkblue;
    cursor: pointer;
    color: white;
}

/* ===== TARJETAS BÁSICAS ===== */
.card-container {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.card {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
}

.card img:hover {
    opacity: 0.7;
}

.card-content {
    padding: 16px;
    text-align: center;
}

.card-content h2 {
    margin-top: 0;
}

/* ===== TARJETAS CON ALTURA UNIFORME (GRID) - MEJORADO ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Tarjeta principal --- */
.grid .card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: auto;
    max-width: none;
    width: 100%;
}

/* --- Imagen --- */
.grid .card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    border-bottom: 3px solid #00004a;
    display: block;
    line-height: 0;
    vertical-align: bottom;
    margin: 0;
    padding: 0;
}

.grid .card .image-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 0;
}

/* --- Contenido --- */
.grid .card .card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 🔹 Empuja el botón al fondo */
    align-items: flex-start;
    flex-grow: 1;
    padding: 15px 20px 20px 20px;
    text-align: left;
    height: 100%;
}

/* --- Título --- */
.grid .card .card-content h4 {
    margin: 0 0 6px 0;
    color: #333;
    font-size: 1.3rem;
    line-height: 1.3;
    font-weight: 600;
}

/* --- Texto --- */
.grid .card .card-content p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 1rem;
    line-height: 1.3;
    display: inline-block;
}

/* --- Enlace del botón --- */
.grid .card .card-content a {
    margin-top: auto;             /* 🔹 Ocupa el espacio restante y baja el botón */
    align-self: flex-start;       /* 🔹 Alinea el botón a la izquierda */
    background-color: #00004a;
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #00004a;
    transition: all 0.3s ease;
}

.grid .card .card-content a:hover {
    background-color: #0022aa;
    border-color: #0022aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 255, 0.3);
}

/* ===== TARJETAS INFORMATIVAS CON BOTONES ALINEADOS ===== */
.card-container-informativo {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    max-width: 1150px;
    margin: 20px auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    transition: transform 0.3s;
    min-height: 350px;
}

.card-container-informativo:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-image {
    flex: 0 0 40%;
    min-width: 150px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

.card-image:hover img {
    opacity: 0.7;
}

.card-content-informativo {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    text-align: left;
    position: relative;
    min-height: 350px;
}

.card-content-informativo h2 {
    margin: 0 0 25px 0;
    color: #000080;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
}

.card-content-informativo p {
    color: #333;
    line-height: 1.6;
    margin: 0 0 20px 0;
    font-size: 15px;
    flex-grow: 1;
    text-align: left;
}

.card-content-informativo .button-wrapper {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.card-content-informativo a {
    display: inline-block;
    padding: 14px 30px;
    background: linear-gradient(135deg, #00004a, #000080);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 128, 0.2);
    min-width: 200px;
}

.card-content-informativo a:hover {
    background: linear-gradient(135deg, #000080, #0000ff);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 255, 0.3);
    color: white;
    text-decoration: none;
}

.card-content-informativo .btn-primary {
    background: linear-gradient(135deg, #00004a, #000080) !important;
    border: none !important;
    padding: 14px 30px !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    min-width: 200px !important;
}

.card-content-informativo .btn-primary:hover {
    background: linear-gradient(135deg, #000080, #0000ff) !important;
    transform: translateY(-2px) !important;
}

/* ===== TARJETAS MODERNAS (CARRUSEL) ===== */
#carrusel-cuh-container .tarjeta-moderna {
    display: flex;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-width: 1100px;
    margin: 30px auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    height: auto;
}

#carrusel-cuh-container .tarjeta-moderna:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
}

#carrusel-cuh-container .tarjeta-moderna .contenido {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#carrusel-cuh-container .tarjeta-moderna .categoria {
    color: #000080;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 12px;
    display: inline-block;
    position: relative;
}

#carrusel-cuh-container .tarjeta-moderna .categoria::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 3px;
    background: #000080;
    border-radius: 3px;
}

#carrusel-cuh-container .tarjeta-moderna h1 {
    margin: 0 0 10px 0;
    color: #222;
    font-size: 2.2em;
}

#carrusel-cuh-container .tarjeta-moderna h4 {
    margin: 0 0 20px 0;
    color: #444;
    font-size: 1.3em;
    font-weight: 500;
}

#carrusel-cuh-container .tarjeta-moderna p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 30px;
    font-size: 1.05em;
}

#carrusel-cuh-container .tarjeta-moderna .meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#carrusel-cuh-container .tarjeta-moderna .fecha {
    color: #666;
    font-size: 0.95em;
}

#carrusel-cuh-container .tarjeta-moderna .enlace {
    color: #000080;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

#carrusel-cuh-container .tarjeta-moderna .enlace:hover {
    color: #FF6B00;
}

#carrusel-cuh-container .tarjeta-moderna .enlace::after {
    content: '→';
    margin-left: 8px;
    transition: transform 0.3s ease;
}

#carrusel-cuh-container .tarjeta-moderna .enlace:hover::after {
    transform: translateX(5px);
}

#carrusel-cuh-container .tarjeta-moderna .video-container {
    flex: 0 0 45%;
    position: relative;
    min-height: 350px;
    background: #000;
    box-shadow: 0 2px 8px 0 rgba(63,69,81,0.16);
    border-radius: 8px;
    margin: 20px;
    overflow: hidden;
}

#carrusel-cuh-container .tarjeta-moderna .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

#carrusel-cuh-container .tarjeta-moderna::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 128, 0.05) 50%);
}

/* ===== CARRUSEL ===== */
#carrusel-cuh-container .swiper {
    width: 100%;
    padding: 10px 0;
}

#carrusel-cuh-container .swiper-button-next,
#carrusel-cuh-container .swiper-button-prev {
    color: #000080;
    background: rgba(255,255,255,0.8);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

#carrusel-cuh-container .swiper-button-next::after,
#carrusel-cuh-container .swiper-button-prev::after {
    font-size: 24px;
    font-weight: bold;
}

#carrusel-cuh-container .swiper-button-next:hover,
#carrusel-cuh-container .swiper-button-prev:hover {
    background: white;
    transform: scale(1.1);
}

/* ===== TARJETAS DE DÍAS FESTIVOS ===== */
.festivos-section {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 25px;
    font-family: 'Arial', sans-serif;
    position: relative;
}

.section-title:after {
    content: "";
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, #3498db, #2ecc71);
    margin: 10px auto;
}

.cards-container {
    display: flex;
    gap: 20px;
    padding: 15px 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #3498db #f1f1f1;
}

.cards-container::-webkit-scrollbar {
    height: 8px;
}

.cards-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.cards-container::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

.festivo-tag {
    display: inline-block;
    padding: 4px 8px;
    background: #e74c3c;
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ===== OFERTA EDUCATIVA ===== */
.oferta-educativa-container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.oferta-educativa-container h2 {
    color: #000080;
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: bolder;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters button {
    padding: 10px 20px;
    background-color: #000080;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.filters button.active,
.filters button:hover {
    background-color: #0000ff;
}

/* ===== GACETA ===== */
.gaceta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    max-width: 1400px;
}

.gaceta-title {
    color: #000080;
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
}

.gaceta-content {
    width: 100%;
    max-width: 1200px;
    height: 800px;
}

.gaceta-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== CURSOS ===== */
#proximos-cursos-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.course-card {
    margin-bottom: 20px;
}

.row {
    display: flex;
    justify-content: center;
}

.col-lg-4 {
    padding: 10px;
}

/* ===== PESTAÑAS CON IMÁGENES DESTACADAS - REPARADAS ===== */
.tabs-design-container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
}

.tabs-design-title {
    text-align: center;
    margin-bottom: 40px;
    color: #2c3e50;
}

.tabs-design-title h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tabs-design-title p {
    opacity: 0.9;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
    color: #666;
}

/* === REPARA BORDES DE LAS PESTAÑAS === */

/* Contenedor general de pestañas */
.tabs-design-section {
    background: #fff;
    border-radius: 20px;
    overflow: visible !important; /* 🔹 Permite que el borde azul se vea completo */
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

/* Cabecera de las pestañas */
.tabs-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    overflow: visible !important;
    position: relative;
    z-index: 2;
    border-bottom: 1px solid #ddd; /* 🔹 línea inferior suave */
    background: #f8f9fa;
}

/* Botones de pestañas */
.tab-btn {
    position: relative;
    background: #fff;
    border: none;                /* 🔹 quitamos el borde negro */
    outline: none;
    padding: 14px 28px;
    font-weight: 600;
    color: #333;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

/* Estado hover */
.tab-btn:hover {
    background-color: #f5f5ff;
    color: #000080;
}

/* Estado activo (solo el borde azul visible) */
.tab-btn.active {
    color: #000080;
    font-weight: 700;
    background: #fff;
    border: none;                /* 🔹 aseguramos que no haya borde negro */
}

/* Borde inferior azul animado */
.tab-btn.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;                /* 🔹 alineado exacto al borde blanco */
    height: 3px;
    background-color: #000080;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.tab-content {
    padding: 0;
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tab-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
    padding: 30px;
}

.tab-image-large {
    width: 450px;
    height: 600px;
    border-radius: 12px;
    object-fit: contain;
    object-position: left center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.tab-image-large:hover {
    transform: scale(1.02);
}

.tab-content-text {
    padding: 10px 0;
}

.tab-content-text h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.tab-content-text p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.highlight-text {
    background: #f0f7ff;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #000080;
    margin: 20px 0;
}

.feature-list {
    list-style: none;
    margin-top: 20px;
}

.feature-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease;
}

.feature-list li:hover {
    background: #f9f9f9;
}

.feature-list li:before {
    content: '✓';
    color: #000080;
    font-weight: bold;
    font-size: 1.1rem;
}

.tabs-btn-primary {
    background: #000080;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 20px;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 128, 0.2);
    text-decoration: none;
    display: inline-block;
}

.tabs-btn-primary:hover {
    background: #0000ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 128, 0.3);
    color: white;
    text-decoration: none;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.progress-ring {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: conic-gradient(#000080 0% 75%, #e9ecef 75% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.progress-ring::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
}

.progress-text {
    position: relative;
    z-index: 1;
    font-size: 1rem;
    font-weight: bold;
    color: #000080;
}

.progress-info {
    flex: 1;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1300px) {
    div[style*="display: flex;"] {
        flex-direction: column !important;
    }
    
    div[style*="flex: 0 0 40%;"] {
        width: 100% !important;
        max-height: none !important;
        order: -1;
    }
    
    div[style*="flex: 1;"] {
        padding: 20px !important;
    }
    
    .card-container-informativo {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 20px;
        padding: 20px;
        min-height: auto;
    }
        
    .card-image {
        width: 100%;
        max-height: 300px;
        order: -1;
        flex: none;
    }
    
    .card-content-informativo {
        min-height: auto;
        padding: 25px 20px;
    }
    
    .card-content-informativo h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .card-content-informativo .button-wrapper {
        margin-top: 25px;
        padding-top: 15px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .grid .card {
        width: 100%;
    }
    
    .grid .card img {
        height: auto;
    }
    
    .grid .card .image-container {
        height: auto;
    }
    
    .grid .card .card-content {
        padding: 12px 15px 15px 15px;
    }
    
    .card-content-informativo {
        padding: 20px 15px;
    }
    
    .card-content-informativo h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    .card-content-informativo a {
        padding: 12px 25px;
        font-size: 15px;
        min-width: 180px;
        width: 100%;
        display: block;
    }
    
    .card-content-informativo .button-wrapper {
        margin-top: 20px;
        padding-top: 15px;
    }

    .card-image {
        width: 420px;
        height: 280px;
        overflow: hidden;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        margin: 0 auto;
        position: relative;
        background-color: #f5f5f5;
    }

    .card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
        transition: transform 0.4s ease, opacity 0.3s ease;
    }

    .card-image:hover img {
        opacity: 0.85;
        transform: scale(1.05);
    }
    
    #carrusel-cuh-container .tarjeta-moderna {
        flex-direction: column;
        max-width: 95%;
    }

    #carrusel-cuh-container .tarjeta-moderna .video-container {
        flex: 1;
        min-height: 250px;
        order: -1;
        margin: 0;
        border-radius: 12px 12px 0 0;
    }

    #carrusel-cuh-container .tarjeta-moderna .contenido {
        padding: 30px;
    }

    #carrusel-cuh-container .swiper-button-next,
    #carrusel-cuh-container .swiper-button-prev {
        display: none;
    }
    
    .tabs-design-container {
        margin: 30px auto;
        padding: 0 15px;
    }
    
    .tabs-design-title h2 {
        font-size: 1.8rem;
    }
    
    .tabs-header {
        overflow: visible;
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 15px;
        width: 100%;
    }
    
    .tab-content-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }
    
    .progress-container {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .tab-image-large {
        width: 100%;
        height: 600px;
        overflow: hidden;
        border-radius: 12px;
        position: relative;
        background-color: #f5f5f5;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .tab-image-large img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
        transition: transform 0.4s ease, opacity 0.3s ease;
    }

    .tab-image-large:hover img {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@media (max-width: 480px) {
    .card-content-informativo h2 {
        font-size: 20px;
    }
    
    .card-content-informativo p {
        font-size: 14px;
    }
    
    .card-content-informativo a {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .tabs-design-title h2 {
        font-size: 1.5rem;
    }
    
    .tab-content-grid {
        padding: 15px;
    }
    
    .tab-content-text h3 {
        font-size: 1.3rem;
    }
    
    .grid .card .card-content {
        padding: 10px 12px 12px 12px;
    }
    
    .grid .card .card-content h4 {
        font-size: 1.1rem;
    }
    
    .grid .card .card-content p {
        font-size: 0.9rem;
    }
    
    .grid .card .card-content a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}