/*
 * Buscador de ubicacion en cascada.
 *
 * Estilos propios y con prefijo .bu- para que se vea igual en las tres
 * plantillas del sitio, que cargan hojas de estilo distintas y entre ellas
 * incompatibles. Sin esto, el buscador se veria diferente en cada una.
 */

.bu-ubicacion {
    font-family: inherit;
    color: #333;
    width: 100%;
}

/* --- Pais: no se elige, se informa --- */
.bu-pais {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

.bu-pais-etiqueta { color: #888; }

.bu-pais-valor {
    font-weight: 600;
    color: #333;
}

/* --- Chips con lo elegido --- */
.bu-resumen {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.bu-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef4ff;
    border: 1px solid #cfe0ff;
    border-radius: 14px;
    padding: 3px 6px 3px 10px;
    font-size: 12px;
    line-height: 1.6;
    color: #1a4d99;
    max-width: 100%;
}

.bu-chip-texto {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.bu-chip-x {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    color: #1a4d99;
    padding: 0 2px;
}

.bu-chip-x:hover { color: #c00; }

/* --- Los tres niveles --- */
.bu-niveles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bu-nivel {
    position: relative;
    flex: 1 1 180px;
    min-width: 150px;
}

.bu-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #888;
    margin-bottom: 4px;
    font-weight: 600;
}

.bu-caja {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    padding: 9px 11px;
    cursor: pointer;
    font-size: 14px;
    min-height: 40px;
    transition: border-color .15s;
}

.bu-caja:hover { border-color: #3483fa; }

.bu-caja-texto {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bu-caja-flecha {
    color: #999;
    font-size: 11px;
    flex-shrink: 0;
}

/* Un nivel se habilita recien cuando hay algo elegido arriba. */
.bu-caja.bu-deshabilitado {
    background: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.bu-caja.bu-deshabilitado:hover { border-color: #e0e0e0; }

/* --- Panel desplegable --- */
.bu-panel {
    position: absolute;
    z-index: 1000;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .14);
    padding: 8px;
    min-width: 230px;
}

.bu-buscar {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 7px 9px;
    font-size: 13px;
    margin-bottom: 6px;
}

.bu-buscar:focus {
    outline: none;
    border-color: #3483fa;
}

.bu-opciones {
    max-height: 260px;
    overflow-y: auto;
}

.bu-opcion {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: normal;
    margin: 0;
    border-radius: 3px;
}

.bu-opcion:hover { background: #f5f8ff; }

.bu-opcion input { margin: 0; flex-shrink: 0; cursor: pointer; }

.bu-opcion-nombre {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Cantidad de propiedades, como el "(12)" de MercadoLibre. */
.bu-opcion-total {
    color: #999;
    font-size: 11px;
    flex-shrink: 0;
}

.bu-cargando {
    color: #999;
    font-size: 12px;
    padding: 10px 4px;
    margin: 0;
    text-align: center;
}

/* --- Celulares: un nivel por fila --- */
@media (max-width: 640px) {
    .bu-niveles { flex-direction: column; }
    .bu-nivel { flex: 1 1 auto; width: 100%; }
    .bu-panel { position: static; box-shadow: none; margin-top: 6px; }
}
