/**
 * WC WhatsApp Button - Frontend Styles
 *
 * @package WC_WhatsApp_Button
 */

/* ================================================
   Button Wrapper (Product Page)
   ================================================ */
.wcwb-button-wrapper {
    margin: 15px 0;
    display: block;
    width: 100%;
}

/* ================================================
   Button Base
   ================================================ */
.wcwb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none !important;
    text-align: center;
    cursor: pointer;
    border: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.wcwb-button:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-decoration: none !important;
    color: inherit;
}

.wcwb-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wcwb-button:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ================================================
   Icon
   ================================================ */
.wcwb-icon {
    flex-shrink: 0;
}

/* ================================================
   Text
   ================================================ */
.wcwb-text {
    white-space: nowrap;
}

/* ================================================
   Pulse Animation
   ================================================ */
.wcwb-pulse {
    animation: wcwb-pulse 2.5s ease-in-out infinite;
}

@keyframes wcwb-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(77, 194, 71, 0.5); }
    50%  { box-shadow: 0 0 0 12px rgba(77, 194, 71, 0); }
    100% { box-shadow: 0 0 0 0 rgba(77, 194, 71, 0); }
}

.wcwb-pulse:hover {
    animation: none;
}

/* ================================================
   Visibility — Product Button (CSS-only, cache-safe)
   ================================================ */
@media screen and (max-width: 768px) {
    .wcwb-hide-mobile {
        display: none !important;
    }
}

@media screen and (min-width: 769px) {
    .wcwb-hide-desktop {
        display: none !important;
    }
}

/* ================================================
   FLOATING BUTTON — Base
   ================================================ */
.wcwb-float {
    position: fixed;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: scale(1) translateY(0);
}

.wcwb-float:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    color: #fff;
    text-decoration: none !important;
}

.wcwb-float:active {
    transform: scale(0.95);
}

/* ================================================
   Floating — Position (side set via inline style)
   ================================================ */

/* ================================================
   Floating — Sizes
   ================================================ */
.wcwb-float--small {
    width: 48px;
    height: 48px;
}

.wcwb-float--medium {
    width: 60px;
    height: 60px;
}

.wcwb-float--large {
    width: 72px;
    height: 72px;
}

/* ================================================
   Floating — Hidden (for delay / scroll-hide)
   ================================================ */
.wcwb-float--hidden {
    opacity: 0;
    transform: scale(0.5) translateY(40px);
    pointer-events: none;
}

/* ================================================
   Floating — Visible (JS adds this class)
   ================================================ */
.wcwb-float--visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* ================================================
   Floating — Tooltip
   ================================================ */
.wcwb-float[data-wcwb-tooltip]::before {
    content: attr(data-wcwb-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    white-space: nowrap;
    background: #333;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.25s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tooltip arrow */
.wcwb-float[data-wcwb-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #333;
    opacity: 0;
    transition: all 0.25s ease;
    pointer-events: none;
}

/* Tooltip position for right-aligned button */
.wcwb-float--bottom_right[data-wcwb-tooltip]::before {
    right: 0;
}
.wcwb-float--bottom_right[data-wcwb-tooltip]::after {
    right: 18px;
}

/* Tooltip position for left-aligned button */
.wcwb-float--bottom_left[data-wcwb-tooltip]::before {
    left: 0;
}
.wcwb-float--bottom_left[data-wcwb-tooltip]::after {
    left: 18px;
}

/* Show tooltip on hover */
.wcwb-float[data-wcwb-tooltip]:hover::before,
.wcwb-float[data-wcwb-tooltip]:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   Floating — Pulse Animation
   ================================================ */
.wcwb-float--visible:not(:hover) {
    animation: wcwb-float-pulse 3s ease-in-out infinite;
}

@keyframes wcwb-float-pulse {
    0%   { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(37, 211, 102, 0.4); }
    50%  { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 0 14px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ================================================
   Floating — Visibility (CSS-only, cache-safe)
   ================================================ */
/* ================================================
   Floating — Mobile size overrides
   ================================================ */
@media screen and (max-width: 768px) {
    .wcwb-float-hide-mobile {
        display: none !important;
    }

    /* Mobile size classes override desktop size */
    .wcwb-float--mobile-small {
        width: 48px !important;
        height: 48px !important;
    }
    .wcwb-float--mobile-small .wcwb-icon {
        width: 22px !important;
        height: 22px !important;
    }

    .wcwb-float--mobile-medium {
        width: 60px !important;
        height: 60px !important;
    }
    .wcwb-float--mobile-medium .wcwb-icon {
        width: 28px !important;
        height: 28px !important;
    }

    .wcwb-float--mobile-large {
        width: 72px !important;
        height: 72px !important;
    }
    .wcwb-float--mobile-large .wcwb-icon {
        width: 34px !important;
        height: 34px !important;
    }
}

@media screen and (min-width: 769px) {
    .wcwb-float-hide-desktop {
        display: none !important;
    }
}


