/* BrandSelector Component */
.brand-selector {
    position: relative;
    display: inline-block;
    font-family: 'Open Sans', sans-serif;
    min-width: 200px;
}

/* Trigger Button */
.brand-selector__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    height: 36px;
    border-radius: 18px;
    padding: 10px 14px;
    background-color: var(--color-background);
    border: 1px solid var(--color-background);
    cursor: pointer;
    transition: border-color 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease, opacity 0.4s ease;
}

.brand-selector__trigger:hover {
    border-color: var(--color-grigiobase);
}

.brand-selector__trigger:focus {
    outline: none;
    border-color: var(--color-blu);
    box-shadow: 0 0 0 2px rgba(48, 66, 97, 0.15);
}

.brand-selector__trigger:focus:not(:focus-visible) {
    box-shadow: none;
}

.brand-selector__trigger:disabled {
    background-color: #f5f7fa;
    cursor: not-allowed;
    opacity: 0.7;
}

.brand-selector__trigger-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.brand-selector__trigger-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.brand-selector__trigger-text {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--color-blu);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-selector__trigger-text--placeholder {
    font-weight: 400;
    color: var(--color-secondary-blu);
}

/* Chevron Icon */
.brand-selector__chevron {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: var(--color-secondary-blu);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.brand-selector--open .brand-selector__chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.brand-selector__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--color-pure-white);
    border: 1px solid rgba(205, 210, 228, 0.66);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(48, 66, 97, 0.12);
    z-index: 1000;
    overflow: hidden;
    animation: brandSelectorSlideIn 0.15s ease-out;
}

@keyframes brandSelectorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Section */
.brand-selector__search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(205, 210, 228, 0.5);
}

.brand-selector__search-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--color-secondary-blu);
}

.brand-selector__search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 18px;
    color: var(--color-blu);
}

.brand-selector__search-input::placeholder {
    color: var(--color-grigiobase);
}

/* Items List */
.brand-selector__items {
    max-height: 240px;
    overflow-y: auto;
    padding: 6px 0;
}

.brand-selector__items::-webkit-scrollbar {
    width: 6px;
}

.brand-selector__items::-webkit-scrollbar-track {
    background: transparent;
}

.brand-selector__items::-webkit-scrollbar-thumb {
    background-color: var(--color-grigiobase);
    border-radius: 3px;
}

/* Single Item */
.brand-selector__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.brand-selector__item:hover,
.brand-selector__item--highlighted {
    background-color: rgba(48, 66, 97, 0.05);
}

.brand-selector__item--selected {
    background-color: rgba(48, 66, 97, 0.08);
}

.brand-selector__item--selected:hover,
.brand-selector__item--selected.brand-selector__item--highlighted {
    background-color: rgba(48, 66, 97, 0.12);
}

.brand-selector__item--disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.brand-selector__item--disabled:hover {
    background-color: transparent;
}

.brand-selector__item-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.brand-selector__item-icon-placeholder {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background-color: var(--color-cloud);
    flex-shrink: 0;
}

.brand-selector__item-label {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: var(--color-blu);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-selector__item--selected .brand-selector__item-label {
    font-weight: 500;
}

/* Check Icon */
.brand-selector__check {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--color-blu);
}

/* Empty State */
.brand-selector__empty {
    padding: 16px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 400;
    line-height: 18px;
    color: var(--color-secondary-blu);
}

/* Disabled State */
.brand-selector--disabled .brand-selector__trigger {
    background-color: #f5f7fa;
    cursor: not-allowed;
    opacity: 0.7;
}

.brand-selector--disabled .brand-selector__chevron {
    opacity: 0.5;
}

/* Loading State - integrate with existing loading-border system */
.brand-selector.is-loading .brand-selector__trigger {
    pointer-events: none;
}

/* Responsive */
@media (max-width: 480px) {
    .brand-selector {
        min-width: 100%;
    }
    
    .brand-selector__dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        max-height: 60vh;
    }
    
    .brand-selector__items {
        max-height: calc(60vh - 60px);
    }
}

