/* ==========================================================================
   VO GROUP — Chatbot Widget
   Glassmorphism style, BEM naming, responsive
   Z-index: 9999 (above cotizador at 9998)
   ========================================================================== */

/* --- Design Tokens (scoped to chatbot) --- */
.vo-chatbot {
  --cb-primary: var(--color-primary, #00387d);
  --cb-primary-dark: #00265e;
  --cb-green: var(--color-secondary, #45832e);
  --cb-green-light: #2d8b4e;
  --cb-white: #ffffff;
  --cb-bg: #f9f9f9;
  --cb-bg-alt: #f0f2f5;
  --cb-text: #333333;
  --cb-text-light: #666666;
  --cb-text-muted: #999999;
  --cb-border: #e0e0e0;
  --cb-danger: #dc3545;
  --cb-shadow: rgba(0, 38, 94, 0.18);
  --cb-radius: 16px;
  --cb-radius-sm: 8px;
  --cb-radius-msg: 18px;
  --cb-transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --cb-transition-fast: 0.15s ease;
  --cb-font: var(--font-family, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  --cb-font-heading: 'Outfit', var(--cb-font);
  --cb-panel-width: 380px;
  --cb-panel-height: 520px;
  --cb-fab-size: 60px;
  --cb-z: 9999;
}

/* --- Container --- */
.vo-chatbot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--cb-z);
  font-family: var(--cb-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--cb-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.vo-chatbot__fab {
  width: var(--cb-fab-size);
  height: var(--cb-fab-size);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cb-primary) 0%, #004a9e 100%);
  color: var(--cb-white);
  box-shadow:
    0 4px 16px var(--cb-shadow),
    0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform var(--cb-transition), box-shadow var(--cb-transition);
  position: relative;
  z-index: calc(var(--cb-z) + 1);
  outline: none;
}

.vo-chatbot__fab:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 24px var(--cb-shadow),
    0 3px 8px rgba(0, 0, 0, 0.12);
}

.vo-chatbot__fab:focus-visible {
  outline: 3px solid rgba(0, 56, 125, 0.5);
  outline-offset: 3px;
}

.vo-chatbot__fab:active {
  transform: scale(0.95);
}

/* FAB icon toggle */
.vo-chatbot__fab-icon {
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: absolute;
}

.vo-chatbot__fab-icon--close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.vo-chatbot.is-open .vo-chatbot__fab-icon--chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.vo-chatbot.is-open .vo-chatbot__fab-icon--close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* FAB pulse animation (only when closed) */
.vo-chatbot:not(.is-open) .vo-chatbot__fab::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-primary), #004a9e);
  opacity: 0;
  z-index: -1;
  animation: vo-chatbot-pulse 2.5s ease-in-out infinite;
}

@keyframes vo-chatbot-pulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(1.15); }
}

/* --- Unread Badge --- */
.vo-chatbot__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--cb-danger);
  color: var(--cb-white);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--cb-white);
  pointer-events: none;
  animation: vo-chatbot-badge-pop 0.3s ease;
}

@keyframes vo-chatbot-badge-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   CHAT PANEL
   ========================================================================== */

.vo-chatbot__panel {
  position: absolute;
  bottom: calc(var(--cb-fab-size) + 16px);
  right: 0;
  width: var(--cb-panel-width);
  height: var(--cb-panel-height);
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  background: var(--cb-white);
  border-radius: var(--cb-radius);
  box-shadow:
    0 12px 48px var(--cb-shadow),
    0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  transition:
    transform var(--cb-transition),
    opacity var(--cb-transition),
    visibility var(--cb-transition);
}

.vo-chatbot__panel:not([hidden]) {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   HEADER — Glassmorphism
   ========================================================================== */

.vo-chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(0, 56, 125, 0.92), rgba(0, 74, 158, 0.88));
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--cb-white);
  flex-shrink: 0;
}

.vo-chatbot__header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vo-chatbot__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--cb-font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--cb-white);
  flex-shrink: 0;
  overflow: hidden;
}

.vo-chatbot__avatar img,
.vo-chatbot__msg-avatar img,
.vo-chatbot__typing-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.vo-chatbot__header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.vo-chatbot__title {
  font-family: var(--cb-font-heading);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--cb-white);
  line-height: 1.3;
}

.vo-chatbot__status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 5px;
}

.vo-chatbot__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
  animation: vo-chatbot-dot-blink 2s ease-in-out infinite;
}

@keyframes vo-chatbot-dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.vo-chatbot__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--cb-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--cb-transition-fast);
  outline: none;
  flex-shrink: 0;
}

.vo-chatbot__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.vo-chatbot__close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

/* ==========================================================================
   GATE FORM
   ========================================================================== */

