/* Brand Model Selector Styles */
.brand-model-selector-wrapper {
    max-width: 100%;
    margin: 20px 0;
    font-family: inherit;
}

.brand-model-selector-form {
    background: #fff;
    padding: 25px;
    /* border-radius: 8px; */
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
    /* border: 1px solid #e1e5e9; */
}

.bms-form-row {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.bms-field-group {
    flex: 1;
    min-width: 200px;
}

.bms-field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.bms-select {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.bms-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.bms-select:disabled {
    background-color: #f7f7f7;
    color: #999;
    cursor: not-allowed;
}

.bms-button-group {
    flex-shrink: 0;
    min-width: 140px;
}

.bms-submit-btn {
    width: 100%;
    height: 44px;
    background-color: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bms-submit-btn:hover:not(:disabled) {
    background-color: #005a87;
    transform: translateY(-1px);
}

.bms-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.bms-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.bms-messages {
    margin-top: 15px;
}

.bms-error {
    padding: 12px 16px;
    background-color: #ffeaea;
    border: 1px solid #ff6b6b;
    border-radius: 4px;
    color: #d63031;
    font-size: 14px;
    font-weight: 500;
}

.bms-loading {
    padding: 12px 16px;
    background-color: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 4px;
    color: #1976d2;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bms-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e3f2fd;
    border-top: 2px solid #1976d2;
    border-radius: 50%;
    animation: bms-spin 1s linear infinite;
}

@keyframes bms-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Select2 Custom Styling */
.brand-model-selector-wrapper .select2-container {
    width: 100% !important;
}

.brand-model-selector-wrapper .select2-selection--single {
    height: 44px !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 4px !important;
    padding: 0 !important;
}

.brand-model-selector-wrapper .select2-selection__rendered {
    line-height: 40px !important;
    padding-left: 12px !important;
    color: #333 !important;
}

.brand-model-selector-wrapper .select2-selection__placeholder {
    color: #999 !important;
}

.brand-model-selector-wrapper .select2-selection__arrow {
    height: 40px !important;
    top: 2px !important;
    right: 8px !important;
}

.brand-model-selector-wrapper .select2-container--focus .select2-selection--single {
    border-color: #007cba !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1) !important;
}

.brand-model-selector-wrapper .select2-dropdown {
    border: 2px solid #007cba !important;
    border-top: none !important;
    border-radius: 0 0 4px 4px !important;
}

.brand-model-selector-wrapper .select2-search--dropdown .select2-search__field {
    border: 1px solid #e1e5e9 !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    margin: 8px !important;
    width: calc(100% - 16px) !important;
}

.brand-model-selector-wrapper .select2-results__option {
    padding: 10px 12px !important;
    font-size: 14px !important;
}

.brand-model-selector-wrapper .select2-results__option--highlighted {
    background-color: #007cba !important;
}

.brand-model-selector-wrapper .select2-container--disabled .select2-selection--single {
    background-color: #f7f7f7 !important;
    cursor: not-allowed !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bms-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .bms-field-group {
        min-width: 100%;
    }
    
    .bms-button-group {
        min-width: 100%;
    }
    
    .brand-model-selector-form {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .brand-model-selector-form {
        padding: 15px 10px;
    }
    
    .bms-form-row {
        gap: 12px;
    }
}

/* Integration with common WordPress themes */
.brand-model-selector-wrapper * {
    box-sizing: border-box;
}

/* Woodmart theme specific adjustments */
.woodmart-theme .brand-model-selector-wrapper .bms-submit-btn {
    background-color: var(--wd-primary-color, #007cba);
}

.woodmart-theme .brand-model-selector-wrapper .bms-submit-btn:hover:not(:disabled) {
    background-color: var(--wd-primary-color-hover, #005a87);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .brand-model-selector-form {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }
    
    .bms-field-group label {
        color: #fff;
    }
    
    .bms-select {
        background-color: #333;
        border-color: #555;
        color: #fff;
    }
    
    .bms-select:disabled {
        background-color: #1a1a1a;
        color: #666;
    }
}
