.mobile-search-section,
.header-search,
.universal-search-form {
    position: relative;
}

.mobile-search-section form,
.header-search form {
    position: relative;
    z-index: 2;
}

.header-search .search-wrapper {
    position: relative;
}

.universal-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
    display: none;
    animation: usd-fade-in 0.2s ease;
    -webkit-overflow-scrolling: touch;
}

.universal-search-dropdown.active {
    display: block;
}

.desktop-dropdown {
    top: calc(100% + 6px);
    max-height: 75vh;
    border-radius: 8px;
}

@keyframes usd-fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .universal-search-dropdown {
        position: fixed;
        top: auto;
        left: 8px;
        right: 8px;
        max-height: 75vh;
        border-radius: 8px;
    }
    
    .desktop-dropdown {
        display: none !important;
    }
}

.usd-loading {
    padding: 24px 16px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

.usd-loading .fa-spinner {
    margin-right: 6px;
    color: #e74c3c;
}

.usd-empty {
    padding: 32px 16px;
    text-align: center;
    color: #6c757d;
}

.usd-empty .fa {
    font-size: 32px;
    color: #d1d5db;
    margin-bottom: 8px;
}

.usd-empty p {
    margin: 8px 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.usd-empty small {
    color: #9ca3af;
    font-size: 12px;
}

.usd-error {
    padding: 16px;
    background: #fff3cd;
    color: #856404;
    border-bottom: 1px solid #ffeeba;
    font-size: 13px;
    text-align: center;
}

.usd-error .fa {
    margin-right: 6px;
}

.usd-group {
    border-bottom: 1px solid #f1f3f5;
}

.usd-group:last-child {
    border-bottom: none;
}

.usd-group-header {
    padding: 10px 14px 8px;
    background: #fafbfc;
    border-left: 3px solid #ccc;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.usd-group-header .fa {
    font-size: 13px;
}

.usd-group-header small {
    color: #adb5bd;
    font-weight: 500;
    margin-left: auto;
}

.usd-group-items {
    padding: 4px 0;
}

.usd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #212529;
    text-decoration: none;
    border-bottom: 1px solid #f8f9fa;
    transition: background 0.15s ease;
    cursor: pointer;
}

.usd-item:last-child {
    border-bottom: none;
}

.usd-item:hover,
.usd-item.active,
.usd-item:focus {
    background: #f8f9fa;
    text-decoration: none;
    color: #212529;
}

.usd-item-content {
    flex: 1;
    min-width: 0;
}

.usd-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usd-item-desc {
    font-size: 11px;
    color: #6c757d;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usd-item-price {
    font-size: 13px;
    font-weight: 700;
    color: #e74c3c;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (min-width: 769px) {
    .desktop-dropdown .usd-item {
        padding: 12px 16px;
    }
    
    .desktop-dropdown .usd-item-title {
        font-size: 14px;
    }
    
    .desktop-dropdown .usd-item-desc {
        font-size: 12px;
    }
    
    .desktop-dropdown .usd-item-price {
        font-size: 14px;
    }
}

.usd-item mark {
    background: #fff3a0;
    color: #1a1a1a;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}

.usd-footer {
    padding: 8px 14px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.usd-view-all {
    display: block;
    text-align: center;
    padding: 8px 12px;
    background: #e74c3c;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}

.usd-view-all:hover,
.usd-view-all:focus {
    background: #c0392b;
    color: #fff;
    text-decoration: none;
}

.usd-view-all .fa {
    margin-right: 4px;
}

.usd-recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #fafbfc;
    border-bottom: 1px solid #f1f3f5;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
}

.usd-recent-header .fa {
    margin-right: 4px;
}

.usd-clear-recent {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.usd-clear-recent:hover {
    background: #fff0f0;
}

.usd-recent-list {
    padding: 4px 0;
}

.usd-recent-item {
    display: block;
    padding: 8px 14px;
    color: #495057;
    font-size: 13px;
    text-decoration: none;
    border-bottom: 1px solid #f8f9fa;
    transition: background 0.15s ease;
}

.usd-recent-item:hover {
    background: #f8f9fa;
    color: #e74c3c;
    text-decoration: none;
}

.usd-recent-item .fa {
    color: #adb5bd;
    margin-right: 8px;
    font-size: 11px;
}

.universal-search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.universal-search-dropdown::-webkit-scrollbar-track {
    background: #f1f3f5;
}

.universal-search-dropdown::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

.universal-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}