.vo-chatbot__gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
  animation: vo-chatbot-fade-in 0.4s ease;
}

/* Ensure [hidden] works despite display:flex */
.vo-chatbot__gate[hidden],
.vo-chatbot__chat[hidden],
.vo-chatbot__ended[hidden],
.vo-chatbot__typing[hidden] {
  display: none !important;
}

@keyframes vo-chatbot-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.vo-chatbot__gate-header {
  text-align: center;
  margin-bottom: 20px;
}

.vo-chatbot__gate-icon {
  font-size: 36px;
  margin-bottom: 8px;
  line-height: 1;
}

.vo-chatbot__gate-title {
  font-family: var(--cb-font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--cb-primary);
  margin: 0 0 6px;
  line-height: 1.3;
}

.vo-chatbot__gate-subtitle {
  font-size: 13px;
  color: var(--cb-text-light);
  margin: 0;
}

.vo-chatbot__gate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --- Form Fields --- */
.vo-chatbot__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vo-chatbot__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--cb-text);
}

.vo-chatbot__input-field {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--cb-border);
  border-radius: var(--cb-radius-sm);
  font-family: var(--cb-font);
  font-size: 14px;
  color: var(--cb-text);
  background: var(--cb-white);
  transition: border-color var(--cb-transition-fast), box-shadow var(--cb-transition-fast);
  outline: none;
}

.vo-chatbot__input-field::placeholder {
  color: var(--cb-text-muted);
}

.vo-chatbot__input-field:focus {
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 3px rgba(0, 56, 125, 0.1);
}

.vo-chatbot__input-field.is-invalid {
  border-color: var(--cb-danger);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.vo-chatbot__field-error {
  font-size: 12px;
  color: var(--cb-danger);
  min-height: 0;
  overflow: hidden;
  transition: min-height 0.2s ease;
}

.vo-chatbot__field-error:not(:empty) {
  min-height: 16px;
}

/* --- Checkbox --- */
.vo-chatbot__checkbox {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.vo-chatbot__checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--cb-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.vo-chatbot__checkbox-label {
  font-size: 13px;
  color: var(--cb-text-light);
  flex: 1;
  cursor: pointer;
  line-height: 1.4;
}

.vo-chatbot__checkbox-label a {
  color: var(--cb-primary);
  text-decoration: underline;
  text-decoration-color: rgba(0, 56, 125, 0.3);
  transition: text-decoration-color var(--cb-transition-fast);
}

.vo-chatbot__checkbox-label a:hover {
  text-decoration-color: var(--cb-primary);
}

/* --- Submit Button --- */
.vo-chatbot__submit {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: var(--cb-radius-sm);
  background: linear-gradient(135deg, var(--cb-primary) 0%, #004a9e 100%);
  color: var(--cb-white);
  font-family: var(--cb-font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--cb-transition-fast), box-shadow var(--cb-transition-fast), opacity var(--cb-transition-fast);
  outline: none;
  margin-top: 4px;
}

.vo-chatbot__submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--cb-shadow);
}

.vo-chatbot__submit:active:not(:disabled) {
  transform: translateY(0);
}

.vo-chatbot__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.vo-chatbot__submit:focus-visible {
  outline: 3px solid rgba(0, 56, 125, 0.4);
  outline-offset: 2px;
}

/* Spinner */
.vo-chatbot__submit-spinner svg {
  animation: vo-chatbot-spin 1s linear infinite;
}

@keyframes vo-chatbot-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   CHAT AREA
   ========================================================================== */

.vo-chatbot__chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: vo-chatbot-fade-in 0.4s ease;
}

/* --- Messages Container --- */
.vo-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  background: #ffffff;
}

/* Custom scrollbar */
.vo-chatbot__messages::-webkit-scrollbar {
  width: 5px;
}

.vo-chatbot__messages::-webkit-scrollbar-track {
  background: transparent;
}

.vo-chatbot__messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.vo-chatbot__messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* Firefox scrollbar */
.vo-chatbot__messages {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* --- Message Bubbles --- */
.vo-chatbot__message {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: vo-chatbot-msg-in 0.25s ease;
}

@keyframes vo-chatbot-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bot message — left aligned */
.vo-chatbot__message--bot {
  align-self: flex-start;
}

.vo-chatbot__message--bot .vo-chatbot__msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-primary) 0%, #004a9e 100%);
  color: var(--cb-white);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--cb-font-heading);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  letter-spacing: 0.3px;
}

