/* ============================================
   PREMIUM SEARCH BAR STYLES
   Minimal, Elegant, Functional
   ============================================ */

.nav-search {
    position: relative;
    max-width: 400px;
    width: 100%;
    margin: 0 20px;
    z-index: 1001;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(147, 51, 234, 0.05);
    border: 1px solid rgba(147, 51, 234, 0.1);
    border-radius: 14px;
    padding: 2px 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-wrapper:focus-within {
    background: #ffffff;
    border-color: #9333ea;
    box-shadow: 0 4px 20px rgba(147, 51, 234, 0.15);
    transform: translateY(-1px);
}

.search-input-wrapper i {
    color: #9333ea;
    font-size: 16px;
    margin-right: 10px;
    opacity: 0.6;
}

#globalSearchInput {
    border: none;
    background: transparent;
    padding: 10px 0;
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    outline: none;
}

#globalSearchInput::placeholder {
    color: #9ca3af;
}

/* === Search Results Dropdown === */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(147, 51, 234, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
    max-height: 480px;
    overflow-y: auto;
    display: none;
    z-index: 1002;
    padding: 12px;
    animation: premiumFadeUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes premiumFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    margin-bottom: 6px;
    border: 1px solid transparent;
}

.search-result-item:hover {
    background: #ffffff;
    border-color: rgba(147, 51, 234, 0.1);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.08);
    transform: translateX(4px);
}

.result-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: #f3f4f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #111827;
}

.result-category {
    font-size: 10px;
    color: #9333ea;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
    opacity: 0.8;
}

.result-badge {
    font-size: 9px;
    background: #fdf2f8;
    color: #db2777;
    padding: 2px 8px;
    border-radius: 50px;
    width: fit-content;
    margin-top: 4px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid rgba(219, 39, 119, 0.1);
}

.result-price {
    font-size: 13px;
    font-weight: 800;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 6px 10px;
    border-radius: 10px;
}

.no-results {
    padding: 30px 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
    .nav-search {
        margin: 5px 0 10px;
        max-width: none;
        order: 2;
        /* Put below logo row but above tabs */
    }

    .search-input-wrapper {
        border-radius: 12px;
        padding: 0 10px;
    }

    #globalSearchInput {
        padding: 8px 0;
        font-size: 13px;
    }

    .search-results-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        max-height: 400px;
        z-index: 9999;
        /* Ensure it's above everything */
    }
}

@media (max-width: 480px) {
    .search-results-dropdown {
        max-height: 350px;
    }
}

/* Dark mode support */
body.dark-mode .search-results-dropdown {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .result-name {
    color: #f3f4f6;
}

body.dark-mode .search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}