/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

.browser-button {
    --button-disabled-opacity: 0.65;

    transition: none;
}

.browser-button:is(:hover, :active, :focus, :focus-visible, [was-hover], [was-focus]) {
    transition: var(--button-transition);
}

.browser-button:disabled {
    pointer-events: auto;
}

.browser-button .browser-button-container {
    padding: 0 calc(var(--button-physical-height) * var(--button-inner-padding-scale, 0.25));
    gap: calc(var(--button-physical-height) * var(--button-inner-gap-scale, 0.2));
}

.browser-button[mode=icons],
:host([mode=icons]) .browser-button:not([mode]),
[mode=icons]>.browser-button:not([mode]) {
    aspect-ratio: 1;

    & .browser-button-container {
        justify-content: center;

        &>*:not(.browser-button-icon) {
            display: none;
        }
    }
}

.browser-button[mode=text],
:host([mode=text]) .browser-button:not([mode]),
[mode=text]>.browser-button:not([mode]) {
    & .browser-button-container {
        justify-content: center;

        &>*:not(.browser-button-label) {
            display: none;
        }
    }
}