/* Shared filter card (tests, packages, partners, voucher providers, health-center tests):
   one row of equal-height controls + result count and pager. */
.select-field.bg-color-3 { padding: 24px 0; }
.tabs-box .select-field { overflow: visible; }

.filter-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 24px;
    background: #fff;
    border: 1px solid #e6eef2;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 10px 30px rgba(0, 78, 117, 0.06);
}
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    flex: 1 1 560px;
    min-width: 0;
}
.filter-control { position: relative; flex: 0 0 220px; min-width: 0; }
.filter-control-wide { flex: 1 1 220px; }

/* Search field */
.filter-search { flex: 1 1 260px; }
.filter-search form { margin: 0; }
.filter-search .form-group { position: relative; margin: 0; }
.filter-search .relative { position: relative; width: 100%; }
.filter-search input[type="text"] {
    width: 100%;
    height: 44px;
    padding: 0 84px 0 18px;
    background: #fff;
    border: 1px solid #e5eded;
    border-radius: 30px;
    font-size: 15px;
    color: #1d2c3b;
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.filter-search input[type="text"]:focus {
    border-color: #00A0A3;
    box-shadow: 0 0 0 3px rgba(0, 160, 163, 0.12);
}
.filter-search button:not(.clear-btn) {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    line-height: 1;
    border: 0;
    border-radius: 50%;
    background: #00A0A3;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.filter-search .clear-btn {
    position: absolute;
    top: 50% !important;
    right: 44px !important;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    line-height: 1;
    border: 0;
    border-radius: 50%;
    background: #eef2f5;
    color: #6c7a89;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.filter-search .search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    z-index: 999;
}

/* Multi-select (Test Group): same border, height, font and arrow as the other controls.
   The theme sets a white border and a vmin font, so these need !important. */
.filter-card .select2-container--default .select2-selection--multiple {
    min-height: 44px !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: #fff;
    border: 1px solid #e5eded !important;
    border-radius: 30px !important;
    padding: 4px 40px 4px 14px !important;
    cursor: pointer;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.filter-card .select2-container--default .select2-selection--multiple::after {
    content: "";
    /* the theme draws an SVG chevron here; keep only the teal triangle used by every other dropdown */
    background: none !important;
    width: 0 !important;
    height: 0 !important;
    transform: none !important;
    position: absolute;
    top: 50%;
    right: 19px;
    margin-top: -3px;
    border-style: solid;
    border-width: 6px 5px 0 5px;
    border-color: #00A0A3 transparent transparent transparent;
    pointer-events: none;
}
.filter-card .select2-container--open .select2-selection--multiple::after {
    border-width: 0 5px 6px 5px;
    border-color: transparent transparent #00A0A3 transparent;
}
.filter-card .select2-container--default.select2-container--focus .select2-selection--multiple,
.filter-card .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #00A0A3 !important;
    box-shadow: 0 0 0 3px rgba(0, 160, 163, 0.12);
}
.filter-card .select2-selection--multiple .select2-selection__rendered { display: contents; }
.filter-card .select2-selection--multiple .select2-search--inline { flex: 1 1 60px; }
.filter-card .select2-selection--multiple .select2-search__field {
    margin: 0 !important;
    height: 22px !important;
    font-family: inherit !important;
    font-size: 15px !important;
    line-height: 22px;
    color: #4a5a6a;
}
.filter-card .select2-selection--multiple .select2-search__field::placeholder { color: #8a97a6; }
.filter-card .select2-selection--multiple .select2-selection__clear { display: none; }
/* Search input font: theme uses a vmin size */
.filter-card .filter-search input[type="text"] { font-size: 15px !important; font-family: inherit; }

/* Clear filters */
.filter-clear {
    height: 44px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #f3c6c6;
    border-radius: 30px;
    background: #fff5f5;
    color: #dc3545;
    font-weight: 500;
    cursor: pointer;
}

/* Result count + pager */
.filter-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    flex: 0 0 auto;
}
.filter-results { color: #004E75; font-weight: 600; font-size: 15px; white-space: nowrap; }
.filter-pager { display: flex; align-items: center; gap: 6px; }
.filter-pager-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5eded;
    border-radius: 50%;
    background: #fff;
    color: #004E75;
    transition: all 200ms ease;
}
.filter-pager-btn:hover { background: #00A0A3; border-color: #00A0A3; color: #fff; }
.filter-pager-btn.is-disabled { opacity: 0.4; pointer-events: none; }
.filter-pager-label { min-width: 52px; text-align: center; font-size: 14px; color: #4a5a6a; }

@media (max-width: 767px) {
    .select-field.bg-color-3 { padding: 16px 0; }
    .filter-card { padding: 12px; }
    .filter-control, .filter-control-wide, .filter-search { flex: 1 1 100%; }
    .filter-clear { width: 100%; justify-content: center; }
    .filter-meta { width: 100%; margin-left: 0; justify-content: space-between; }
}

/* Live filtering / pagination (site-live.js): dim swapped content and show a progress bar */
.live-loading [data-live-region] { opacity: 0.55; pointer-events: none; transition: opacity 150ms ease; }
.filter-card { position: relative; }
.filter-card::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, #00A0A3, transparent);
    background-size: 40% 100%;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none;
}
.live-loading .filter-card::after { opacity: 1; animation: live-progress 900ms linear infinite; }
@keyframes live-progress { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.filter-clear-slot { display: contents; }
