/* Vehicle Combobox Styles */
.vehicle-combobox-wrapper {
    position: relative;
    width: 100%;
}

/* Hiding of selects is now managed via JS OR removed if standard selects are used */
/* .vehicle-combobox-wrapper+select,
select.select-make-hero,
select.select-model-hero,
select.select-year-hero,
select#select-make,
select#select-model,
select#select-year {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
    left: -9999px !important;
} */

/* Standard selects styling */
.vehicle-make-select,
.vehicle-model-select,
.vehicle-year-select {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    width: 100% !important;
    position: relative !important;
    left: 0 !important;
    pointer-events: auto !important;
    z-index: 1 !important;
}

.vehicle-combobox-input {
    width: 100%;
    cursor: pointer;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px;
    padding-left: 40px !important;
}

/* Pastikan input terlihat seperti search field, bukan dropdown */
.vehicle-combobox-input::placeholder {
    color: #999;
    opacity: 1;
}

/* Icon dropdown chevron di dalam input - menggunakan SVG */
.vehicle-combobox-wrapper::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.6;
    z-index: 1;
    transition: transform 0.2s;
}

.vehicle-combobox-wrapper.active::after {
    transform: translateY(-50%) rotate(180deg);
}

.vehicle-selector-hero-card .vehicle-combobox-wrapper::after,
.vehicle-selector-panel .vehicle-combobox-wrapper::after {
    right: 15px;
    width: 20px;
    height: 20px;
}

.vehicle-suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    /* Increased for better visibility */
    overflow: hidden;
    /* Changed from auto to hidden - scrolling handled by results container */
    z-index: 9999 !important;
    /* Pastikan z-index tinggi */
    display: none;
    margin-top: 2px;
    /* Ensure proper layout when visible */
    flex-direction: column;
}

/* Dropdown title (Popular Makes) */
.vehicle-suggestions-title {
    padding: 12px 15px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vehicle-suggestions-list:not(:empty) {
    display: flex !important;
    flex-direction: column !important;
}

/* Force show jika ada content */
.vehicle-suggestions-list[style*="display: block"],
.vehicle-suggestions-list[style*="display:block"],
.vehicle-suggestions-list[style*="display: flex"],
.vehicle-suggestions-list[style*="display:flex"] {
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
}

.vehicle-suggestions-results {
    max-height: 350px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-behavior: smooth;
    will-change: scroll-position;
    -ms-overflow-style: -ms-autohiding-scrollbar;
    position: relative;
    min-height: 0;
    flex: 1 1 auto;
    scrollbar-width: thin;
    scrollbar-color: #ff6b35 #f1f1f1;
}

.vehicle-suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    /* Better performance for many items */
    contain: layout style paint;
    /* Prevent text wrapping for cleaner look */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Ensure consistent height */
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.vehicle-suggestion-item:hover {
    background-color: #f5f5f5;
}

/* Selected item highlighting */
.vehicle-suggestion-item.selected {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: 600;
}

/* Arrow icon for hierarchical navigation */
.vehicle-suggestion-item::after {
    content: '→';
    color: #999;
    font-size: 16px;
    margin-left: 10px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.vehicle-suggestion-item:hover::after {
    opacity: 1;
    transform: translateX(2px);
}

.vehicle-suggestion-item.selected::after {
    color: #ff6b35;
    opacity: 1;
}

.vehicle-suggestion-item:last-child {
    border-bottom: none;
}

.match-highlight {
    color: #3BB77E;
    font-weight: 700;
}

/* Force scrollbar visibility for better UX awareness */
.vehicle-suggestions-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border: 2px solid #fff;
}

.vehicle-suggestions-loading,
.vehicle-suggestions-no-results,
.vehicle-suggestions-error {
    padding: 15px;
    text-align: center;
    color: #666;
}

.vehicle-suggestions-error {
    color: #d32f2f;
}

.vehicle-suggestions-loading-more {
    padding: 10px 15px;
    text-align: center;
    color: #999;
    font-size: 12px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

/* Results counter */
.vehicle-suggestions-counter {
    padding: 8px 15px;
    text-align: center;
    color: #666;
    font-size: 11px;
    border-top: 1px solid #f0f0f0;
    background: #f9f9f9;
    position: sticky;
    bottom: 0;
    z-index: 10;
    /* Ensure counter stays visible */
    flex-shrink: 0;
}

/* Optimize for many items - virtual scrolling support */
/* Note: Main styles for .vehicle-suggestions-results are defined above */

/* Compact mode for many items */
.vehicle-suggestions-list.has-many-items .vehicle-suggestion-item {
    padding: 8px 15px;
    font-size: 13px;
    min-height: 36px;
}

/* Ensure results container is properly sized when has many items */
.vehicle-suggestions-list.has-many-items .vehicle-suggestions-results {
    max-height: 350px;
}

/* Scrollbar styling - Make it more visible */
.vehicle-suggestions-results::-webkit-scrollbar {
    width: 10px;
    /* Increased for better visibility */
    display: block !important;
}

.vehicle-suggestions-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
    border-left: 1px solid #e0e0e0;
}

.vehicle-suggestions-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
    border: 1px solid #f1f1f1;
}

.vehicle-suggestions-results::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox scrollbar */
.vehicle-suggestions-results {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Integration with existing form styles */
.vehicle-selector-hero-card .vehicle-combobox-wrapper,
.vehicle-selector-panel .vehicle-combobox-wrapper {
    margin-bottom: 0;
}

.vehicle-selector-hero-card .vehicle-combobox-input,
.vehicle-selector-panel .vehicle-combobox-input {
    border: 1px solid #f1f1f1;
    background-color: #f7f8f9;
    height: 50px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    padding: 0 40px 0 40px !important;
    cursor: pointer;
}

/* Pastikan tidak ada arrow dropdown */
.vehicle-selector-hero-card .vehicle-combobox-input::-webkit-calendar-picker-indicator,
.vehicle-selector-panel .vehicle-combobox-input::-webkit-calendar-picker-indicator {
    display: none;
}

.vehicle-sidebar-filter .vehicle-combobox-input {
    height: 35px;
    font-size: 12px;
    padding: 0 10px;
}

/* Focus state */
.vehicle-combobox-input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.1);
}

/* Orange border on focus for hero card */
.vehicle-selector-hero-card .vehicle-combobox-input:focus {
    border-color: #ff6b35;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.15);
}

/* Disabled state */
.vehicle-combobox-input:disabled,
.vehicle-combobox-input[disabled] {
    background-color: #f5f5f5 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    pointer-events: none;
}

.vehicle-combobox-input:disabled::placeholder,
.vehicle-combobox-input[disabled]::placeholder {
    color: #999;
    opacity: 0.5;
}

/* Category Search Widget */
.category-search-widget .category-search-box input {
    padding-right: 35px;
    border-radius: 8px;
    border: 1px solid #ddd;
    height: 45px;
    font-size: 14px;
}

.category-search-widget .category-search-box input:focus {
    border-color: #ff6b35;
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.15);
}

/* Category Grid Improvements */
.category-grid-container {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.border-left-red {
    border-left: 4px solid #ff6b35 !important;
}

/* Sidebar Active State Fixes */
.category-filter-item {
    padding: 8px 0;
    transition: all 0.2s ease;
}

.category-filter-item:hover {
    padding-left: 5px;
}

/* Ensure button text is white for blue buttons */
.btn-fill-out {
    color: #ffffff !important;
}
.btn-fill-out:hover {
    color: #ffffff !important;
}

