/* LWH Core 3.8.2 — Native project filters with progressive AJAX */
.lwh-project-filters,
.lwh-project-filters * { box-sizing: border-box; }

.lwh-project-filters {
    --lwh-filter-green: #1d6428;
    --lwh-filter-green-dark: #14501f;
    --lwh-filter-yellow: #f2c500;
    --lwh-filter-line: #d9e3d8;
    --lwh-filter-muted: #657169;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--lwh-filter-line);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff 0%, #fbfdfb 100%);
    box-shadow: 0 12px 30px rgba(29, 100, 40, .08);
}

.lwh-filter-primary {
    display: grid;
    grid-template-columns: minmax(230px, 1.55fr) repeat(3, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}

.lwh-filter-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.lwh-filter-field > span {
    color: #4d5e52;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1.2;
    text-transform: uppercase;
}

.lwh-filter-field input[type="search"] {
    width: 100%;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 0 14px 0 42px;
    border: 1px solid #cad7ca;
    border-radius: 10px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231d6428' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 14px center;
    color: #27302a;
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.lwh-filter-field input[type="search"]:focus,
.lwh-custom-select-trigger:focus-visible {
    border-color: var(--lwh-filter-green);
    box-shadow: 0 0 0 3px rgba(29, 100, 40, .12);
    outline: none;
}

.lwh-custom-select {
    position: relative;
    min-width: 0;
}

.lwh-native-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.lwh-custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 0 13px;
    border: 1px solid #cad7ca;
    border-radius: 10px;
    background: #fff;
    color: #27302a;
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.lwh-custom-select-trigger > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lwh-custom-select-trigger i {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-right: 2px solid var(--lwh-filter-green);
    border-bottom: 2px solid var(--lwh-filter-green);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .18s ease;
}

.lwh-custom-select.is-open .lwh-custom-select-trigger {
    border-color: var(--lwh-filter-green);
    box-shadow: 0 0 0 3px rgba(29, 100, 40, .12);
}

.lwh-custom-select.is-open .lwh-custom-select-trigger i {
    transform: rotate(225deg) translate(-2px, -1px);
}

.lwh-custom-select-menu {
    position: absolute;
    z-index: 9999;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    max-height: 260px;
    padding: 7px;
    overflow-y: auto;
    border: 1px solid #d4dfd3;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(28, 54, 34, .18);
}

.lwh-custom-select-menu[hidden] { display: none !important; }

.lwh-custom-select-option {
    display: block;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #29342c;
    font: inherit;
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.lwh-custom-select-option:hover,
.lwh-custom-select-option:focus-visible {
    background: #edf6ea;
    color: var(--lwh-filter-green-dark);
    outline: none;
}

.lwh-custom-select-option.is-selected {
    background: var(--lwh-filter-green);
    color: #fff;
    font-weight: 750;
}

.lwh-filter-lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: end;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid #e4ebe3;
}

.lwh-filter-advanced { min-width: 0; margin: 0; }

.lwh-filter-advanced summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--lwh-filter-green);
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}

.lwh-filter-advanced summary::marker { color: var(--lwh-filter-yellow); }

.lwh-filter-advanced-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(145px, 1fr));
    gap: 12px;
    margin-top: 11px;
}

.lwh-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 13px;
    min-height: 46px;
}

.lwh-filter-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 19px;
    border: 0;
    border-radius: 999px;
    background: var(--lwh-filter-green);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 7px 18px rgba(29, 100, 40, .18);
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.lwh-filter-actions button:hover,
.lwh-filter-actions button:focus-visible {
    background: var(--lwh-filter-green-dark);
    box-shadow: 0 9px 22px rgba(29, 100, 40, .24);
    transform: translateY(-1px);
    outline: none;
}

.lwh-filter-actions a {
    color: var(--lwh-filter-green);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.lwh-filter-actions a:hover { text-decoration: underline; }

.lwh-filter-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.lwh-project-filters.is-loading::after {
    content: "";
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(29, 100, 40, .18);
    border-top-color: var(--lwh-filter-green);
    border-radius: 50%;
    animation: lwh-filter-spin .7s linear infinite;
}

.lwh-results-loading {
    position: relative;
    min-height: 180px;
    opacity: .48;
    pointer-events: none;
    transition: opacity .18s ease;
}

.lwh-results-loading::after {
    content: "";
    position: absolute;
    z-index: 5;
    top: 44px;
    left: 50%;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    border: 3px solid rgba(29, 100, 40, .18);
    border-top-color: var(--lwh-filter-green);
    border-radius: 50%;
    animation: lwh-filter-spin .7s linear infinite;
}

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

@media (max-width: 900px) {
    .lwh-filter-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lwh-filter-search { grid-column: auto; }
    .lwh-filter-lower { grid-template-columns: 1fr; }
    .lwh-filter-actions { justify-content: flex-start; }
}

@media (max-width: 720px) {
    .lwh-project-filters { padding: 15px; }
    .lwh-filter-primary,
    .lwh-filter-advanced-grid { grid-template-columns: 1fr; }
    .lwh-filter-search { grid-column: auto; }
    .lwh-filter-actions { justify-content: space-between; }
    .lwh-filter-actions button { flex: 1 1 auto; }
    .lwh-custom-select-menu { position: fixed; top: auto; right: 14px; bottom: 14px; left: 14px; max-height: min(52vh, 420px); }
}

@media (prefers-reduced-motion: reduce) {
    .lwh-project-filters *, .lwh-results-loading { transition: none !important; }
}
