.o-ui-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    line-height: var(--o-ui-global-line-height-1);
    max-width: 100%;
    width: max-content;
    height: max-content;
    color: var(--o-ui-alias-text-1);
}

/* SWITCH */
.o-ui-switch .o-ui-switch-control {
    display: inline-block;
    /* was cloud 200 now 300 because too much similar colors */
    background-color: var(--o-ui-alias-background-2);
    border-radius: var(--o-ui-shape-pill);
    position: relative;
    flex-shrink: 0;
    transition: all var(--o-ui-easing-duration-2) var(--o-ui-easing-focus);
}

.o-ui-switch .o-ui-switch-control::before {
    content: "";
    display: inline-block;
    background-color: var(--o-ui-alias-background-1);
    border-radius: var(--o-ui-shape-circular);
    position: absolute;
    transform: translate(2px, 2px);
    transition: all var(--o-ui-easing-duration-2) var(--o-ui-easing-focus);
}

/* LABEL */
.o-ui-switch .o-ui-switch-label {
    grid-area: label;
    margin-left: var(--o-ui-global-scale-bravo);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: inline;
}

/* LABEL | REVERSE */
.o-ui-switch-reverse .o-ui-switch-label {
    margin-left: 0;
    margin-right: var(--o-ui-global-scale-bravo);
}

/* ICON */
.o-ui-switch .o-ui-switch-icon {
    margin-left: var(--o-ui-global-scale-alpha);
}

/* ICON | REVERSE */
.o-ui-switch-reverse .o-ui-switch-icon {
    margin-left: 0;
    margin-right: var(--o-ui-global-scale-alpha);
}

/* REVERSE */
.o-ui-switch-reverse {
    flex-direction: row-reverse;
}

/* INVALID */
.o-ui-switch-invalid {
    color: var(--o-ui-alias-text-negative-1);
}

.o-ui-switch-invalid .o-ui-switch-control {
    background-color: var(--o-ui-alias-background-negative-2);
}

.o-ui-switch-checked.o-ui-switch-invalid .o-ui-switch-control {
    background-color: var(--o-ui-alias-background-negative-1);
}

/* STATE */
/* STATE | CHECKED */
.o-ui-switch-checked .o-ui-switch-control {
    background-color: var(--o-ui-alias-background-primary-1);
}

.o-ui-switch-checked .o-ui-switch-control::before {
    transform: translate(calc(var(--o-ui-global-scale-hotel) / 2 + 2px), 2px);
}

/* STATE | FOCUS */
.o-ui-switch-control:after {
    opacity: 0;
    content: "";
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    position: absolute;
    box-shadow: 0 0 0 var(--o-ui-focus-ring-thickness-md) var(--o-ui-focus-ring-color);
    border-radius: var(--o-ui-shape-pill);
    transition: var(--o-ui-focus-ring-transition);
}

.o-ui-switch input[type="checkbox"]:focus-visible + .o-ui-switch-control:after,
.o-ui-switch-focus:not(.o-ui-switch-disabled) .o-ui-switch-control:after {
    opacity: 1;
}

/* STATE | FOCUS | INVALID */
.o-ui-switch-invalid .o-ui-switch-control:after {
    --o-ui-focus-ring-color: var(--o-ui-alias-border-negative-1-translucent);
}

/* STATE | DISABLED */
.o-ui-switch[disabled],
.o-ui-switch-disabled {
    opacity: var(--o-ui-disabled-opacity);
    cursor: not-allowed;
}

/* SIZING */
/* SMALL */
.o-ui-switch-sm .o-ui-switch-control {
    width: var(--o-ui-global-scale-golf);
    height: var(--o-ui-global-scale-delta);
}

.o-ui-switch-sm .o-ui-switch-control::before {
    width: var(--o-ui-global-scale-charlie);
    height: var(--o-ui-global-scale-charlie);
}

.o-ui-switch-sm.o-ui-switch-checked .o-ui-switch-control::before {
    transform: translate(calc(var(--o-ui-global-scale-golf) / 2 + 2px), 2px);
}

/* MEDIUM */
.o-ui-switch-md .o-ui-switch-control {
    width: var(--o-ui-global-scale-hotel);
    height: var(--o-ui-global-scale-echo);
}

.o-ui-switch-md .o-ui-switch-control::before {
    width: var(--o-ui-global-scale-delta);
    height: var(--o-ui-global-scale-delta);
}

.o-ui-switch-md.o-ui-switch-checked .o-ui-switch-control::before {
    transform: translate(calc(var(--o-ui-global-scale-hotel) / 2 + 2px), 2px);
}
