/**
 * Unified Search — Tabbed dropdown (Businesses / Classifieds)
 */

/* ── Dropdown container ── */
.unified-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.16);
    border: 1px solid #e8eaf0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height .25s ease, opacity .2s ease, visibility .2s;
    z-index: 9999;
}
.unified-search-dropdown.active {
    max-height: 520px;
    overflow: visible;
    opacity: 1;
    visibility: visible;
}

/* ── Tabs ── */
.usd-tabs {
    display: flex;
    border-bottom: 1px solid #f0f2f7;
    padding: 0 12px;
    gap: 4px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: 14px 14px 0 0;
}
.usd-tab {
    flex: 1;
    padding: 11px 8px 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: #8b91a7;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}
.usd-tab.active {
    color: #333c51;
    border-bottom-color: #333c51;
}
.usd-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #eef0f5;
    color: #4a5068;
    font-size: 10px;
    font-weight: 700;
}
.usd-tab.active .usd-tab-count {
    background: #333c51;
    color: #fff;
}

/* ── Tab panels ── */
.usd-panel { display: none; overflow-y: auto; max-height: 420px; }
.usd-panel.active { display: block; }

/* ── Result item ── */
.usd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    transition: background .12s;
}
.usd-item:hover { background: #f7f8fa; }
.usd-item:not(:last-child) { border-bottom: 1px solid #f3f4f6; }

.usd-img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f2f7;
}
.usd-img-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #eef0f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #8b91a7;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}
.usd-content { flex: 1; min-width: 0; }
.usd-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1a1f2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Poppins', sans-serif;
}
.usd-title mark {
    background: none;
    color: #333c51;
    font-weight: 700;
}
.usd-meta {
    font-size: 11.5px;
    color: #8b91a7;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Poppins', sans-serif;
}
.usd-price {
    font-size: 13px;
    font-weight: 700;
    color: #333c51;
    flex-shrink: 0;
    font-family: 'Poppins', sans-serif;
}
.usd-arrow { color: #d1d5db; flex-shrink: 0; }

/* ── View all footer ── */
.usd-footer {
    padding: 10px 14px;
    border-top: 1px solid #f0f2f7;
    text-align: center;
}
.usd-footer a {
    font-size: 12.5px;
    font-weight: 600;
    color: #333c51;
    text-decoration: none;
}
.usd-footer a:hover { text-decoration: underline; }

/* ── Empty state ── */
.usd-empty {
    padding: 28px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
}

/* ── Loading ── */
.usd-loading {
    padding: 20px;
    text-align: center;
}
.usd-spinner {
    width: 20px; height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #333c51;
    border-radius: 50%;
    animation: usdSpin .6s linear infinite;
    display: inline-block;
}
@keyframes usdSpin { to { transform: rotate(360deg); } }

/* ── Mobile overrides ── */
@media (max-width: 768px) {
    .unified-search-dropdown {
        left: -14px;
        right: -14px;
        border-radius: 14px;
        box-shadow: 0 8px 32px rgba(0,0,0,.18);
    }
    .unified-search-dropdown.active { max-height: 44vh; overflow: visible; }
    .usd-panel { max-height: calc(44vh - 48px); }
    .usd-item { padding: 9px 12px; }
    .usd-img, .usd-img-placeholder { width: 40px; height: 40px; }
}

/* ── Scrollbar ── */
.usd-panel::-webkit-scrollbar { width: 4px; }
.usd-panel::-webkit-scrollbar-track { background: transparent; }
.usd-panel::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }