/**
 * VJ Chat Order Button Styles
 * 
 * @package VJ_Chat_Order
 */

/* Chat Button - Base Styles */
.vj-chat-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    padding: 12px 15px;
    background-color: #25D366;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    width: 100%;
    max-width: 300px;
}

.vj-chat-button:hover {
    background-color: #1ebe5d;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

.vj-chat-button:active {
    transform: translateY(0);
}

.vj-chat-button:focus {
    outline: 2px solid #1ebe5d;
    outline-offset: 2px;
}

/* Chat Icon */
.vj-chat-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

/* ===== Sticky Add-to-Cart Bar (Astra Theme) ===== */
/* Show only icon when in sticky bar (compact mode) */
.ast-sticky-add-to-cart .vj-chat-button {
    width: auto !important;
    max-width: none !important;
    min-width: 44px;
    height: 44px;
    padding: 10px !important;
    margin: 0 0 0 10px !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    /* Hide text */
    gap: 0 !important;
}

.ast-sticky-add-to-cart .vj-chat-button .vj-chat-icon {
    width: 24px;
    height: 24px;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
    .vj-chat-button {
        max-width: 100%;
        font-size: 15px;
        padding: 14px 20px;
    }

    /* Keep compact on mobile sticky bar */
    .ast-sticky-add-to-cart .vj-chat-button {
        min-width: 40px;
        height: 40px;
        padding: 8px !important;
    }

    .ast-sticky-add-to-cart .vj-chat-button .vj-chat-icon {
        width: 22px;
        height: 22px;
    }
}

/* ===== Floating Button Styles ===== */
.vj-chat-floating {
    position: fixed !important;
    z-index: 2147483647 !important;
    /* Max z-index to override everything */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    display: inline-flex !important;
    visibility: visible !important;
}

/* ===== Compact Mode (Icon Only) ===== */
.vj-chat-compact {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;
    width: 55px !important;
    height: 55px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0 !important;
    /* Hide text */
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.vj-chat-compact .vj-chat-icon {
    width: 30px !important;
    height: 30px !important;
    margin: 0 !important;
}

/* Ensure it stays compact on mobile */
@media (max-width: 768px) {
    .vj-chat-floating {
        width: auto !important;
        max-width: none !important;
    }
}

/* ===== Position Fixes for Theme Compatibility ===== */

/* When button is inside product_meta (Before Category position) */
.product_meta .vj-chat-button {
    display: flex !important;
    width: fit-content;
    margin-bottom: 15px;
}

/* Ensure button appears on its own row in product meta */
.product_meta .vj-chat-button+.posted_in,
.product_meta .vj-chat-button+.tagged_as,
.product_meta .vj-chat-button+.sku_wrapper {
    display: block;
    clear: both;
}