/* ════════════════════════════════════════════════════════════════
   citysearchauto.css
   Estilos del componente $.fn.findCity (autocomplete de ciudades).
   Mirror visual del person-search pero con palette del tema y
   layout adaptado a "ciudad + departamento + pais".
   Usa tokens institucionales con fallback HEX.
═══════════════════════════════════════════════════════════════════ */

.schciu-container {
    width: 100%;
    position: relative;
    font-family: 'Inter','Segoe UI','Open Sans',system-ui,sans-serif;
}

.schciu-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.schciu-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary, #2a3a58);
    letter-spacing: .2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.schciu-label i { color: var(--primary, #1565c0); font-size: 12px; }

.schciu-control {
    position: relative;
    width: 100%;
}

.schciu-input-main {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 36px 9px 34px;
    border: 1px solid var(--border, #e8ecf4);
    background: var(--bg-page, #f4f7fb);
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text-primary, #2a3a58);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.schciu-input-main:focus {
    border-color: var(--primary, #1565c0);
    background: var(--bg-surface, #fff);
    box-shadow: 0 0 0 3px var(--primary-soft, #e3f2fd);
}
.schciu-input-main::placeholder { color: var(--text-muted, #90a0bd); }

.schciu-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #90a0bd);
    font-size: 13px;
    pointer-events: none;
}
.schciu-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #90a0bd);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: color .15s ease;
}
.schciu-clear:hover { color: var(--danger, #d33); }

/* Estado seleccionado (chip compacto) */
.schciu-selected-view {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 38px 9px 14px;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--primary-soft, #e3f2fd);
    border-radius: 8px;
    position: relative;
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(20,25,40,.06));
}
.schciu-selected-view .schciu-sel-pin {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary-soft, #e3f2fd);
    color: var(--primary, #1565c0);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.schciu-selected-view .schciu-sel-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}
.schciu-selected-view .schciu-sel-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary, #2a3a58);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.schciu-selected-view .schciu-sel-loc {
    font-size: 11px;
    color: var(--text-secondary, #7a8aa3);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.schciu-selected-view .schciu-sel-loc i { font-size: 9px; margin-right: 3px; opacity: .8; }

/* Dropdown de resultados */
.schciu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border, #e8ecf4);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(20,25,40,.14);
    max-height: 320px;
    overflow: hidden;
}
.schciu-dropdown.hidden { display: none; }

.schciu-results {
    max-height: 320px;
    overflow-y: auto;
}
.schciu-results::-webkit-scrollbar { width: 6px; }
.schciu-results::-webkit-scrollbar-thumb {
    background: var(--border, #e8ecf4);
    border-radius: 3px;
}

.schciu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-soft, #eef0f5);
    transition: background .12s ease;
}
.schciu-item:last-child { border-bottom: none; }
.schciu-item:hover, .schciu-item.is-active {
    background: var(--primary-soft, #e3f2fd);
}
.schciu-item-pin {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--bg-page, #f4f7fb);
    color: var(--primary, #1565c0);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.schciu-item-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.schciu-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary, #2a3a58);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.schciu-item-meta {
    font-size: 11px;
    color: var(--text-secondary, #7a8aa3);
    line-height: 1.25;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}
.schciu-item-meta span { display: inline-flex; align-items: center; gap: 4px; }
.schciu-item-meta i { font-size: 9px; opacity: .8; }

/* Vacio / Cargando */
.schciu-empty, .schciu-loading {
    padding: 18px 14px;
    text-align: center;
    color: var(--text-muted, #90a0bd);
    font-size: 12.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.schciu-empty i, .schciu-loading i {
    font-size: 22px;
    color: var(--primary, #1565c0);
    opacity: .5;
}
.schciu-loading i { animation: schciuSpin 1s linear infinite; }
@keyframes schciuSpin {
    to { transform: rotate(360deg); }
}

.hidden { display: none !important; }
