/* ==========================================================================
   Tier-1 Scroll to Top Button Styles
   Location: css/scroll-to-top.css
   ========================================================================== */

.scroll-to-top-btn {
    position: fixed;
    bottom: 40px;
    /* 🚀 45px aligns the center of this 50px button exactly with the 60px Whatsapp button at 40px */
    right: 45px; 
    width: 50px;
    height: 50px;
    border-radius: 50%;
    
    /* 🚀 BORDER ONLY & OUTLINE (Subtle glass to prevent clashing with text behind it) */
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid #000000;
    color: #000000;
    
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999; /* Below modals, but above sticky navs */
    outline: none;
    padding: 0;
    margin: 0;
    
    /* Animation states */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                visibility 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                background-color 0.25s ease,
                border-color 0.25s ease,
                color 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-to-top-btn:hover {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

.scroll-to-top-btn:active {
    transform: scale(0.95);
}

.scroll-to-top-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 3;
    /* 🚀 Offset exactly 2px UP from the center */
    transform: translateY(-2px);
    transition: transform 0.3s ease;
    display: block;
}

.scroll-to-top-btn:hover svg {
    /* Nudges a bit further up on hover for a tactile feel */
    transform: translateY(-4px); 
}

/* ==========================================================================
   Dark Theme Adaptation (#17141c & Single Product / Dark Pages)
   ========================================================================== */
body.single-product .scroll-to-top-btn,
body.woocommerce-page .scroll-to-top-btn,
body.mcb-dark-theme .scroll-to-top-btn {
    background-color: rgba(23, 20, 28, 0.65);
    border: 2px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

body.single-product .scroll-to-top-btn:hover,
body.woocommerce-page .scroll-to-top-btn:hover,
body.mcb-dark-theme .scroll-to-top-btn:hover {
    background-color: var(--primary-color, #7c3aed);
    border-color: var(--primary-color, #7c3aed);
    color: #ffffff;
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */
@media (max-width: 768px) {
    .scroll-to-top-btn {
        /* Raised higher on mobile so it doesn't block sticky bottom navigation */
        bottom: 85px; 
        /* 🚀 23px aligns the center of this 44px button with the 50px mobile whatsapp button */
        right: 23px;
        width: 44px;
        height: 44px;
    }
    
    .scroll-to-top-btn svg {
        width: 20px;
        height: 20px;
        transform: translateY(-2px);
    }
    
    .scroll-to-top-btn:hover svg {
        transform: translateY(-3px); 
    }
}