.vo-chatbot__message--bot .vo-chatbot__msg-bubble {
  background: #f0f2f5;
  color: var(--cb-primary);
  border: 1.5px solid var(--cb-primary);
  border-radius: var(--cb-radius-msg) var(--cb-radius-msg) var(--cb-radius-msg) 4px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

/* User message — right aligned */
.vo-chatbot__message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.vo-chatbot__message--user .vo-chatbot__msg-bubble {
  background: #f0f2f5;
  color: #333333;
  border: 1.5px solid var(--cb-green);
  border-radius: var(--cb-radius-msg) var(--cb-radius-msg) 4px var(--cb-radius-msg);
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

/* Links inside messages */
.vo-chatbot__message--bot .vo-chatbot__msg-bubble a {
  color: var(--cb-primary);
  text-decoration: underline;
  text-decoration-color: rgba(0, 56, 125, 0.4);
}

.vo-chatbot__message--user .vo-chatbot__msg-bubble a {
  color: #333333;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.3);
}

.vo-chatbot__message--bot .vo-chatbot__msg-bubble a {
  color: var(--cb-primary);
  text-decoration-color: rgba(0, 56, 125, 0.3);
}

.vo-chatbot__msg-bubble a:hover {
  text-decoration-color: currentColor;
}

/* Bold text in messages */
.vo-chatbot__msg-bubble strong {
  font-weight: 600;
}

/* Timestamp */
.vo-chatbot__msg-time {
  font-size: 11px;
  color: var(--cb-text-muted);
  text-align: center;
  padding: 4px 0;
}

/* Warning message */
.vo-chatbot__message--warning {
  align-self: center;
  max-width: 100%;
}

.vo-chatbot__message--warning .vo-chatbot__msg-bubble {
  background: #fff3cd;
  color: #856404;
  border-radius: var(--cb-radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  text-align: center;
  border: 1px solid #ffc107;
}

/* ==========================================================================
   TYPING INDICATOR
   ========================================================================== */

.vo-chatbot__typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 8px;
  animation: vo-chatbot-fade-in 0.3s ease;
}

.vo-chatbot__typing-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-primary) 0%, #004a9e 100%);
  color: var(--cb-white);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--cb-font-heading);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.vo-chatbot__typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--cb-bg-alt);
  border-radius: var(--cb-radius-msg) var(--cb-radius-msg) var(--cb-radius-msg) 4px;
}

.vo-chatbot__typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cb-text-muted);
  animation: vo-chatbot-bounce 1.4s ease-in-out infinite;
}

.vo-chatbot__typing-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.vo-chatbot__typing-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes vo-chatbot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ==========================================================================
   INPUT AREA
   ========================================================================== */

.vo-chatbot__input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--cb-border);
  background: var(--cb-white);
  flex-shrink: 0;
}

.vo-chatbot__input-wrapper {
  flex: 1;
  position: relative;
}

.vo-chatbot__textarea {
  width: 100%;
  padding: 10px 50px 10px 12px;
  border: 1.5px solid var(--cb-border);
  border-radius: 22px;
  font-family: var(--cb-font);
  font-size: 14px;
  color: var(--cb-text);
  background: var(--cb-white);
  resize: none;
  outline: none;
  min-height: 42px;
  max-height: 100px;
  line-height: 1.4;
  transition: border-color var(--cb-transition-fast), box-shadow var(--cb-transition-fast);
}

.vo-chatbot__textarea::placeholder {
  color: var(--cb-text-muted);
}

.vo-chatbot__textarea:focus {
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 3px rgba(0, 56, 125, 0.08);
  background: var(--cb-white);
}

.vo-chatbot__textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vo-chatbot__char-count {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  color: var(--cb-text-muted);
  pointer-events: none;
  transition: color var(--cb-transition-fast);
}

.vo-chatbot__char-count.is-near-limit {
  color: #e67e22;
}

.vo-chatbot__char-count.is-at-limit {
  color: var(--cb-danger);
  font-weight: 600;
}

/* --- Send Button --- */
.vo-chatbot__send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--cb-primary) 0%, #004a9e 100%);
  color: var(--cb-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--cb-transition-fast), opacity var(--cb-transition-fast);
  outline: none;
}

.vo-chatbot__send:hover:not(:disabled) {
  transform: scale(1.08);
}

.vo-chatbot__send:active:not(:disabled) {
  transform: scale(0.94);
}

.vo-chatbot__send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.vo-chatbot__send:focus-visible {
  outline: 3px solid rgba(0, 56, 125, 0.4);
  outline-offset: 2px;
}

/* --- Rate Limit Info --- */

/* --- End Session Button --- */
.vo-chatbot__end-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--cb-danger);
  background: var(--cb-white);
  color: var(--cb-danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--cb-transition-fast);
  outline: none;
}

.vo-chatbot__end-btn:hover {
  background: var(--cb-danger);
  color: var(--cb-white);
  transform: scale(1.08);
}

