/* ========================================
   CAR SELECTOR — Custom searchable dropdown
   ======================================== */

/* Dropdown wrapper */
.tr-car-dropdown-wrap {
    position: relative;
}

/* Dropdown panel */
.tr-car-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.tr-car-dropdown::-webkit-scrollbar {
    width: 6px;
}

.tr-car-dropdown::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

/* Dropdown item */
.tr-car-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.1s;
    border-bottom: 1px solid #f5f5f5;
}

.tr-car-dropdown__item:last-child {
    border-bottom: none;
}

.tr-car-dropdown__item:hover {
    background: #f8f8f8;
}

.tr-car-dropdown__item:active {
    background: #f0f0f0;
}

/* Brand logo in dropdown */
.tr-car-dropdown__logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    background: #f5f5f5;
    padding: 3px;
}

/* Empty state */
.tr-car-dropdown__empty {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Loading state */
.tr-car-dropdown__loading {
    padding: 16px;
    text-align: center;
    color: #888;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tr-car-dropdown__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #eee;
    border-top-color: #E63946;
    border-radius: 50%;
    animation: tr-car-spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes tr-car-spin {
    to { transform: rotate(360deg); }
}

/* Specs info bar */
.tr-car-selector__specs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #f0fdf4;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tr-car-selector__specs-check {
    color: #22c55e;
    font-weight: 700;
    font-size: 15px;
}

.tr-car-selector__specs-dot {
    color: #ccc;
    margin: 0 2px;
}

/* Focus state for inputs in selector */
.tr-car-dropdown-wrap input:focus {
    border-color: #E63946;
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
    border-radius: 8px 8px 0 0;
}

.tr-car-dropdown-wrap input:not(:focus) + .tr-car-dropdown {
    /* Auto-hide handled by JS but this is a safety net */
}

/* Mobile */
@media (max-width: 768px) {
    .tr-car-dropdown {
        max-height: 200px;
    }

    .tr-car-dropdown__item {
        padding: 8px 12px;
        font-size: 13px;
    }

    .tr-car-dropdown__logo {
        width: 24px;
        height: 24px;
    }
}
