/* ========================================
   BUSCADOR DE PROGRAMAS UCOMPENSAR
   Estilos con prefijo ucomp- para WordPress
   ======================================== */

/* Importar fuente Montserrat */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

.banner-sm {
    position: relative;
    display: none;
}

.ucomp-badge-acreditado {
    background-color: #002856;
    color: #fff;
    position: relative;
    display: inline-block;
    cursor: help;
    line-height: 16px;
}

.ucomp-badge-acreditado::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 125%;
    left: 0;
    right: 0;
    margin: 0 auto;
    background: #4B0082;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.95em;
    line-height: 1.5;
    font-weight: 600;
    white-space: normal;
    width: 250px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    z-index: 999;
}

.ucomp-badge-acreditado:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Reset básico */
.ucomp-programs-wrapper * {
    box-sizing: border-box;
}

/* Wrapper principal */
.ucomp-programs-wrapper {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Header */
.ucomp-header {
    text-align: center;
    margin-bottom: 40px;
}

.ucomp-title {
    font-size: 2.5em;
    font-weight: 700;
    color: #6B2D7B;
    margin: 0;
}

.ucomp-highlight {
    color: #FF6B00;
}

/* Container Layout */
.ucomp-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* ========== SIDEBAR FILTROS ========== */

/* Toggle button - OCULTO por defecto en desktop */
.ucomp-filters-mobile-toggle {
    display: none;
}

.ucomp-toggle-btn {
    width: 100%;
    padding: 15px;
    background: #FF6B00;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
}

.ucomp-filters {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: block;
}

/* Botón Limpiar Filtros */
.ucomp-reset-btn {
    width: 100%;
    padding: 12px 20px;
    background: #f0f0f1;
    color: #003D7A;
    border: 2px solid #003D7A;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
    margin-bottom: 25px;
}

.ucomp-reset-btn:hover {
    background: #003D7A;
    color: white;
}

/* Link Educación Continua */
.ucomp-education-link {
    display: block;
    width: 100%;
    padding: 3px;
    background: linear-gradient(135deg, #FF6B00 0%, #E05F00 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    margin-top: 10px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

.ucomp-education-link:hover {
    background: linear-gradient(135deg, #E05F00 0%, #C55000 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.4);
    color: white;
    text-decoration: none;
}

/* Títulos de filtro */
.ucomp-filter-title {
    font-size: 0.95em;
    font-weight: 700;
    color: #003D7A;
    margin-bottom: 12px;
}

/* Labels de radio */
.ucomp-radio-label {
    display: flex;
    align-items: center;
    padding: 6px 0;
    cursor: pointer;
    transition: color 0.3s;
    margin: 0;
}

.ucomp-radio-label:hover {
    color: #FF6B00;
}

.ucomp-radio-label input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
    height: 18px;
    accent-color: #FF6B00;
}

.ucomp-radio-label span {
    font-size: 13px;
    line-height: 1.3;
}

/* Grupos de filtro */
.ucomp-filter-group {
    margin-bottom: 20px;
}

.ucomp-filter-group:last-child {
    margin-bottom: 0;
}

/* ========== MAIN CONTENT ========== */
.ucomp-main {
    min-height: 400px;
}

.ucomp-results-header {
    background: #f0f0f1;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 15px;
    color: #666;
}

.ucomp-results-header strong {
    color: #6B2D7B;
    font-weight: 700;
}

/* ========== PROGRAMS GRID ========== */
.ucomp-programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* ========== SEPARADORES DE SECCIÓN ========== */
.ucomp-section-divider {
    grid-column: 1 / -1;
    padding: 10px 0 5px;
    border-bottom: 3px solid #6B2D7B;
    margin-top: 20px;
}

.ucomp-section-divider:first-child {
    margin-top: 0;
}

.ucomp-section-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #6B2D7B;
    margin: 0;
}

.ucomp-section-divider.ucomp-hidden {
    display: none;
}

/* ========== PROGRAM CARD ========== */
.ucomp-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.ucomp-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: #6B2D7B;
}

.ucomp-card.ucomp-hidden {
    display: none;
}

.ucomp-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f1;
}

.ucomp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ucomp-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ucomp-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ucomp-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

.ucomp-badge-virtual {
    background: #00A9E0;
}

