/**
 * Scroll to Top Button
 * Botón flotante para volver al inicio
 */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 36px;
    height: 36px;
    background: var(--primary); /* #FCD34D; */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(252, 211, 77, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-to-top:hover {
    background: #facc15;
    transform: translateY(-2px);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.scroll-to-top:active {
    transform: translateY(-2px) scale(0.98);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    color: var(--secondary);
    transition: transform 0.3s ease;
}

.scroll-to-top:hover svg {
    transform: translateY(-2px);
}

/* Animación de rebote al aparecer */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.3);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
    70% {
        transform: translateY(2px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.scroll-to-top.visible {
    animation: bounceIn 0.5s ease;
}

/* Indicador de progreso (círculo) */
.scroll-progress {
    position: absolute;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    border-radius: 50%;
    transform: rotate(-90deg);
}

.scroll-progress-circle {
    fill: none;
    stroke: #000000;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s ease;
}

/* Tooltip */
.scroll-to-top::before {
    content: 'Subir';
    position: absolute;
    right: 100%;
    margin-right: 12px;
    background: #1E293B;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.scroll-to-top::after {
    content: '';
    position: absolute;
    right: 100%;
    margin-right: 6px;
    border: 6px solid transparent;
    border-left-color: #1E293B;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.scroll-to-top:hover::before,
.scroll-to-top:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    .scroll-to-top {
        width: 36px;
        height: 36px;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
    
    /* Ocultar tooltip en móvil */
    .scroll-to-top::before,
    .scroll-to-top::after {
        display: none;
    }
}

/* Ajuste cuando el banner de cookies está visible */
body:has(.cookie-overlay.active) .scroll-to-top {
    z-index: 9998; /* Debajo del banner de cookies */
}

/* Modo oscuro (opcional para futuro) */
@media (prefers-color-scheme: dark) {
    .scroll-to-top {
        background: var(--primary); /* #FCD34D; */
        box-shadow: 0 4px 12px rgba(252, 211, 77, 0.3);
    }
}