/* =========================================
   BUSCADOR + HERO HEADER · MARATONEAR
   High specificity to override GeneratePress
   ========================================= */

/* ====== WRAPPER ====== */
#m-buscador-wrapper {
    margin-bottom: 30px;
    max-width: 100%;
}

/* ==========================================
   HERO HEADER
   Using #id selectors for GP override
   ========================================== */
#m-buscador-wrapper .m-hero {
    text-align: center !important;
    margin-bottom: 24px;
}

/* --- Franja Bandera --- */
#m-buscador-wrapper .m-flag-stripe {
    height: 6px !important;
    position: relative;
    display: block !important;
    width: 100% !important;
    background: linear-gradient(
        90deg,
        #74ACDF 30%,
        #ffffff 30%,
        #ffffff 70%,
        #74ACDF 70%
    ) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

#m-buscador-wrapper .m-flag-stripe--reverse {
    background: linear-gradient(
        270deg,
        #74ACDF 30%,
        #ffffff 30%,
        #ffffff 70%,
        #74ACDF 70%
    ) !important;
}

#m-buscador-wrapper .m-flag-stripe__sol {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50% !important;
    background: #FDB913 !important;
    border: 2px solid #fff !important;
    z-index: 2;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* --- Body del Hero --- */
#m-buscador-wrapper .m-hero__body {
    padding: 28px 0 20px;
    text-align: center !important;
}

#m-buscador-wrapper .m-hero__dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: #74ACDF !important;
    margin: 0 auto 12px !important;
    display: block !important;
    padding: 0 !important;
    border: none !important;
}

#m-buscador-wrapper .m-hero__sol {
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 14px !important;
}

#m-buscador-wrapper .m-hero__sol .sol-de-mayo-svg {
    animation: sol-spin 30s linear infinite;
}

/* --- Título MARATONEAR --- */
#m-buscador-wrapper .m-hero__title {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif !important;
    font-size: 2.6rem !important;
    font-weight: 900 !important;
    color: #1B396B !important;
    letter-spacing: -1.5px !important;
    line-height: 1 !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    text-align: center !important;
    text-transform: none !important;
    border: none !important;
}

#m-buscador-wrapper .m-hero__title .m-hero__a {
    color: #74ACDF !important;
}

#m-buscador-wrapper .m-hero__title .m-hero__r {
    color: #FDB913 !important;
}

/* --- Subtítulo --- */
#m-buscador-wrapper .m-hero__subtitle {
    font-family: 'Outfit', system-ui, sans-serif !important;
    font-size: 0.82rem !important;
    color: #74ACDF !important;
    margin: 0 !important;
    font-weight: 700 !important;
    letter-spacing: 5px !important;
    text-transform: uppercase !important;
    text-align: center !important;
}

@media (max-width: 600px) {
    #m-buscador-wrapper .m-hero__title {
        font-size: 1.8rem !important;
        letter-spacing: -1px !important;
    }
    #m-buscador-wrapper .m-hero__subtitle {
        font-size: 0.7rem !important;
        letter-spacing: 3px !important;
    }
    #m-buscador-wrapper .m-hero__body {
        padding: 20px 0 14px;
    }
}

/* ==========================================
   QUICK FILTERS
   ========================================== */
#m-buscador-wrapper .m-quick-filters {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: center;
}

#m-buscador-wrapper .m-quick-btn {
    font-family: 'Outfit', system-ui, sans-serif !important;
    background: #ffffff !important;
    color: #1B396B !important;
    border: 2px solid #74ACDF !important;
    border-radius: 50px !important;
    padding: 7px 18px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none !important;
    letter-spacing: 0.3px !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
}

#m-buscador-wrapper .m-quick-btn:hover {
    background: #74ACDF !important;
    color: #fff !important;
    transform: translateY(-1px);
}

#m-buscador-wrapper .m-quick-btn.active {
    background: #1B396B !important;
    color: #fff !important;
    border-color: #1B396B !important;
}

/* ==========================================
   FORMULARIO
   ========================================== */
#m-buscador-wrapper .m-search-box {
    font-family: 'Outfit', system-ui, sans-serif;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    align-items: end;
    border: 1px solid #E5E9EF;
}

#m-buscador-wrapper .m-field label {
    display: block !important;
    font-family: 'Outfit', system-ui, sans-serif !important;
    font-weight: 700 !important;
    margin-bottom: 5px !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    color: #1B396B !important;
    letter-spacing: 0.5px !important;
}

#m-buscador-wrapper .m-field select,
#m-buscador-wrapper .m-field input[type="text"] {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #E5E9EF !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: #374151 !important;
    background: #F8FAFB !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
}

