/* Header Smart Search Styling */

.hz-header-smart-search-wrapper {
    position: relative;
}

.hz-header-smart-search-wrapper .search-icon {
    position: relative !important;
}

.hz-header-smart-search-wrapper .form-group {
    position: relative !important;
    margin-bottom: 0;
}

.hz-header-smart-search-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    position: relative;
    min-height: 42px;
    width: 100%;
    background-color: #fff;
    border-radius: 5px;
}

.hz-header-smart-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-right: 4px;
    align-items: center;
    flex-shrink: 0;
    margin-left: 40px; /* Space for search icon */
}

.hz-header-smart-search-wrapper .hz-chip {
    display: inline-flex;
    align-items: center;
    background-color: #e2f0ff;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    color: #1a4d8f;
    line-height: 1.4;
    white-space: nowrap;
}

.hz-header-smart-search-wrapper .hz-chip-city {
    background-color: #e2f0ff;
    color: #1a4d8f;
}

.hz-header-smart-search-wrapper .hz-chip-state {
    background-color: #fff4e6;
    color: #8b5a00;
}

.hz-header-smart-search-wrapper .hz-chip-area {
    background-color: #f0e6ff;
    color: #5a1a8b;
}

.hz-header-smart-search-wrapper .hz-chip-keyword {
    background-color: #f3f5f6;
    color: #444;
}

.hz-header-smart-search-wrapper .hz-chip-label {
    margin-right: 4px;
}

.hz-header-smart-search-wrapper .hz-chip-remove {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    color: #777;
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.hz-header-smart-search-wrapper .hz-chip-remove:hover {
    color: #333;
}

.hz-header-smart-search-wrapper .hz-header-smart-input {
    flex: 1 1 auto;
    min-width: 100px;
    box-shadow: none !important;
    padding: 0 12px !important;
    height: 42px;
    font-size: 14px;
    background-color: #fff;
    margin-left: 0;
    border: 0px !important;
}

/* If no chips, add left padding for icon */
.hz-header-smart-chips:empty ~ .hz-header-smart-input {
    padding-left: 10px !important;
}

/* If chips exist, reduce left padding */
.hz-header-smart-chips:not(:empty) ~ .hz-header-smart-input {
    padding-left: 8px !important;
}

.hz-header-smart-search-wrapper .hz-header-smart-input:focus {
    outline: none;
    border-color: #dce0e0;
    box-shadow: none;
}

/* Suggestions dropdown */
.hz-header-smart-suggestions,
#auto_complete_ajax.hz-header-smart-suggestions,
.auto-complete.hz-header-smart-suggestions,
#auto_complete_ajax,
.auto-complete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    z-index: 9999;
    display: none;
}

.hz-header-smart-suggestions.show,
#auto_complete_ajax.hz-header-smart-suggestions.show,
.auto-complete.hz-header-smart-suggestions.show,
#auto_complete_ajax.show,
.auto-complete.show {
    display: block !important;
    visibility: visible !important;
}

.hz-header-smart-suggestions > div,
#auto_complete_ajax > div,
.auto-complete > div {
    background: #ffffff;
    border: 1px solid #dce0e0;
    border-radius: 4px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.12);
    max-height: 300px;
    overflow-y: auto;
}

.hz-header-smart-suggestions .hz-smart-group,
#auto_complete_ajax .hz-smart-group,
.auto-complete .hz-smart-group {
    padding: 6px 8px;
}

.hz-header-smart-suggestions .hz-smart-group-title,
#auto_complete_ajax .hz-smart-group-title,
.auto-complete .hz-smart-group-title {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 4px;
    padding: 4px 8px;
}

.hz-header-smart-suggestions .hz-smart-group ul,
#auto_complete_ajax .hz-smart-group ul,
.auto-complete .hz-smart-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hz-header-smart-suggestions .hz-smart-item,
#auto_complete_ajax .hz-smart-item,
.auto-complete .hz-smart-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.hz-header-smart-suggestions .hz-smart-item:last-child,
#auto_complete_ajax .hz-smart-item:last-child,
.auto-complete .hz-smart-item:last-child {
    border-bottom: none;
}

.hz-header-smart-suggestions .hz-smart-item:hover,
#auto_complete_ajax .hz-smart-item:hover,
.auto-complete .hz-smart-item:hover {
    background-color: #f8f9fa;
}

.hz-header-smart-suggestions .hz-smart-item-label,
#auto_complete_ajax .hz-smart-item-label,
.auto-complete .hz-smart-item-label {
    display: block;
    font-size: 13px;
    color: #333;
}

/* Highlight matching text in red */
.hz-match-highlight {
    color: red;
    font-weight: bold;
}

/* Hidden fields container */
.hz-header-smart-hidden {
    display: none;
}

/* Ensure search icon is visible and positioned correctly */
.hz-header-smart-search-wrapper .search-icon {
    position: relative;
}

.hz-header-smart-search-wrapper .search-icon:before {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
}

/* When chips are present, adjust their margin */
.hz-header-smart-chips:not(:empty) {
    margin-left: 40px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .hz-header-smart-search-wrapper .hz-chip {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .hz-header-smart-search-inner {
        min-height: 40px;
    }
    
    .hz-header-smart-search-wrapper .hz-header-smart-input {
        height: 40px;
        font-size: 13px;
    }
    
    .hz-header-smart-suggestions,
    #auto_complete_ajax,
    .auto-complete {
        max-height: 250px;
    }
    
    .hz-header-smart-suggestions .hz-smart-item,
    #auto_complete_ajax .hz-smart-item,
    .auto-complete .hz-smart-item {
        padding: 6px 10px;
    }
    
    .hz-header-smart-suggestions .hz-smart-item-label,
    #auto_complete_ajax .hz-smart-item-label,
    .auto-complete .hz-smart-item-label {
        font-size: 12px;
    }
}

