.content-search {
    margin: 16px 0 32px;
    padding: 20px;
    background: var(--brand-surface);
    border-radius: 16px;
    box-shadow: 0 10px 28px var(--brand-secondary-alpha-08);
    clear: both;
    position: relative;
    transition: opacity 0.18s ease;
}

.content-search.is-loading {
    opacity: 0.85;
    pointer-events: none;
}

.content-search.is-loading::after {
    content: "";
    position: absolute;
    top: 14px;
    right: 18px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgb(var(--brand-secondary-rgb) / 0.2);
    border-top-color: var(--brand-primary);
    animation: content-search-spin 0.8s linear infinite;
}

.content-search__label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: var(--brand-secondary-alt);
    margin-bottom: 10px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.content-search__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.content-search__field {
    flex: 1 1 280px;
    min-height: 46px;
    padding: 12px 16px;
    border: 1px solid var(--brand-border-muted);
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.35;
    color: var(--brand-secondary-alt);
    background: var(--brand-surface-wash);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.content-search__field:focus {
    outline: none;
    border-color: rgba(255, 122, 24, 0.65);
    box-shadow: 0 0 0 3px rgb(var(--brand-primary-rgb) / 0.2);
    background: var(--brand-surface);
}

.content-search__button {
    flex: 0 0 auto;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    background: linear-gradient(120deg, var(--brand-primary) 0%, #d86107 100%);
    color: var(--brand-surface);
    box-shadow: 0 14px 24px rgb(var(--brand-primary-rgb) / 0.18);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.content-search__button:hover,
.content-search__button:focus {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgb(var(--brand-primary-rgb) / 0.22);
    outline: none;
}

.content-search__actions {
    margin-top: 10px;
}

.content-search__reset {
    font-weight: 600;
    color: #d86107;
    text-decoration: none;
    transition: color 0.16s ease;
}

.content-search__reset:hover,
.content-search__reset:focus {
    color: var(--brand-primary);
    text-decoration: underline;
}

.content-search__summary {
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    background: var(--brand-secondary-alpha-08);
    color: var(--brand-secondary-alt);
}

.content-search__summary strong {
    font-weight: 700;
}

.content-search__summary--empty {
    background: var(--brand-primary-alpha-12);
    color: #d86107;
}

.content-search__summary-wrapper[data-empty="true"],
.content-search__actions-wrapper[data-empty="true"] {
    display: none;
}

/* =========================================
   FILTERS
========================================= */

.content-filters {
    margin: 0 0 32px;
    padding: 20px;
    border: 1px solid var(--brand-border-soft);
    border-radius: 16px;
    background: var(--brand-surface);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.content-filters__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
    flex: 1 1 180px;
}

.content-filters__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-secondary);
}

.content-filters__select {
    border-radius: 12px;
    border: 1px solid var(--brand-border-soft);
    padding: 10px 14px;
    font-size: 0.95rem;
    background: var(--brand-surface-soft);
    color: var(--brand-secondary);
}

.content-filters__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-chosen {
    width: 100%;
}

.filter-chosen .chosen-container {
    width: 100% !important;
    font-size: 0.95rem;
}

.filter-chosen .chosen-single {
    border-radius: 12px;
    border: 1px solid var(--brand-border-soft);
    background: var(--brand-surface-soft);
    padding: 10px 14px;
    height: auto;
    line-height: 1.4;
    color: var(--brand-secondary);
    box-shadow: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-chosen .chosen-single div b {
    background-position: 0 8px;
}

/* =========================================
   RESULT GRID (NOTICIAS / FICHAS)
========================================= */

.filter-chosen .chosen-drop {
    border-radius: 12px;
    border: 1px solid var(--brand-border-soft);
    box-shadow: var(--brand-shadow-soft);
}

.filter-chosen .chosen-search-input {
    border-radius: 10px;
    border: 1px solid var(--brand-border-soft);
    padding: 8px 10px;
}

.filter-chosen .chosen-results {
    max-height: 220px;
}

.filter-chosen .chosen-results li {
    padding: 8px 12px;
}

.filter-chosen .chosen-results li.highlighted {
    background: var(--brand-primary-alpha-12);
    color: var(--brand-secondary);
}

/* =========================================
   NOTICIAS GRID
========================================= */

#noticias {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
}

#noticias .clearfix {
    display: none;
}

#noticias .col-md-4,
#noticias .col-sm-6,
#noticias .col-lg-4 {
    display: flex;
    width: 100%;
    margin: 0;
}

#noticias .col-md-4 > div,
#noticias .col-sm-6 > div,
#noticias .col-lg-4 > div {
    width: 100%;
}

#noticias #end_noticias,
#noticias #fin-scroll {
    grid-column: 1 / -1;
}

#noticias .nws-inf2 h4 {
    font-size: clamp(1.3rem, 2.6vw, 1.7rem);
    line-height: 1.35;
    margin-bottom: 0.75rem;
    color: var(--brand-secondary);
    font-weight: 700;
}

#noticias .nws-inf2 h4 a {
    color: inherit;
}

#noticias .nws-inf2 p,
#noticias .nws-inf2 .description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--brand-muted);
    margin-bottom: 0;
}

#noticias .nws-inf2 .pst-mta {
    font-size: 0.95rem;
    gap: 1rem;
}

.nws-bx2 {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border-soft);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 360px;
    padding: 1rem;
    box-shadow: var(--brand-shadow-soft);
}

.nws-bx2 .nws-thmb2 {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.nws-bx2 .nws-inf2 {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nws-bx2 .nws-inf2 h4 {
    min-height: 3.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nws-bx2 .nws-inf2 .description {
    margin-top: auto;
    color: var(--brand-muted);
}

.nws-thmb2 img,
.nws-thmb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 3 / 2;
}

.content-filters__submit {
    border: none;
    border-radius: 999px;
    padding: 12px 24px;
    background: var(--brand-secondary);
    color: var(--brand-surface);
    font-weight: 600;
    cursor: pointer;
}

.filter-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--brand-secondary-alpha-08);
    color: var(--brand-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-reset {
    font-weight: 600;
    text-decoration: none;
    color: var(--brand-primary);
}

.filter-badges-row {
    width: 100%;
    border-radius: 16px;
    background: var(--brand-surface-soft);
    border: 1px dashed var(--brand-border-soft);
    padding: 14px 16px;
}

.filter-badges__label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--brand-secondary);
}

@media (max-width: 768px) {
    .content-search {
        padding: 14px;
        margin: 12px 0 20px;
    }

    .content-search__controls {
        flex-direction: column;
        gap: 8px;
    }

    .content-search__button {
        width: 100%;
        text-align: center;
    }

    .content-search__field {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
        padding: 11px 14px;
        font-size: 15px;
    }

    .content-search__actions-wrapper {
        text-align: center;
    }

    .content-filters {
        flex-direction: column;
    }

    .content-filters__actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@keyframes content-search-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
