/**
 * WhatsApp Sticky + Back to Top Styles
 * 
 * Requiere: Bootstrap Icons
 */

/* ============================================
   VARIABLES (sobrescribibles)
   ============================================ */
:root {
    --whatsapp-color: #25d366;
    --whatsapp-hover: #128c7e;
    --whatsapp-pulse: rgba(37, 211, 102, 0.4);
    --backtop-color: #0d6efd;
    --backtop-hover: #0b5ed7;
    --button-size: 60px;
    --button-size-mobile: 50px;
    --button-offset: 30px;
    --button-offset-mobile: 20px;
    --animation-speed: 0.3s;
}

/* ============================================
   WHATSAPP BUTTON
   ============================================ */
.whatsapp-sticky-button {
    position: fixed;
    bottom: var(--button-offset);
    right: var(--button-offset);
    width: var(--button-size);
    height: var(--button-size);
    background-color: var(--whatsapp-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    text-decoration: none;
    box-shadow: 0 4px 12px var(--whatsapp-pulse);
    z-index: 9999;
    transition: all var(--animation-speed) ease;
    animation: whatsapp-pulse 2s infinite;
}

.whatsapp-sticky-button:hover {
    background-color: var(--whatsapp-hover);
    color: #ffffff;
    transform: scale(1.1);
    text-decoration: none;
}

.whatsapp-sticky-button i {
    line-height: 1;
}

/* Animación de pulso */
@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top-button {
    position: fixed;
    bottom: calc(var(--button-offset) + var(--button-size) + 15px);
    right: var(--button-offset);
    width: var(--button-size);
    height: var(--button-size);
    background-color: var(--backtop-color);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--animation-speed) ease;
    z-index: 9998;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

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

.back-to-top-button:hover {
    background-color: var(--backtop-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.4);
}

.back-to-top-button i {
    line-height: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .whatsapp-sticky-button,
    .back-to-top-button {
        width: var(--button-size-mobile);
        height: var(--button-size-mobile);
        right: var(--button-offset-mobile);
    }
    
    .whatsapp-sticky-button {
        bottom: var(--button-offset-mobile);
        font-size: 1.5rem;
    }
    
    .back-to-top-button {
        bottom: calc(var(--button-offset-mobile) + var(--button-size-mobile) + 10px);
        font-size: 1.1rem;
    }
    
    @keyframes whatsapp-pulse {
        0% {
            box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
        }
        70% {
            box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
        }
        100% {
            box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
        }
    }
}

/* ============================================
   UTILIDADES
   ============================================ */

/* Posición izquierda (opcional) */
.whatsapp-sticky-button.position-left,
.back-to-top-button.position-left {
    right: auto;
    left: var(--button-offset);
}

@media (max-width: 768px) {
    .whatsapp-sticky-button.position-left,
    .back-to-top-button.position-left {
        right: auto;
        left: var(--button-offset-mobile);
    }
}

/* Tamaño pequeño (opcional) */
.whatsapp-sticky-button.size-small,
.back-to-top-button.size-small {
    width: 45px;
    height: 45px;
    font-size: 1.25rem;
}

/* Sin animación de pulso */
.whatsapp-sticky-button.no-pulse {
    animation: none;
}
/* ============================================
   BOTON WHATSAPP EN SINGLE
   ============================================ */
.toozle-whatsapp-btn {
    background: #25d366 !important;
    border-color: #25d366 !important;
    color: #ffffff !important;
}

.toozle-whatsapp-btn:hover {
    background: #128c7e !important;
    border-color: #128c7e !important;
    color: #ffffff !important;
}