.ucomp-badge-presencial {
    background: #FF6B00;
}

.ucomp-badge-snies {
    background: #6B2D7B;
}

.ucomp-card-title {
    font-size: 1.15em;
    font-weight: 700;
    color: #111111;
    margin: 0 0 12px 0;
    min-height: 50px;
    line-height: 1.3;
}

.ucomp-card-info {
    margin-bottom: 12px;
}

.ucomp-info-item {
    font-size: 13px;
    color: #666;
}

.ucomp-card-description {
    font-size: 14px;
    color: #777;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
}

.ucomp-btn {
    display: inline-block;
    background: #FF6B00;
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
}

.ucomp-btn:hover {
    background: #E05F00;
    color: white;
    text-decoration: none;
}

/* ========== BUSCADOR ========== */
.ucomp-search-box {
    position: relative;
    margin-bottom: 20px;
}

.ucomp-search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
}

.ucomp-search-input:focus {
    outline: none;
    border-color: #003D7A;
    box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.1);
}

.ucomp-search-input::placeholder {
    color: #999;
}

.ucomp-clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: #FF6B00;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ucomp-clear-search:hover {
    background: #E05F00;
}

/* ========== SIDEBAR STICKY (desktop + tablet) ========== */
@media (min-width: 769px) {
    .ucomp-container {
        align-items: start; /* evita que la sidebar se estire al alto del grid */
    }

    .ucomp-sidebar {
        position: sticky;
        top: 120px; /* altura del header fijo + respiro */
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .ucomp-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .ucomp-sidebar::-webkit-scrollbar-thumb {
        background: #9b59f5;
        border-radius: 10px;
    }
}

/* ========== RESPONSIVE ========== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .ucomp-container {
        grid-template-columns: 240px 1fr;
        gap: 20px;
    }

    .ucomp-programs-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .ucomp-title {
        font-size: 2em;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .ucomp-programs-wrapper {
        padding: 0 15px;
        margin: 20px auto;
    }

    .ucomp-title {
        font-size: 1.6em;
    }

    .ucomp-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Toggle button visible en mobile */
    .ucomp-filters-mobile-toggle {
        display: block;
        margin-bottom: 15px;
    }

    /* Filtros colapsables en mobile */
    .ucomp-filters {
        display: none;
        margin-top: 15px;
    }

    .ucomp-filters.ucomp-show {
        display: block;
    }

    .ucomp-programs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ucomp-card-image {
        height: 180px;
    }

    .ucomp-card-title {
        font-size: 1.1em;
        min-height: auto;
    }

    .ucomp-filter-title {
        font-size: 1em;
    }

    .ucomp-reset-btn {
        font-size: 13px;
        padding: 10px 15px;
    }

    .ucomp-education-link {
        font-size: 13px;
        padding: 12px 15px;
    }

    .ucomp-section-title {
        font-size: 1.1em;
    }
}

/* Small mobile (< 480px) */
@media (max-width: 480px) {
    .ucomp-title {
        font-size: 1.4em;
    }

    .ucomp-card-content {
        padding: 15px;
    }

    .ucomp-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}
/* ========================================
   AGREGADOS DEL PLUGIN
   ======================================== */

/* Modalidad híbrida */
.ucomp-badge-hibrida {
    background: #00A88F;
}

/* Shortcode con filtros="no": grid a ancho completo */
.ucomp-container.ucomp-container--full {
    grid-template-columns: 1fr;
}

/* Badge especial sin tooltip: no mostrar la burbuja vacía */
.ucomp-badge-acreditado:not([data-tooltip])::after {
    display: none;
}

.ucomp-badge-acreditado:not([data-tooltip]) {
    cursor: default;
}

/* Mensaje sin resultados */
.ucomp-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 15px;
}

.ucomp-empty[hidden] {
    display: none;
}

/* Botón "Ver más" siempre al final de la tarjeta */
.ucomp-card-content .ucomp-btn {
    margin-top: auto;
}


/* Sticky del buscador de programas: evita que la fila contenedora lo bloquee */
.vc_row:has(.ucomp-programs-wrapper),
.elementor-section:has(.ucomp-programs-wrapper),
.e-con:has(.ucomp-programs-wrapper) {
    overflow: clip !important;
}