/* ========================================
   Search & Filter UI Styles (extracted from custom.css)
   ======================================== */

/* Mobile Header Search Input */
.mobile-menu-container .mobile-menu-wrapper #mobile-search {
    background-color: white;
    border-color: #ff6c00;
    color: black;
}

.mobile-menu-container .mobile-menu-wrapper #mobile-search::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

/* Header Search Input Styling - Bottom Border/Underline */
.header-search .header-search-wrapper input.form-control {
    border: none;
    border-bottom: 2px solid #e0e0e0;
    border-radius: 0;
    padding-left: 0;
    transition: border-color 0.3s ease;
}

.header-search .header-search-wrapper input.form-control:focus {
    border-bottom-color: #ff6c00;
    box-shadow: none;
    outline: none;
}

.header-search .header-search-wrapper input.form-control::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* Search Autocomplete Dropdown */
.search-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 450px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 5px;
    box-sizing: border-box;
}

/* Make dropdown wider on desktop screens but stay within viewport */
@media screen and (min-width: 992px) {
    .header-search .search-autocomplete-dropdown {
        left: 0;
        right: auto;
        min-width: 500px;
        max-width: 600px;
        width: max-content;
    }
}

@media screen and (min-width: 1200px) {
    .header-search .search-autocomplete-dropdown {
        min-width: 600px;
        max-width: 700px;
    }
}

.search-autocomplete-dropdown.show {
    display: block;
}

.search-autocomplete-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
    text-decoration: none;
    color: #333;
}

.search-autocomplete-item:last-child {
    border-bottom: none;
}

.search-autocomplete-item:hover {
    background-color: #fdf9ed;
}

.search-autocomplete-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Larger images on desktop */
@media screen and (min-width: 992px) {
    .search-autocomplete-item-image {
        width: 60px;
        height: 60px;
        margin-right: 15px;
    }
}

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

/* Meta info (brand • category) - small, gray */
.search-autocomplete-item-meta {
    font-size: 11px;
    color: #999;
    margin-bottom: 3px;
    letter-spacing: 0.3px;
}

/* Legacy - for backward compatibility */
.search-autocomplete-item-category {
    font-size: 11px;
    color: #999;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-autocomplete-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* English name - gray, below Chinese name */
.search-autocomplete-item-english {
    font-size: 12px;
    color: #777;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-autocomplete-item-price {
    font-size: 13px;
    color: #ff6c00;
    font-weight: 600;
}

.search-autocomplete-loading,
.search-autocomplete-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-autocomplete-view-all {
    display: block;
    padding: 12px;
    text-align: center;
    background: #f9f9f9;
    color: #ff6c00;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    transition: background-color 0.2s ease;
}

.search-autocomplete-view-all:hover {
    background-color: #fdf9ed;
    color: #ff6c00;
}

/* Positioning helpers */
.header-search-wrapper {
    position: relative;
    overflow: visible;
}

@media screen and (max-width: 991px) {
    .header-search .search-autocomplete-dropdown {
        left: 0 !important;
        right: 0 !important;
        max-width: 100%;
    }
}

.header-search {
    position: relative;
}

.header-middle .container {
    position: relative;
}

/* Mobile Search Autocomplete */
.mobile-search {
    position: relative;
}

.mobile-search .search-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 5px;
}

/* Search Keyword Highlight */
mark.search-highlight {
    background-color: #fff3e0;
    color: #ff6c00;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
    border: none;
}

/* Match context snippet (shows why product matched) */
.search-autocomplete-item-context {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
    margin-bottom: 3px;
    line-height: 1.4;
    font-style: italic;
}

.search-autocomplete-item-context mark.search-highlight {
    font-style: normal;
}

/* Shop Filter Panel Styling */
.sidebar-shop .widget-collapsible .widget-title {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.sidebar-shop .widget-collapsible .widget-title a {
    font-size: inherit;
}

.sidebar-shop .widget-collapsible .widget-title.filter-active a {
    color: #ff6c00;
    font-weight: 600;
}

.filter-count-badge {
    display: inline-block;
    background-color: #ff6c00;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}

.widget-title.filter-active a::before {
    content: "✓";
    display: inline-block;
    margin-right: 8px;
    font-weight: bold;
    color: #ff6c00;
    font-size: 1.3rem;
}


