/**
 * Scroll to Top Button - AVEC FLÈCHE SVG
 * wp-content/themes/custom-theme/src/assets/css/scroll-to-top.css
 */

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: #ffffff9c;
    border: 1px solid var(--dark, #0F1829);
    border-radius: 50%;
    cursor: pointer;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(15, 24, 41, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Flèche SVG - État initial : diagonal haut-droite (45deg) */
.scroll-to-top-arrow {
    width: 20px;
    height: 20px;
    display: inline-block;
    flex-shrink: 0;
    position: relative;
    top: -2px;
    left: 1px;

    /* SVG de la flèche en dark - état initial diagonal */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20.086' height='20.751' viewBox='0 0 20.086 20.751'%3E%3Cg transform='translate(15603.711 17184.551)'%3E%3Cpath d='M0,0,6.306,6.306,0,12.611' transform='translate(-15599.251 -17177.842) rotate(-45)' fill='none' stroke='%230F1829' stroke-miterlimit='10' stroke-width='3'/%3E%3Cline x1='12.168' y2='12.857' transform='translate(-15602.621 -17177.688)' fill='none' stroke='%230F1829' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    /* Rotation initiale : DIAGONAL HAUT-DROITE (45deg) */
    transform: rotate(0deg);
    transform-origin: center;

    /* Transition */
    transition: all 0.4s ease;
}

/* Hover - Devient jaune et flèche pointe VERTICAL vers le haut */
.scroll-to-top:hover {
    background: var(--yellow, #FFC365);
    border-color: var(--yellow, #FFC365);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(255, 195, 101, 0.3);
}

/* Animation de la flèche au hover : rotation vers le haut (90deg total) */
.scroll-to-top:hover .scroll-to-top-arrow {
    /* Rotation vers VERTICAL HAUT (90deg total depuis 45deg) */
    transform: rotate(-45deg);

    /* SVG de la flèche en dark (reste en dark même au hover) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20.086' height='20.751' viewBox='0 0 20.086 20.751'%3E%3Cg transform='translate(15603.711 17184.551)'%3E%3Cpath d='M0,0,6.306,6.306,0,12.611' transform='translate(-15599.251 -17177.842) rotate(-45)' fill='none' stroke='%230F1829' stroke-miterlimit='10' stroke-width='3'/%3E%3Cline x1='12.168' y2='12.857' transform='translate(-15602.621 -17177.688)' fill='none' stroke='%230F1829' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
}

/* Active state */
.scroll-to-top:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 195, 101, 0.2);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }

    .scroll-to-top-arrow {
        width: 20px;
        height: 20px;
    }

    .scroll-to-top-arrow::before {
        width: 12px;
    }

    .scroll-to-top-arrow::after {
        height: 12px;
    }

    .scroll-to-top:hover .scroll-to-top-arrow::before {
        height: 14px;
    }

    .scroll-to-top:hover .scroll-to-top-arrow::after {
        width: 10px;
    }
}

@media (max-width: 480px) {
    .scroll-to-top.visible {
        pointer-events: all;
        display: none;
    }
}

/* Animation d'apparition */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-to-top.visible {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* S'assurer que le bouton est au-dessus des autres éléments */
.scroll-to-top {
    pointer-events: all;
}

.scroll-to-top.visible {
    pointer-events: all;
}