.vo-chatbot__end-btn:active {
  transform: scale(0.94);
}

.vo-chatbot__end-btn:focus-visible {
  outline: 3px solid rgba(220, 53, 69, 0.4);
  outline-offset: 2px;
}

/* --- Rate Limit Info --- */
.vo-chatbot__rate-info {
  padding: 6px 16px 10px;
  font-size: 12px;
  color: var(--cb-text-muted);
  text-align: center;
  background: var(--cb-white);
  flex-shrink: 0;
}

.vo-chatbot__rate-info.is-warning {
  color: #e67e22;
  font-weight: 500;
}

.vo-chatbot__rate-info.is-countdown {
  color: var(--cb-primary);
}

/* ==========================================================================
   SESSION ENDED
   ========================================================================== */

.vo-chatbot__ended {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: vo-chatbot-fade-in 0.4s ease;
}

.vo-chatbot__ended-content {
  text-align: center;
}

.vo-chatbot__ended-icon {
  font-size: 48px;
  margin-bottom: 12px;
  line-height: 1;
}

.vo-chatbot__ended-title {
  font-family: var(--cb-font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--cb-text);
  margin: 0 0 8px;
}

.vo-chatbot__ended-text {
  font-size: 13px;
  color: var(--cb-text-light);
  margin: 0 0 20px;
  line-height: 1.5;
}

.vo-chatbot__whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 24px;
  background: #25d366;
  color: var(--cb-white);
  font-family: var(--cb-font);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--cb-transition-fast), box-shadow var(--cb-transition-fast);
}

.vo-chatbot__whatsapp-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  color: var(--cb-white);
}

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .vo-chatbot {
    bottom: 16px;
    right: 16px;
  }

  .vo-chatbot__panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    bottom: 0;
    right: 0;
  }

  .vo-chatbot__panel:not([hidden]) {
    transform: translateY(0) scale(1);
  }

  /* Hide FAB when panel is open on mobile to avoid duplicate close button */
  .vo-chatbot.is-open .vo-chatbot__fab {
    display: none;
  }

  .vo-chatbot__header {
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
  }

  .vo-chatbot__input-area {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Small height screens */
@media (max-height: 600px) {
  .vo-chatbot__panel {
    height: calc(100vh - 80px);
  }

  .vo-chatbot__gate-header {
    margin-bottom: 12px;
  }

  .vo-chatbot__gate-icon {
    font-size: 28px;
    margin-bottom: 4px;
  }
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  .vo-chatbot {
    --cb-white: #1a1a2e;
    --cb-bg: #16162a;
    --cb-bg-alt: #252540;
    --cb-text: #e4e4ea;
    --cb-text-light: #a0a0b0;
    --cb-text-muted: #6a6a80;
    --cb-border: #2d2d48;
    --cb-shadow: rgba(0, 0, 0, 0.4);
  }

  .vo-chatbot__header {
    background: linear-gradient(135deg, rgba(0, 38, 94, 0.96), rgba(0, 56, 125, 0.92));
  }

  .vo-chatbot__message--bot .vo-chatbot__msg-bubble {
    background: var(--cb-bg-alt);
    color: var(--cb-text);
  }

  .vo-chatbot__message--bot .vo-chatbot__msg-bubble a {
    color: #6db3f8;
  }

  .vo-chatbot__message--warning .vo-chatbot__msg-bubble {
    background: #3d3200;
    color: #ffc107;
    border-color: #665200;
  }

  .vo-chatbot__textarea {
    background: var(--cb-bg);
    color: var(--cb-text);
    border-color: var(--cb-border);
  }

  .vo-chatbot__textarea:focus {
    background: var(--cb-white);
  }

  .vo-chatbot__input-field {
    background: var(--cb-bg);
    color: var(--cb-text);
    border-color: var(--cb-border);
  }

  .vo-chatbot__input-field:focus {
    box-shadow: 0 0 0 3px rgba(0, 100, 200, 0.2);
  }

  .vo-chatbot__badge {
    border-color: var(--cb-white);
  }

  .vo-chatbot__fab {
    box-shadow:
      0 4px 16px rgba(0, 0, 0, 0.4),
      0 2px 4px rgba(0, 0, 0, 0.2);
  }

  .vo-chatbot__panel {
    box-shadow:
      0 12px 48px rgba(0, 0, 0, 0.5),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .vo-chatbot__messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
  }

  .vo-chatbot__messages {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  }

  .vo-chatbot__checkbox-label a {
    color: #6db3f8;
  }

  .vo-chatbot__ended-title {
    color: var(--cb-text);
  }
}

/* ==========================================================================
   PRINT — Hide chatbot
   ========================================================================== */

@media print {
  .vo-chatbot {
    display: none !important;
  }
}