#m-buscador-wrapper .m-field select:focus,
#m-buscador-wrapper .m-field input[type="text"]:focus {
    outline: none !important;
    border-color: #74ACDF !important;
    box-shadow: 0 0 0 3px rgba(116, 172, 223, 0.15) !important;
}

#m-buscador-wrapper .m-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 32px !important;
}

#m-buscador-wrapper .m-btn {
    font-family: 'Outfit', system-ui, sans-serif !important;
    background: linear-gradient(135deg, #FDB913, #F9A825) !important;
    color: #222 !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    width: 100%;
    cursor: pointer;
    font-weight: 800 !important;
    font-size: 0.9rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 42px;
    box-shadow: none !important;
}

#m-buscador-wrapper .m-btn:hover {
    background: linear-gradient(135deg, #E5A50A, #E8A000) !important;
    transform: translateY(-1px);
}

#m-buscador-wrapper .full-width { grid-column: 1 / -1; }

@media (min-width: 768px) {
    #m-buscador-wrapper .full-width { grid-column: span 2; }
}

/* ==========================================
   CHIPS
   ========================================== */
#m-buscador-wrapper .m-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    padding: 12px 16px;
    background: #F8FAFB;
    border-radius: 8px;
    border: 1px solid #E5E9EF;
}

#m-buscador-wrapper .m-active-label {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #1B396B;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

#m-buscador-wrapper .m-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

#m-buscador-wrapper .m-chip {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1px solid #74ACDF !important;
    border-radius: 50px !important;
    padding: 4px 10px !important;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 0.8rem;
    color: #1B396B;
    line-height: 1.4;
    animation: chipIn 0.2s ease;
}

@keyframes chipIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

#m-buscador-wrapper .m-chip__label { font-weight: 700; font-size: 0.75rem; }
#m-buscador-wrapper .m-chip__value { font-weight: 500; }

#m-buscador-wrapper .m-chip__remove {
    background: none !important;
    border: none !important;
    color: #9CA3AF !important;
    cursor: pointer;
    font-size: 0.75rem !important;
    padding: 0 2px !important;
    margin: 0 !important;
    line-height: 1;
    text-transform: none !important;
    letter-spacing: 0 !important;
    min-width: auto !important;
    box-shadow: none !important;
}
#m-buscador-wrapper .m-chip__remove:hover {
    color: #C62828 !important;
    background: none !important;
}

#m-buscador-wrapper .m-clear-all {
    font-family: 'Outfit', system-ui, sans-serif !important;
    background: none !important;
    border: 1px solid #9CA3AF !important;
    color: #6B7280 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    padding: 4px 12px !important;
    border-radius: 50px !important;
    cursor: pointer;
    text-transform: none !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
    box-shadow: none !important;
}
#m-buscador-wrapper .m-clear-all:hover {
    background: #C62828 !important;
    color: #fff !important;
    border-color: #C62828 !important;
}

/* ==========================================
   RESULTS BAR + LOADING
   ========================================== */
#m-buscador-wrapper .m-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    padding: 10px 0;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 0.9rem;
    color: #374151;
}

#m-buscador-wrapper #m-results-count {
    font-weight: 700;
    color: #1B396B;
}

#m-buscador-wrapper .m-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #9CA3AF;
}

.m-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #E5E9EF;
    border-top-color: #74ACDF;
    border-radius: 50% !important;
    animation: spin 0.6s linear infinite;
    background: none !important;
    padding: 0 !important;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================
   RESULTS CONTAINER
   ========================================== */
#m-results-container {
    margin-top: 20px;
    transition: opacity 0.2s ease;
}

/* ==========================================
   NO RESULTS
   ========================================== */
#m-results-container .m-no-results {
    text-align: center;
    padding: 60px 20px;
}
#m-results-container .m-no-results__sol {
    margin-bottom: 16px;
}
#m-results-container .m-no-results__title {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1B396B;
    margin-bottom: 8px;
}
#m-results-container .m-no-results__hint {
    font-size: 0.95rem;
    color: #9CA3AF;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 600px) {
    #m-buscador-wrapper .m-search-box {
        grid-template-columns: 1fr !important;
        padding: 15px;
        gap: 12px;
    }
    #m-buscador-wrapper .full-width { grid-column: 1 !important; }
    #m-buscador-wrapper .m-quick-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
        justify-content: flex-start;
    }
    #m-buscador-wrapper .m-quick-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    #m-buscador-wrapper .m-active-filters { padding: 10px 12px; }
}