.carx-wa-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366, #128c7e);
    box-shadow: 0 6px 18px rgba(18, 140, 126, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.carx-wa-button:hover {
    transform: scale(1.07);
    box-shadow: 0 8px 22px rgba(18, 140, 126, 0.5);
}

.carx-wa-button svg {
    width: 30px;
    height: 30px;
    fill: #fff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.carx-wa-button.carx-wa-open svg.carx-wa-icon-chat {
    transform: scale(0.5);
    opacity: 0;
    position: absolute;
}

.carx-wa-button svg.carx-wa-icon-close {
    position: absolute;
    transform: scale(0.5);
    opacity: 0;
    width: 24px;
    height: 24px;
}

.carx-wa-button.carx-wa-open svg.carx-wa-icon-close {
    transform: scale(1);
    opacity: 1;
}

.carx-wa-status-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #4caf50;
    border: 2px solid #fff;
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.6);
    animation: carx-wa-pulse 2.2s infinite;
}

@keyframes carx-wa-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.carx-wa-panel {
    position: fixed;
    right: 20px;
    bottom: 92px;
    z-index: 999998;
    width: 336px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transform-origin: bottom right;
    transform: scale(0.92) translateY(12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.18s ease, opacity 0.18s ease, visibility 0.18s;
}

.carx-wa-panel.carx-wa-visible {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.carx-wa-panel-header {
    background: linear-gradient(135deg, #128c7e, #075e54);
    color: #fff;
    padding: 18px 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.carx-wa-panel-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 16px;
    background: #fff;
    border-radius: 16px 16px 0 0;
}

.carx-wa-avatar {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carx-wa-avatar svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.carx-wa-header-text {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 2px;
}

.carx-wa-header-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carx-wa-header-status {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
}

.carx-wa-header-status .carx-wa-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4cd964;
    flex: 0 0 auto;
}

.carx-wa-panel-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px;
    flex: 0 0 auto;
}

.carx-wa-panel-close:hover {
    color: #fff;
}

.carx-wa-panel-body {
    padding: 16px 16px 18px;
    background: #e9ddd0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.35) 0, transparent 45%),
        radial-gradient(circle at 80% 60%, rgba(255,255,255,0.25) 0, transparent 40%);
}

.carx-wa-bubble {
    background: #fff;
    border-radius: 4px 12px 12px 12px;
    padding: 10px 12px;
    max-width: 90%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    margin-bottom: 14px;
}

.carx-wa-bubble p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.45;
    color: #1b1b1b;
    white-space: pre-line;
}

.carx-wa-bubble-time {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #8a8a8a;
    text-align: right;
}

.carx-wa-compose {
    background: #fff;
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 4px 4px 4px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.carx-wa-compose input[type="tel"] {
    flex: 1 1 auto;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 10px 6px;
    min-width: 0;
    background: transparent;
}

.carx-wa-send-btn {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #25d366;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.carx-wa-send-btn:hover:not(:disabled) {
    background: #1ebc59;
}

.carx-wa-send-btn:active:not(:disabled) {
    transform: scale(0.94);
}

.carx-wa-send-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.carx-wa-send-btn svg {
    width: 17px;
    height: 17px;
    fill: #fff;
    margin-left: 2px;
}

.carx-wa-error {
    color: #d63638;
    font-size: 12px;
    margin: 8px 2px 0;
    display: none;
}

.carx-wa-hint {
    font-size: 11px;
    color: #6b6b6b;
    margin: 8px 2px 0;
}

@media (max-width: 420px) {
    .carx-wa-panel {
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
        bottom: 88px;
    }
}
