/* ==========================================================================
   Search Improvements - UI.com Style
   ========================================================================== */

/* Search Results Header */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #E6E6E6;
}

.search-results-count {
    font-size: 14px;
    font-weight: 600;
    color: #212427;
}

.search-results-all {
    font-size: 14px;
    font-weight: 500;
    color: #006FFF;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.search-results-all:hover {
    color: #0059CC;
}

/* Popular Section Title */
.search-popular-title {
    padding: 12px 16px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #808893;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Search Item with Category */
.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.search-dropdown-item:hover {
    background-color: #F6F6F8;
}

.search-dropdown-item-image {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F9F9FA;
    border-radius: 6px;
    overflow: hidden;
}

.search-dropdown-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.search-dropdown-item-info {
    flex: 1;
    min-width: 0;
}

.search-dropdown-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #212427;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-dropdown-item-sku {
    font-size: 12px;
    color: #808893;
    line-height: 16px;
}

.search-dropdown-item-category {
    font-size: 12px;
    color: #006FFF;
    font-weight: 500;
    line-height: 16px;
    margin-left: auto;
    white-space: nowrap;
}

/* Dropdown improvements */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 9000;
    max-height: 420px;
    overflow-y: auto;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: rgba(33, 35, 39, 0.08) 0px 0px 1px 0px,
                rgba(33, 35, 39, 0.12) 0px 8px 24px 0px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-in-out;
}

.search-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-dropdown-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 14px;
    color: #808893;
}

.search-dropdown-loading {
    padding: 24px 16px;
    text-align: center;
    font-size: 14px;
    color: #808893;
}

/* Mobile Search Overlay - Full Screen */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background-color: #FFFFFF;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
}

.mobile-search-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #E6E6E6;
}

.mobile-search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #F6F6F8;
    border-radius: 8px;
}

.mobile-search-input-wrapper svg {
    width: 20px;
    height: 20px;
    color: #808893;
    flex-shrink: 0;
}

.mobile-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #212427;
    outline: none;
}

.mobile-search-input::placeholder {
    color: #808893;
}

.mobile-search-cancel {
    font-size: 14px;
    font-weight: 500;
    color: #006FFF;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
}

.mobile-search-results {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Desktop search pill improvements */
@media (min-width: 769px) {
    .search-bar-container {
        width: 320px;
        max-width: 320px;
    }

    .search-dropdown {
        width: 420px;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
    }

    .search-dropdown.visible {
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-bar-uicom {
        display: none;
    }

    .mobile-search-overlay .search-dropdown-item {
        padding: 12px 16px;
    }

    .mobile-search-overlay .search-dropdown-item-image {
        width: 48px;
        height: 48px;
    }

    .mobile-search-overlay .search-dropdown-item-name {
        font-size: 15px;
    }
}
