/****************************
*   Global utility classes
*****************************/

// btn-close overrides

.btn-close > .icon,
.btn-close.icon > i,
.btn-close.icon > svg {
    visibility: hidden;
}

.btn-close:not(:has(i, svg, .icon)) {
    --bs-btn-close-bg: transparent;
    width: auto;
}

@each $name, $pair in $theme-colors {
    .variant-#{$name} > .btn-close {
        @extend .btn-close-white;
    }
}

// global scroll classes

html.scroll-clipped,
body.scroll-clipped {
    overflow: hidden;
    padding-right: 1rem;
}

html.scroll-hidden,
body.scroll-hidden {
    position: fixed;
    width: 100%;
    bottom: 0;
    overflow-x: hidden;
    overflow-y: scroll;
}

// utlity classes

.clickable {
    cursor: pointer;
}

.not-clickable {
    cursor: unset !important;
}

.fit-content {
    width: fit-content;
}

.max-content {
    width: max-content;
}

.max-width,
.fullwidth {
    width: 100%;
}

.width-unset {
    width: unset;
}

.max-height,
.fullheight {
    height: 100%;
}

.height-unset {
    height: unset;
}

// utility classes for text

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-centered,
.text-center {
    text-align: center;
}

// Utitlity classes for z-index sass variables (see https://getbootstrap.com/docs/5.3/layout/z-index/)

.z-dropdown {
    z-index: $zindex-dropdown;
}

.z-sticky {
    z-index: $zindex-sticky;
}

.z-fixed {
    z-index: $zindex-fixed;
}

.z-offcanvas-backdrop {
    z-index: $zindex-offcanvas-backdrop;
}

.z-offcanvas {
    z-index: $zindex-offcanvas;
}

.z-modal-backdrop {
    z-index: $zindex-modal-backdrop;
}

.z-modal {
    z-index: $zindex-modal;
}

.z-popover {
    z-index: $zindex-popover;
}

.z-tooltip {
    z-index: $zindex-tooltip;
}

.z-toast {
    z-index: $zindex-toast;
}
