/* ============================================================
   Dual Search Pro — Frontend Styles v1.1
   ============================================================ */

:root {
    --dsp-accent:      #0076d3;
    --dsp-radius:      14px;
    --dsp-font-size:   14px;
    --dsp-text-color:  #2d3748;
    --dsp-ph-color:    #b0bac4;
    --dsp-icon-size:   18px;
    --dsp-icon-color:  #aab4be;
    --dsp-icon-active: #0076d3;
}

.dsp-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Main Bar ---- */
.dsp-bar {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #e0e6ed;
    border-radius: var(--dsp-radius);
    padding: 0 10px 0 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    min-height: 52px;
}

.dsp-bar:focus-within {
    border-color: var(--dsp-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsp-accent) 15%, transparent);
}

/* ---- Halves ---- */
.dsp-half {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    min-width: 0;
    padding: 0 8px;
}

.dsp-half-icon {
    flex-shrink: 0;
    width: var(--dsp-icon-size);
    height: var(--dsp-icon-size);
    color: var(--dsp-icon-color);
    display: flex;
    align-items: center;
    margin-right: 8px;
    transition: color 0.2s;
}

.dsp-half-icon svg {
    width: var(--dsp-icon-size);
    height: var(--dsp-icon-size);
}

.dsp-half:focus-within .dsp-half-icon {
    color: var(--dsp-icon-active);
}

/* ---- Input ---- */
.dsp-input {
    flex: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: var(--dsp-font-size) !important;
    color: var(--dsp-text-color) !important;
    padding: 14px 0 !important;
    margin: 0 !important;
    text-indent: 0 !important;
    font-family: inherit !important;
}

.dsp-input::placeholder {
    color: var(--dsp-ph-color) !important;
}

/* ---- Divider ---- */
.dsp-divider {
    width: 1px;
    height: 24px;
    background: #e0e6ed;
    flex-shrink: 0;
    margin: 0 2px;
}

/* ---- Optional Search Button ---- */
.dsp-search-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: var(--dsp-accent);
    border: none;
    border-radius: calc(var(--dsp-radius) - 4px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    margin-left: 4px;
}

.dsp-search-btn:hover {
    filter: brightness(0.9);
    transform: scale(1.05);
}

/* ============================================================
   DROPDOWN — shared
   ============================================================ */
.dsp-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: -12px;
    right: 0;
    background: #ffffff;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.13);
    z-index: 999999;
    display: none;
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
    animation: dspFadeIn 0.15s ease;
}

.dsp-dropdown.dsp-open { display: block; }

@keyframes dspFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dsp-dropdown::-webkit-scrollbar { width: 4px; }
.dsp-dropdown::-webkit-scrollbar-track { background: transparent; }
.dsp-dropdown::-webkit-scrollbar-thumb { background: #dde3ea; border-radius: 4px; }

/* ============================================================
   BRAND RESULTS
   ============================================================ */
.dsp-brand-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f4f6f8;
    transition: background 0.12s;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.dsp-brand-item:last-child { border-bottom: none; }
.dsp-brand-item:hover,
.dsp-brand-item[aria-selected=true] { background: #f0f7ff; }

.dsp-brand-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }

.dsp-brand-logo {
    width: 34px; height: 34px; object-fit: contain;
    border-radius: 8px; background: #f8f9fb;
    border: 1px solid #eee; flex-shrink: 0;
}

.dsp-brand-logo-placeholder {
    width: 34px; height: 34px; border-radius: 8px;
    background: linear-gradient(135deg, #e8f3ff, #d0e8ff);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: var(--dsp-accent); flex-shrink: 0;
}

.dsp-brand-text { min-width: 0; overflow: hidden; }
.dsp-brand-name { font-size: 13.5px; font-weight: 600; color: #1a2332; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.dsp-brand-sub  { font-size: 11.5px; color: #888; text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.dsp-brand-arrow { color: #c8d0d9; font-size: 14px; flex-shrink: 0; }

/* ============================================================
   LOCATION RESULTS
   ============================================================ */
.dsp-loc-item {
    display: flex; align-items: center;
    padding: 11px 14px; cursor: pointer;
    border-bottom: 1px solid #f4f6f8;
    transition: background 0.12s;
    font-size: 13.5px; color: #2d3748; gap: 10px;
}
.dsp-loc-item:last-child { border-bottom: none; }
.dsp-loc-item:hover,
.dsp-loc-item[aria-selected=true] { background: #f0f7ff; }

.dsp-loc-item.dsp-loc-gps {
    color: var(--dsp-accent); font-weight: 600;
    background: #f8fbff; border-bottom: 2px solid #eef4fb;
}
.dsp-loc-icon { font-size: 15px; flex-shrink: 0; }
.dsp-loc-text { flex: 1; min-width: 0; }
.dsp-loc-name  { display: block; font-weight: 500; }
.dsp-loc-state { font-size: 11.5px; color: #aaa; }

/* ---- Misc ---- */
.dsp-no-results { padding: 16px 14px; text-align: center; font-size: 13px; color: #aaa; }
.dsp-loading    { padding: 14px; text-align: center; color: #aaa; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.dsp-spinner    { width: 16px; height: 16px; border: 2px solid #e0e6ed; border-top-color: var(--dsp-accent); border-radius: 50%; animation: dspSpin 0.6s linear infinite; }
@keyframes dspSpin { to { transform: rotate(360deg); } }

/* ---- Mobile ---- */
@media (max-width: 600px) {
    .dsp-bar { padding: 0 6px 0 2px; min-height: 48px; }
    .dsp-half { padding: 0 4px; }
    .dsp-divider { margin: 0; }
}
