/**
 * CBD FunHouse Core - Marketing (Product Badges + WhatsApp)
 * v2.1
 */

/* ===============================
   PRODUCT BADGES
   =============================== */
.cbdfh-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
    pointer-events: none;
}
.cbdfh-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #fff;
    background: #2C4C3B;
    border-radius: 20px;
    line-height: 1.2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    pointer-events: auto;
}
.cbdfh-badge-sale       { background: #c94b4b; }
.cbdfh-badge-new        { background: #2c8a4a; }
.cbdfh-badge-bestseller { background: #b67e53; }
.cbdfh-badge-custom     { background: #6b6b6b; }

/* Ensure product cards have relative positioning for badges */
.woocommerce ul.products li.product {
    position: relative;
}
/* Single product: badges above gallery */
.single-product div.product .woocommerce-product-gallery { position: relative; }
.single-product div.product .cbdfh-badges { top: 15px; left: 15px; }

/* ===============================
   WHATSAPP FLOATING BUTTON
   =============================== */
.cbdfh-whatsapp-btn {
    position: fixed;
    bottom: 80px; /* above back-to-top */
    right: 25px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #25D366;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37,211,102,0.4);
    z-index: 997;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    color: #fff !important;
    text-decoration: none !important;
}
.cbdfh-whatsapp-btn:hover {
    background: #20b858;
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,211,102,0.55);
    color: #fff !important;
}
.cbdfh-whatsapp-btn svg { display: block; }

/* Pulse animation on load */
@keyframes cbdfhPulse {
    0%   { box-shadow: 0 0 0 0 rgba(37,211,102,0.6); }
    70%  { box-shadow: 0 0 0 18px rgba(37,211,102,0); }
    100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
.cbdfh-whatsapp-btn { animation: cbdfhPulse 2.5s infinite; }
.cbdfh-whatsapp-btn:hover { animation: none; }

/* Mobile: smaller size, further from edge */
@media (max-width: 768px) {
    .cbdfh-whatsapp-btn {
        bottom: 75px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    .cbdfh-whatsapp-btn svg { width: 24px; height: 24px; }

    /* Badges on mobile — smaller */
    .cbdfh-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
    .cbdfh-badges {
        top: 8px;
        left: 8px;
    }
}

/* Hide WhatsApp when cookie banner or age gate is showing (avoid stacking) */
body:has(#cbdfh-age-gate) .cbdfh-whatsapp-btn,
body:has(#cbdfh-cookie-banner:not([hidden])) .cbdfh-whatsapp-btn {
    display: none !important;
}
