
@st-namespace 'FloatingDropdown-deprecated-st-css';
:import {
    -st-from: "../../common/formatters.st";
    -st-named: color, font, fallback, applyOpacity;
}

:import {
    -st-from: "./FloatingDropdownBase.deprecated.st.css";
    -st-default: FloatingDropdownBase;
    -st-named: minWidth, overrideStyleParams as overrideStyleParamsBase, DefaultTextColor, DefaultTextFont;
}

:import {
    -st-from: "../Dropdown/DropdownOption.deprecated.st.css";
    -st-default: DropdownOption;
}

:import {
    -st-from: "../Dropdown/Dropdown.deprecated.st.css";
    -st-named: dropdown, divider;
}

/*Constance*/
:vars {
    DefaultDropdownBackgroundColor: color-1;
}

/*Overrides*/
:vars {
    /*
        The Dropdown Background color
        @default color-1
    */
    MainDropdownBackgroundColor: --overridable;
    /*
        The Button Text color
        @default color-5
    */
    MainButtonTextColor: --overridable;
    /*
        The Items Text color
        @default color-5
    */
    MainItemTextColor: --overridable;
    /*
        The Texts font
        @default {theme: 'Body-M', size: '16px', lineHeight: '1.5em'}
    */
    MainTextFont: --overridable;
}

/*
 * The Dropdown Background color
 * @type color
 * @default --wix-color-1
 */
@property st-global(--wix-ui-tpa-floating-dropdown-main-dropdown-background-color);

/*
 * The Button Text color
 * @type color
 * @default --wix-color-5
 */
@property st-global(--wix-ui-tpa-floating-dropdown-main-button-text-color);

/*
 * The Items Text color
 * @type color
 * @default --wix-color-5
 */
@property st-global(--wix-ui-tpa-floating-dropdown-main-item-text-color);

/*
 * The Texts font
 * @type font
 * @default preset: 'Body-M' | overrides: { size: '16px', lineHeight: '1.5em'}
 */
@property st-global(--wix-ui-tpa-floating-dropdown-main-text-font);

:vars {
    ButtonTextColor: color(value(MainButtonTextColor), value(DefaultTextColor)));
    ItemTextColor: color(fallback(value(MainItemTextColor), value(MainButtonTextColor), value(DefaultTextColor)));
    DropdownBackgroundColor: color(fallback(value(MainDropdownBackgroundColor), value(DefaultDropdownBackgroundColor)));
    TextFont: fallback(font(value(MainTextFont)), font(value(DefaultTextFont)));
}

.root {
    -st-states: removeElementMinWidth;
}

.root .dropdown {
    min-width: value(minWidth);
    max-width: 100%;
}

.root:removeElementMinWidth .dropdown {
    min-width: unset;
}

.root:removeElementMinWidth .dropdown::popover {
    min-width: value(minWidth);
    width: 100%;
}

.root .dropdown:content-visible .floatingDropdownBase::arrowIcon {
    transform: rotate(180deg);
}

.root .dropdown:content-visible .floatingDropdownBase {
    background: transparent;
}

.displayInline .dropdown {
    width: auto;
}

.optionDivider {
    -st-mixin: divider;
}

.option {
    -st-extends: DropdownOption;
}

.overrideStyleParams .dropdown::dropdownContent {
    background-color: value(DropdownBackgroundColor);
}

.overrideStyleParams .dropdown::dropdownContent::dropdownOption:hovered {
    background-color: applyOpacity(value(ItemTextColor), 0.06);
}

.overrideStyleParams .dropdown::dropdownContent::dropdownOption:selected {
    background-color: applyOpacity(value(ItemTextColor), 0.12);
}

.overrideStyleParams .dropdown::dropdownContent::dropdownOption:hovered:selected {
    background-color: applyOpacity(value(ItemTextColor), 0.16);
}

.overrideStyleParams .dropdown::dropdownContent .optionDivider {
    background-color: value(ItemTextColor);
}

.overrideStyleParams .option::title {
    white-space: initial;
    color: value(ItemTextColor);
    font: value(TextFont);
}

.floatingDropdownBase {
    -st-extends: FloatingDropdownBase;
}

.overrideStyleParams .floatingDropdownBase {
    -st-mixin: overrideStyleParamsBase(
        MainTextColor value(MainButtonTextColor),
        MainTextFont value(TextFont)
    );
}

/* st-namespace-reference="../../../../src/components/FloatingDropdown/FloatingDropdown.deprecated.st.css" */
    