@value _px_0, _px_9, _px_10, _px_11, _px_12, _px_13, _px_14, _px_15, _px_17, _px_18, _px_20, _px_23, _px_24, _px_28, _px_32, _px_36, _per_50, _per_100 from '../CommonCss/var-units.css';

.common {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    outline: none
}

.checkbox {
    display: none
}

.primarySwitch {
    display: inline-block;
    position: relative;
    transition: all .2s ease-out;
    background-color: var(--local-switch-background, hsla(213, 27.27%, 87.06%, 1));
    border-radius: _px_10;
    box-sizing: border-box;
    height: var(--local-switch-height);
    width: var(--local-switch-width);
}

.ball {
    background-color: #fff;
    border-radius: _per_50;
    display: inline-block;
    position: absolute;
    box-shadow: 0 1px 8px 0 rgba(48, 70, 84, .2);
    transition: all .2s ease-out;
    left: _px_0;
    top: -3px;
    box-sizing: border-box;
    height: var(--local-switch-ball-height);
    width: var(--local-switch-ball-width);
}

.primaryActive {
    --local-switch-background: hsla(133, 63.29%, 40.59%, 1)
}

.tinySwitch {
    --local-switch-height: _px_9;
    --local-switch-width: _px_24
}

.tinySwitch .ball {
    --local-switch-ball-height: _px_15;
    --local-switch-ball-width: _px_15
}

.checkbox:checked+.tinySwitch .ball {
    left: calc(_per_100 - _px_13)
}

.smallSwitch {
    --local-switch-height: _px_11;
    --local-switch-width: _px_28
}

.smallSwitch .ball {
    --local-switch-ball-height: _px_17;
    --local-switch-ball-width: _px_17
}

.checkbox:checked+.smallSwitch .ball {
    left: calc(_per_100 - _px_15)
}

.mediumSwitch {
    --local-switch-height: _px_14;
    --local-switch-width: _px_32;
}

.mediumSwitch .ball {
    --local-switch-ball-height: _px_20;
    --local-switch-ball-width: _px_20
}

.checkbox:checked+.mediumSwitch .ball {
    left: calc(_per_100 - _px_18)
}

.largeSwitch {
    --local-switch-height: _px_15;
    --local-switch-width: _px_36
}

.largeSwitch .ball {
    --local-switch-ball-height: _px_23;
    --local-switch-ball-width: _px_23
}

.checkbox:checked+.largeSwitch .ball {
    left: calc(_per_100 - _px_20)
}

.disabledSwitch {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none
}

.common> :not(:last-child) {
    margin: 0 _px_12 0 0
}

/* === A11Y Switch Changes Start Here === */

.container {
    --local-switch-cursor: pointer;
    --local-switch-offLabel-stroke: var(--hc_switch_offLabel, hsla(220, 10.45%, 39.41%, 1));
    gap: 6px
}

.small,
.tiny {
    --local-switch-track-width: 22px;
    --local-switch-track-height: 12px;
    --local-switch-track-border-radius: 8px;
    --local-switch-thumb-size: 10px;
    --local-switch-onLabel-height: 6px;
    --local-switch-onLabel-left: 5px;
    --local-switch-offLabel-size: 7px;
    --local-switch-offLabel-right: 2px;
    --local-switch-onLabel-scaleX: 1.2;
}

.medium {
    --local-switch-track-width: 28px;
    --local-switch-track-height: 16px;
    --local-switch-track-border-radius: 16px;
    --local-switch-thumb-size: 14px;
    --local-switch-onLabel-height: 8px;
    --local-switch-onLabel-left: 6px;
    --local-switch-offLabel-size: 8px;
    --local-switch-offLabel-right: 3px;
    --local-switch-onLabel-scaleX: 1.4;
}

.large {
    --local-switch-track-width: 34px;
    --local-switch-track-height: 20px;
    --local-switch-track-border-radius: 10px;
    --local-switch-thumb-size: 18px;
    --local-switch-onLabel-height: 10px;
    --local-switch-onLabel-left: 7px;
    --local-switch-offLabel-size: 9px;
    --local-switch-offLabel-right: 4px;
    --local-switch-onLabel-scaleX: 1.6;
}

.xlarge {
    --local-switch-track-width: 40px;
    --local-switch-track-height: 24px;
    --local-switch-track-border-radius: 12px;
    --local-switch-thumb-size: 22px;
    --local-switch-onLabel-height: 12px;
    --local-switch-onLabel-left: 8px;
    --local-switch-offLabel-size: 10px;
    --local-switch-offLabel-right: 5px;
    --local-switch-onLabel-scaleX: 1.8;
}

.disabled,
.readonly {
    --local-switch-cursor: not-allowed;
}

.checked>.enabled.trackWrapper:hover {
    --local-switch-track-background-color: var(--hc_switch_track_on_hover_bg, hsla(134, 78.63%, 25.69%, 1));
}

.unChecked>.enabled.trackWrapper:hover {
    --local-switch-track-background-color: var(--hc_switch_track_off_hover_bg, hsla(231, 22.22%, 82.35%, 1));
}

.enabled.trackWrapper:hover {
    --local-switch-offLabel-stroke: var(--hc_switch_offLabel_hover, hsla(0, 0%, 0%, 1));
}

.trackWrapper {
    position: relative;
}

.disabled.trackWrapper {
    opacity: 0.4;
}

.track {
    appearance: none;
    margin: 0;
    display: block;
    position: relative;
    height: var(--hc_switch_track_height, var(--local-switch-track-height));
    width: var(--hc_switch_track_width, var(--local-switch-track-width));
    border-radius: var(--hc_switch_track_border_radius, var(--local-switch-track-border-radius));
    background-color: var(--local-switch-track-background-color);
    cursor: var(--local-switch-cursor);
}

.commonSvg {
    display: block;
    position: absolute;
    pointer-events: none;
    top: 50%;
}

.thumb {
    transition: transform var(--hc_transition2, .2s) cubic-bezier(0.4, 0, 0.2, 1);
    fill: var(--hc_switch_thumb_bg, hsla(0, 0%, 100%, 1));
    left: 1px;
    transform: translateX(var(--local-switch-thumb-translateX)) translateY(-50%);
    height: var(--hc_switch_thumb_size, var(--local-switch-thumb-size));
    width: var(--hc_switch_thumb_size, var(--local-switch-thumb-size));
}

.label {
    cursor: var(--local-switch-cursor);
    max-width: 100%;
}

.onLabel {
    height: var(--local-switch-onLabel-height);
    transform: translateY(-50%) scaleX(var(--local-switch-onLabel-scaleX));
    left: var(--local-switch-onLabel-left);
    fill: var(--hc_switch_onLabel, hsla(0, 0%, 100%, 1));
    width: 1px;
}

.offLabel {
    height: var(--local-switch-offLabel-size);
    width: var(--local-switch-offLabel-size);
    transform: translateY(-50%);
    right: var(--local-switch-offLabel-right);
    fill: transparent;
    stroke: var(--local-switch-offLabel-stroke);
}

.checked {
    --local-switch-track-background-color: var(--hc_switch_track_on_bg, hsla(133, 63.29%, 40.59%, 1));
    --local-switch-thumb-translateX: calc(var(--local-switch-track-width) - var(--local-switch-thumb-size) - 2px)
        /*rtl: calc(var(--local-switch-track-width)* -1 - var(--local-switch-thumb-size)* -1 - -2px)*/
}

.unChecked {
    --local-switch-track-background-color: var(--hc_switch_track_off_bg, hsla(213, 27.27%, 87.06%, 1));
    --local-switch-thumb-translateX: 0;
}