/* ─── WT PANEL — POPUP WIDGET ─────────────────────────────────────────── */

.wt-panel {
    margin-top: 10px;
    border: 1px solid #d0dcff;
    border-radius: 10px;
    padding: 10px;
    background: linear-gradient(135deg, #f8faff 0%, #eef3ff 100%);
    box-shadow: 0 2px 10px rgba(61, 86, 201, 0.08);
}

.wt-header {
    font-size: 12px;
    font-weight: 700;
    color: #2f3f88;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid #d0dcff;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}

/* ─── PRESET QUICK-MESSAGES ───────────────────────────────────────────── */
.wt-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.wt-preset {
    border: 1px solid #c0d2ff;
    background: #fff;
    color: #3d56c9;
    border-radius: 999px;
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    line-height: 1.4;
}

.wt-preset:hover {
    background: #3d56c9;
    color: #fff;
    border-color: #3d56c9;
    transform: translateY(-1px);
}

.wt-preset:active {
    transform: translateY(0);
}

/* ─── MESSAGES AREA ───────────────────────────────────────────────────── */
.wt-messages {
    max-height: 100px;
    overflow-y: auto;
    border: 1px solid #dde6ff;
    border-radius: 8px;
    background: #fff;
    padding: 6px 8px;
}

.wt-msg {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    border-bottom: 1px solid #f0f2fa;
    padding: 4px 0;
}

.wt-msg:last-child {
    border-bottom: 0;
}

.wt-msg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.wt-msg-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.wt-msg-temp {
    background: #f4f8ff;
    border: 1px solid #d8e5ff;
    border-radius: 10px;
    padding: 6px;
    margin: 4px 0;
}

.wt-dismiss {
    border: 0;
    background: transparent;
    color: #8b93b0;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.wt-dismiss:hover {
    color: #3d56c9;
}

.wt-msg small {
    color: #8b93b0;
}

.wt-temp-meta {
    color: #6173a9;
    font-size: 10px;
    line-height: 1.25;
    margin-top: 2px;
}

.wt-temp-meta a {
    color: #3d56c9;
    font-weight: 600;
}

.wt-empty {
    font-size: 11px;
    color: #a0aabf;
    text-align: center;
    padding: 4px 0;
}

/* ─── INPUT + SEND ────────────────────────────────────────────────────── */
.wt-footer {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.wt-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #c0d2ff;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    background: #fff;
    color: #1f2937;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wt-input:focus {
    border-color: #3d56c9;
    box-shadow: 0 0 0 2px rgba(61, 86, 201, 0.14);
}

.wt-input::placeholder {
    color: #b0bcd8;
}

.wt-send {
    border: none;
    border-radius: 8px;
    background: #1f2937;
    color: #fff;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 6px rgba(31, 41, 55, 0.25);
}

.wt-send:hover {
    background: #374151;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(31, 41, 55, 0.3);
}

.wt-send:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(31, 41, 55, 0.2);
}

.wt-input:disabled,
.wt-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ─── WT STATUS BADGE ─────────────────────────────────────────────────── */
.wt-status-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    vertical-align: middle;
    cursor: default;
}

/* ─── CHANNEL NOTICES ─────────────────────────────────────────────────── */
.wt-channel-notice {
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 11px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.wt-notice-closed,
.wt-notice-self_closed {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.wt-notice-blocked {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}

.wt-notice-restricted {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.wt-notice-restricted a,
.wt-notice-closed a,
.wt-notice-self_closed a,
.wt-notice-blocked a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

/* ─── RESPONSIVE: hide on mobile ─────────────────────────────────────── */
@media (max-width: 480px) {
    .wt-panel {
        display: none !important;
    }
}

/* ─── INTERACTION ACTION BUTTONS (Señal / Cotizar / Reservar) ─────────── */
.wt-actions {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.wt-action-btn {
    flex: 1;
    min-width: 58px;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 8px;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
    white-space: nowrap;
    line-height: 1.3;
}
.wt-action-btn:hover  { filter: brightness(1.1); transform: translateY(-1px); }
.wt-action-btn:active { transform: translateY(0); filter: brightness(.95); }
.wt-action-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.wt-action-senal    { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.wt-action-cotizar  { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.wt-action-reservar { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }

/* ─── INTERACTION FORM (inline expand) ───────────────────────────────── */
.wt-interaction-form {
    background: #f8faff;
    border: 1px solid #c8d8ff;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
}
.wt-if-title {
    font-size: 11px;
    font-weight: 700;
    color: #2f3f88;
    margin-bottom: 5px;
}
.wt-if-textarea {
    width: 100%;
    border: 1px solid #c0d2ff;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    resize: none;
    font-family: inherit;
    background: #fff;
    color: #1f2937;
    outline: none;
    box-sizing: border-box;
}
.wt-if-textarea:focus {
    border-color: #3d56c9;
    box-shadow: 0 0 0 2px rgba(61,86,201,.12);
}
.wt-if-footer { display: flex; gap: 5px; margin-top: 6px; }
.wt-if-send {
    flex: 1;
    border: none;
    border-radius: 6px;
    background: #3d56c9;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 0;
    cursor: pointer;
    transition: background 0.15s;
}
.wt-if-send:hover { background: #2d44b0; }
.wt-if-send:disabled { opacity: .55; cursor: not-allowed; }
.wt-if-cancel {
    border: 1px solid #c0d2ff;
    border-radius: 6px;
    background: #fff;
    color: #3d56c9;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.wt-if-cancel:hover { background: #eef3ff; }

/* ─── CHAR COUNTER ────────────────────────────────────────────────────── */
.wt-footer { align-items: center; }
.wt-input-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
}
.wt-input-wrap .wt-input { width: 100%; box-sizing: border-box; padding-right: 34px; }
.wt-char-count {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 9px;
    color: #b0bcd8;
    pointer-events: none;
    font-weight: 700;
    transition: color 0.15s;
    line-height: 1;
}
.wt-char-count.wt-warn   { color: #f59e0b; }
.wt-char-count.wt-danger { color: #ef4444; }

/* ─── DISMISS BUTTON (own messages) ──────────────────────────────────── */
.wt-msg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.wt-msg-dismiss {
    border: 0;
    background: transparent;
    color: #d0d8f0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
    flex-shrink: 0;
}
.wt-msg-dismiss:hover { color: #ef4444; }
