.ui-segmented-control {
    position: relative;
    display: flex;
    height: var(--theme-form-medium-height);
    padding: var(--space-half);
    background-color: var(--theme-fill-40);
    border-radius: var(--theme-border-radius-default);
    -webkit-tap-highlight-color: transparent;
}

.ui-segmented-control[t-size="small"] {
    height: var(--theme-form-small-height);
}

.ui-segmented-control[t-size="large"] {
    height: var(--theme-form-large-height);
}

.ui-segmented-control[fullwidth] {
    width: 100%;
}

.ui-segmented-control__shadow {
    position: absolute;
    height: 100%;
    background-color: var(--theme-emphasis-fill);
    border-radius: var(--theme-border-radius-default-inner);
    box-shadow: var(--theme-elevation-10);
}

.ui-segmented-control__shadow--animate {
    transition: left 0.3s;
}

.ui-segmented-control__button {
    position: relative;
    display: flex;
    gap: var(--space);
    align-items: center;
    justify-content: center;
    padding: var(--space-half) var(--space-x2);
    cursor: pointer;
    background: none;
}

.ui-segmented-control__button--icon-only {
    min-width: var(--theme-form-medium-height);
}

.ui-segmented-control[t-size="small"] .ui-segmented-control__button--icon-only {
    min-width: var(--theme-form-small-height);
}

.ui-segmented-control[t-size="large"] .ui-segmented-control__button--icon-only {
    min-width: var(--theme-form-large-height);
}

.ui-segmented-control__button:disabled {
    pointer-events: none;
    cursor: not-allowed;
}

.ui-segmented-control[fullwidth] .ui-segmented-control__button {
    width: 100%;
}

.ui-segmented-control__button-icon {
    --material-icon-width: var(--theme-icon-30-font-size);
    --material-icon-height: var(--theme-icon-30-font-size);

    color: var(--theme-text-10);
}

.ui-segmented-control__button-label {
    overflow: hidden;
    font: var(--theme-paragraph-20-semibold);
    color: var(--theme-text-10);
    text-overflow: ellipsis;
    letter-spacing: var(--theme-paragraph-20-letter-spacing);
    white-space: nowrap;
    transition: color 0.2s;
}

.ui-segmented-control__button[selected] .ui-segmented-control__button-label,
.ui-segmented-control__button[selected] .ui-segmented-control__button-icon {
    color: var(--theme-text-inverse);
}

/* When disabled, use a slightly darker variation */
.ui-segmented-control__button:disabled .ui-segmented-control__button-label,
.ui-segmented-control__button:disabled .ui-segmented-control__button-icon {
    color: var(--theme-text-30);
}

/* When disabled and selected, we show a different background color */
.ui-segmented-control__button:disabled[selected] {
    background-color: white;
    border-radius: var(--theme-border-radius-default-inner);
}

/* When disabled, override the shadow's background color so it blends better */
.ui-segmented-control__shadow.ui-segmented-control__button-shadow {
    background-color: white;
}

.ui-segmented-control__button:not([selected]):hover .ui-segmented-control__button-label,
.ui-segmented-control__button:not([selected]):hover .ui-segmented-control__button-icon {
    color: var(--theme-emphasis-text);
}
