/* ============================================================
   WhatsApp Welcome Modal
   ============================================================ */

#whatsappWelcomeModal .modal-content {
    border-radius: 18px;
    border: none;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}

#whatsappWelcomeModal .modal-header {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border: none;
    padding: 1.4rem 1.5rem 1rem;
}

#whatsappWelcomeModal .modal-header .btn-close {
    filter: invert(1);
    opacity: 0.85;
}

#whatsappWelcomeModal .modal-title {
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#whatsappWelcomeModal .modal-title svg {
    flex-shrink: 0;
}

#whatsappWelcomeModal .modal-body {
    padding: 1.6rem 1.5rem 1rem;
    background: #f9fafb;
}

.whatsapp-modal-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366, #128c7e);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.whatsapp-chat-bubble {
    background: #fff;
    border-radius: 0 14px 14px 14px;
    padding: 0.85rem 1.1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 0.95rem;
    color: #222;
    line-height: 1.55;
    position: relative;
    max-width: 340px;
}

.whatsapp-chat-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10px;
    border-width: 0 10px 10px 0;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
}

.whatsapp-chat-time {
    font-size: 0.72rem;
    color: #aaa;
    text-align: right;
    margin-top: 4px;
}

#whatsappWelcomeModal .modal-footer {
    border: none;
    padding: 0 1.5rem 1.4rem;
    background: #f9fafb;
    gap: 0.5rem;
}

.whatsapp-btn-send {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.55rem 1.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}

.whatsapp-btn-send:hover {
    opacity: 0.9;
    color: #fff;
    transform: translateY(-1px);
}

.whatsapp-btn-later {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 50px;
    color: #888;
    font-size: 0.88rem;
    padding: 0.45rem 1.1rem;
    transition: background 0.2s;
}

.whatsapp-btn-later:hover {
    background: #eee;
    color: #555;
}

/* Pulse animation on WhatsApp icon */
@keyframes wa-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
    70%  { box-shadow: 0 0 0 12px rgba(37,211,102,0); }
    100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

.whatsapp-modal-avatar {
    animation: wa-pulse 2s infinite;
}

@media (max-width: 480px) {
    #whatsappWelcomeModal .modal-dialog {
        margin: 1rem auto;
    }
    .whatsapp-chat-bubble {
        font-size: 0.9rem;
    }
}

/* ============================================================
   WhatsApp FAB (Floating Action Button)
   ============================================================ */

#wa-fab-wrapper {
    position: fixed;
    bottom: 90px;          /* Above reCAPTCHA rc-anchor badge (~70px tall) */
    right: 20px;
    z-index: 1049;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    /* Ο wrapper δεν εμποδίζει clicks — μόνο τα πραγματικά διαδραστικά παιδιά */
    pointer-events: none;
}

#wa-fab-wrapper .wa-fab-btn,
#wa-fab-wrapper .wa-fab-dismiss,
#wa-fab-wrapper .wa-fab-panel.is-open {
    pointer-events: auto;
}

/* ── FAB circular button ─────────────────────────────────── */
.wa-fab-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border: none;
    box-shadow: 0 4px 18px rgba(37,211,102,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    animation: wa-fab-pulse 2.8s infinite;
    transition: transform 0.2s;
}
.wa-fab-btn:hover { transform: scale(1.1); }

.wa-fab-btn .wa-icon-open,
.wa-fab-btn .wa-icon-close {
    position: absolute;
    transition: transform 0.25s, opacity 0.25s;
}
.wa-fab-btn .wa-icon-close { transform: scale(0); opacity: 0; }

#wa-fab-wrapper.is-open .wa-fab-btn { animation: none; }
#wa-fab-wrapper.is-open .wa-fab-btn .wa-icon-open  { transform: scale(0); opacity: 0; }
#wa-fab-wrapper.is-open .wa-fab-btn .wa-icon-close { transform: scale(1); opacity: 1; }

@keyframes wa-fab-pulse {
    0%   { box-shadow: 0 4px 18px rgba(37,211,102,0.45), 0 0 0 0   rgba(37,211,102,0.4); }
    70%  { box-shadow: 0 4px 18px rgba(37,211,102,0.45), 0 0 0 18px rgba(37,211,102,0); }
    100% { box-shadow: 0 4px 18px rgba(37,211,102,0.45), 0 0 0 0   rgba(37,211,102,0); }
}

/* Wrapper γύρω από FAB + dismiss */
.wa-fab-btn-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Dismiss button — αριστερά στην περιφέρεια του κύκλου */
.wa-fab-dismiss {
    position: absolute;
    top: 20%;
    left: -1px;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(60,60,60,0.85);
    border: 2px solid #fff;
    color: #fff;
    font-size: 0.75rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    transition: background 0.2s;
}
.wa-fab-dismiss:hover { background: #e63946; }

/* Unread-dot badge */
.wa-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #e63946;
    border-radius: 50%;
    border: 2px solid #fff;
    font-size: 0.62rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: transform 0.2s;
}
#wa-fab-wrapper.is-open .wa-fab-badge { transform: scale(0); }


/* ── Popup panel ─────────────────────────────────────────── */
.wa-fab-panel {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    width: 318px;
    max-width: calc(100vw - 48px);
    transform: scale(0.85) translateY(16px);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s;
    overflow: hidden;
}
.wa-fab-panel.is-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Panel header */
.wa-fab-panel-header {
    background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
    padding: 1rem 1rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.wa-fab-panel-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wa-fab-panel-name {
    color: #fff;
    font-weight: 800;
    font-size: 0.97rem;
    line-height: 1.2;
}
.wa-fab-panel-status {
    color: rgba(255,255,255,0.88);
    font-size: 0.74rem;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.wa-fab-panel-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a7f3d0;
    display: inline-block;
    flex-shrink: 0;
    animation: wa-online-blink 2s infinite;
}
@keyframes wa-online-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}
.wa-fab-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
    margin-left: auto;
    transition: background 0.2s;
}
.wa-fab-close-btn:hover { background: rgba(255,255,255,0.35); }

/* Panel body (WhatsApp chat bg) */
.wa-fab-panel-body {
    padding: 1rem 1rem 0.6rem;
    background: #ece5dd;
}
.wa-fab-bubble {
    background: #fff;
    border-radius: 0 12px 12px 12px;
    padding: 0.7rem 0.85rem;
    font-size: 0.875rem;
    color: #222;
    line-height: 1.55;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    position: relative;
    display: inline-block;
    max-width: 100%;
}
.wa-fab-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    border-width: 0 8px 8px 0;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
}
.wa-fab-bubble-time {
    font-size: 0.68rem;
    color: #999;
    text-align: right;
    margin-top: 4px;
    padding-right: 2px;
}

/* Panel footer */
.wa-fab-panel-footer {
    padding: 0.8rem 1rem 0.95rem;
    background: #fff;
}
.wa-fab-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #fff !important;
    font-weight: 700;
    font-size: 0.92rem;
    border-radius: 50px;
    padding: 0.65rem 1.2rem;
    text-decoration: none !important;
    transition: opacity 0.2s, transform 0.15s;
}
.wa-fab-start-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 575.98px) {
    /* bottom: 85px clears the back-to-top button (height 45px + bottom 30px = top at 75px) */
    #wa-fab-wrapper { bottom: 85px; left: 74px; }
    .wa-fab-btn     { width: 54px; height: 54px; }
    .wa-fab-panel   {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 90px;
        width: auto;
        max-width: none;
        transform-origin: bottom center;
    }
}
