/**
 * Back to top · front
 *
 * @author    codePresta.com
 * @copyright codePresta.com
 */
.btt {
    --btt-color: #1c3673;
    --btt-progress: 0;
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--btt-color);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .16), 0 0 0 1px rgba(15, 23, 42, .04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(.9);
    cursor: pointer;
    transition: opacity .25s ease, transform .25s ease, visibility .25s, background-color .2s ease, color .2s ease;
}

.btt.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.btt:hover,
.btt:focus-visible {
    background: var(--btt-color);
    color: #fff;
}

.btt:active {
    transform: scale(.94);
}

.btt-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.btt-ring circle {
    fill: none;
    stroke-width: 2.5;
}

.btt-ring-track {
    stroke: color-mix(in srgb, var(--btt-color) 14%, transparent);
}

.btt-ring-bar {
    stroke: var(--btt-color);
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: calc(100 - var(--btt-progress) * 100);
    transition: stroke-dashoffset .1s linear;
}

.btt:hover .btt-ring-bar,
.btt:focus-visible .btt-ring-bar {
    stroke: #fff;
}

.btt-arrow {
    position: relative;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s ease;
}

.btt:hover .btt-arrow {
    transform: translateY(-2px);
}

/* όταν είναι ανοιχτό συρτάρι / μενού: κρυφό */
html:is(.sbc-lock, .qap-lock, .hdr-lock) .btt {
    opacity: 0;
    visibility: hidden;
}

@media (max-width: 575px) {
    .btt {
        right: max(14px, env(safe-area-inset-right));
        bottom: max(16px, calc(env(safe-area-inset-bottom) + 12px));
        width: 46px;
        height: 46px;
    }

    .btt-arrow {
        width: 20px;
        height: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btt,
    .btt-ring-bar,
    .btt-arrow {
        transition: none;
    }
}
