/* =============================================================================
   Widget: Back to Top
   BEM root: .gtea-back-to-top
   ============================================================================= */

/* ── Base wrapper ────────────────────────────────────────────────────────────── */

.gtea-back-to-top {
    display: inline-block;
    /* CSS vars with defaults — overridden by Elementor responsive selectors */
    --btt-offset-v: 30px;
    --btt-offset-h: 30px;
    --btt-anim-duration: 300ms;
    /* Base transform identity used by slide-up animation for non-center positions */
    --btt-base-transform: translateX(0);
}

/* ── Fixed mode ──────────────────────────────────────────────────────────────── */

.gtea-back-to-top--fixed {
    position: fixed;
    z-index: 9999;
    /* Prevent the wrapper from accidentally capturing pointer events
       when the button itself is hidden */
    pointer-events: none;
}

.gtea-back-to-top--fixed .gtea-back-to-top__btn {
    pointer-events: auto;
}

/* ── Vertical position ───────────────────────────────────────────────────────── */

.gtea-back-to-top--v-bottom { bottom: var(--btt-offset-v); }
.gtea-back-to-top--v-top    { top: var(--btt-offset-v); }

/* ── Horizontal position ─────────────────────────────────────────────────────── */

.gtea-back-to-top--h-left   { left: var(--btt-offset-h); }
.gtea-back-to-top--h-right  { right: var(--btt-offset-h); }

.gtea-back-to-top--h-center {
    left: 50%;
    transform: translateX(-50%);
    /* Override base transform var so slide-up animation includes the X offset */
    --btt-base-transform: translateX(-50%);
}

/* ── Button ──────────────────────────────────────────────────────────────────── */

.gtea-back-to-top__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    text-decoration: none;
    box-sizing: border-box;
    font: inherit;
    color: inherit;
    line-height: 1;
    /* Reset default <button> appearance */
    -webkit-appearance: none;
    appearance: none;
}

.gtea-back-to-top__btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ── Icon wrapper ────────────────────────────────────────────────────────────── */

.gtea-back-to-top__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

.gtea-back-to-top__icon-wrap svg {
    display: block;
}

/* ── Label ───────────────────────────────────────────────────────────────────── */

.gtea-back-to-top__label {
    display: inline-block;
}

/* ── Visibility (show after scroll) ─────────────────────────────────────────── */

.gtea-back-to-top--hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.gtea-back-to-top--visible {
    opacity: 1;
    pointer-events: none; /* wrapper stays non-interactive; button handles events */
    visibility: visible;
}

/* Restore pointer events on the button when the wrapper becomes visible.
   The wrapper keeps pointer-events: none so it doesn't intercept clicks on
   content below, but the button itself must remain clickable. */
.gtea-back-to-top--visible .gtea-back-to-top__btn {
    pointer-events: auto;
}

/* ── Entrance animation: fade ────────────────────────────────────────────────── */

.gtea-back-to-top--anim-fade {
    transition:
        opacity var(--btt-anim-duration) ease-in-out,
        visibility var(--btt-anim-duration) ease-in-out;
}

/* ── Entrance animation: slide-up ────────────────────────────────────────────── */
/*
 * Uses --btt-base-transform so the translateX(-50%) centering offset is
 * preserved when the slide-up Y transform is combined with it.
 * For non-center positions --btt-base-transform is translateX(0).
 */

.gtea-back-to-top--anim-slide-up {
    transition:
        opacity var(--btt-anim-duration) ease-in-out,
        transform var(--btt-anim-duration) ease-in-out,
        visibility var(--btt-anim-duration) ease-in-out;
}

.gtea-back-to-top--anim-slide-up.gtea-back-to-top--hidden {
    transform: var(--btt-base-transform) translateY(20px);
}

.gtea-back-to-top--anim-slide-up.gtea-back-to-top--visible {
    transform: var(--btt-base-transform) translateY(0);
}
