/* Selector con búsqueda para la ubicación del Home.
   El select original continúa disponible cuando JavaScript no se ejecuta. */
.home-search-location .home-location-combobox {
    position: relative;
    width: 100%;
    min-width: 0;
    flex: 1;
}
.home-search-location .home-location-combobox.is-open {
    z-index: 40;
}
.home-search-location select.home-department-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    clip-path: inset(50%);
    pointer-events: none;
}
.home-location-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    min-height: 29px;
    width: 100%;
    min-width: 0;
    padding: 0 3px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #17352f;
    cursor: pointer;
    font: inherit;
    font-size: .84rem;
    text-align: left;
}
.home-location-trigger:focus-visible {
    outline: 2px solid #159b80;
    outline-offset: 3px;
}
.home-location-selected {
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.home-location-chevron {
    flex: 0 0 auto;
    color: #149679;
    font-size: 1.15rem;
    line-height: 1;
    transition: transform .18s ease;
}
.home-location-combobox.is-open .home-location-chevron {
    transform: rotate(180deg);
}
/* La lista vive en body, por fuera de .home-hero (overflow:hidden).
   Su posición y tamaño se ajustan al botón y al viewport con JavaScript. */
body > .home-location-popover {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 300;
    width: min(310px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: 310px;
    overflow: hidden;
    padding: 9px;
    border: 1px solid #cce8d7;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(15, 62, 46, .17);
}
.home-location-popover[hidden],
.home-department-empty[hidden] {
    display: none !important;
}
.home-location-popover .home-department-search-input {
    display: block;
    width: 100%;
    height: 41px;
    min-height: 41px;
    margin: 0 0 8px;
    padding: 9px 12px;
    border: 1px solid #cde6d8;
    border-radius: 9px;
    background: #f7fcf9;
    color: #1a4435;
    font: inherit;
    font-size: .82rem;
    outline: none;
}
.home-location-popover .home-department-search-input:focus {
    border-color: #159b80;
    box-shadow: 0 0 0 3px rgba(21, 155, 128, .12);
}
.home-department-options {
    max-height: min(245px, 37dvh);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.home-department-option {
    display: block;
    width: 100%;
    min-height: 39px;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #355f4d;
    text-align: left;
    font: inherit;
    font-size: .8rem;
    line-height: 1.3;
    cursor: pointer;
}
.home-department-option:hover,
.home-department-option.is-active {
    background: #e8f8ef;
    color: #0b795f;
}
.home-department-option.is-selected {
    font-weight: 850;
    color: #098367;
}
.home-department-option.is-selected::before {
    content: "✓ ";
}
.home-department-option:focus-visible {
    outline: 2px solid #159b80;
    outline-offset: -2px;
}
.home-department-empty {
    margin: 0;
    padding: 12px 8px;
    color: #778e80;
    text-align: center;
    font-size: .78rem;
}
@media (max-width: 680px) {
    body > .home-location-popover {
        max-width: calc(100vw - 24px);
        border-radius: 12px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .home-location-chevron {
        transition: none !important;
    }
}
