/* Ajustes responsive puntuales; el diseño de escritorio se conserva. */
@media (max-width: 1199.98px) {
    /* El gutter de g-5 excedía el padding del contenedor en estos anchos. */
    .container > .row.g-5 {
        --bs-gutter-x: 1.5rem;
    }

    /* Permite que el correo permanezca dentro de su columna en teléfonos. */
    .site-footer .footer-links a {
        overflow-wrap: anywhere;
    }
}

.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1050;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #082f5b;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(8, 47, 91, 0.28);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
    transition:
        opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.back-to-top svg {
    width: 22px;
    height: 22px;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top.is-visible:hover,
.back-to-top.is-visible:focus-visible {
    background: #0d477d;
    transform: translateY(-3px);
}

.back-to-top:focus-visible {
    outline: 3px solid #a9d8ff;
    outline-offset: 4px;
}

@media (min-width: 992px) {
    .back-to-top {
        width: 52px;
        height: 52px;
    }
}

@media (min-width: 1200px) {
    .back-to-top {
        /* Garantiza que el botón permanezca oculto desde escritorio. */
        display: none !important;
    }
}

@media (hover: none) {
    .back-to-top.is-visible:hover {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top,
    .back-to-top.is-visible,
    .back-to-top.is-visible:hover,
    .back-to-top.is-visible:focus-visible {
        transition-property: none;
        transform: none;
    }
}
