/* Floating WhatsApp-style enquiry widget. Self-contained — doesn't touch
   the theme's own CSS, only adds a fixed-position launcher + chat panel. */

.wa-widget-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.15s ease;
}
.wa-widget-launcher:hover { transform: scale(1.06); }
.wa-widget-launcher-icon { width: 30px; height: 30px; }
.wa-widget-launcher-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 0 2px #fff;
}
.wa-widget-launcher.wa-widget-open { display: none; }

.wa-widget-panel {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: min(560px, calc(100vh - 140px));
    background: #ECE5DD;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wa-widget-header {
    background: #075E54;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    flex: none;
}
.wa-widget-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #128C7E;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex: none;
}
.wa-widget-header-text { flex: 1; min-width: 0; }
.wa-widget-title {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wa-widget-status { font-size: 12px; opacity: 0.85; display: flex; align-items: center; gap: 5px; }
.wa-widget-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; display: inline-block; }
.wa-widget-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    flex: none;
}

.wa-widget-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-image: radial-gradient(rgba(0,0,0,0.035) 1px, transparent 1px);
    background-size: 16px 16px;
}

.wa-msg { max-width: 82%; display: flex; flex-direction: column; }
.wa-msg-bot { align-self: flex-start; }
.wa-msg-user { align-self: flex-end; }
.wa-msg-bubble {
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 1px 1px rgba(0,0,0,0.08);
    white-space: pre-wrap;
}
.wa-msg-bot .wa-msg-bubble { background: #fff; color: #111; border-top-left-radius: 2px; }
.wa-msg-user .wa-msg-bubble { background: #DCF8C6; color: #111; border-top-right-radius: 2px; }

.wa-options {
    align-self: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
    margin-top: 2px;
}
.wa-option-btn {
    background: #fff;
    border: 1px solid #25D366;
    color: #075E54;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.wa-option-btn:hover { background: #25D366; color: #fff; }
.wa-option-btn:disabled { opacity: 0.5; cursor: default; }

.wa-typing {
    align-self: flex-start;
    background: #fff;
    border-radius: 10px;
    border-top-left-radius: 2px;
    padding: 10px 14px;
    display: flex;
    gap: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}
.wa-typing span {
    width: 6px; height: 6px; border-radius: 50%; background: #999;
    animation: wa-typing-bounce 1.2s infinite ease-in-out;
}
.wa-typing span:nth-child(2) { animation-delay: 0.15s; }
.wa-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes wa-typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.wa-contact-card {
    align-self: stretch;
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wa-contact-card input[type="text"],
.wa-contact-card input[type="tel"] {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 14px;
}
.wa-contact-card input:focus { outline: none; border-color: #25D366; }
.wa-contact-hint { font-size: 11px; color: #777; margin-top: -4px; }
.wa-contact-consent { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: #555; }
.wa-contact-consent input { margin-top: 3px; }
.wa-contact-submit {
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.wa-contact-submit:disabled { opacity: 0.6; cursor: default; }
.wa-contact-error { color: #d33; font-size: 12px; }

.wa-widget-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 480px) {
    .wa-widget-panel {
        right: 12px;
        left: 12px;
        bottom: 88px;
        width: auto;
        max-width: none;
        height: min(70vh, calc(100vh - 120px));
    }
    .wa-widget-launcher { right: 16px; bottom: 16px; }
}
