/* ============================================================
   WHATSAPP FUNNEL - STYLES
   ============================================================ */

/* ---- RESET & BASE ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --wa-bg-dark: #111b21;
  --wa-bg-panel: #202c33;
  --wa-bg-deeper: #0b141a;
  --wa-bg-chat: #0b141a;
  --wa-bg-received: #202c33;
  --wa-bg-sent: #005c4b;
  --wa-bg-input: #2a3942;
  --wa-text-primary: #e9edef;
  --wa-text-secondary: #8696a0;
  --wa-green: #00a884;
  --wa-green-dark: #017561;
  --wa-blue-check: #53bdeb;
  --wa-border: #313d45;
  --wa-hover: #2a3942;
  --wa-bubble-tail: 8px;
  --wa-header-h: 60px;
  --wa-input-h: 62px;
  --wa-max-phone: 420px;

  --age-bg: #0a0a0f;
  --age-card: #13131a;
  --age-border: #1f1f2e;
  --age-accent: #00a884;
  --age-text: #e9edef;
  --age-text-dim: #8696a0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--wa-bg-deeper);
  color: var(--wa-text-primary);
}

.hidden { display: none !important; }

/* ============================================================
   AGE GATE
   ============================================================ */
#age-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.age-gate-overlay {
  position: absolute;
  inset: 0;
  background: var(--age-bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(0, 168, 132, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 168, 132, 0.05) 0%, transparent 50%);
}

.age-gate-card {
  position: relative;
  background: var(--age-card);
  border: 1px solid var(--age-border);
  border-radius: 20px;
  padding: 40px 32px 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.age-gate-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0, 168, 132, 0.1);
  color: var(--age-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.age-gate-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--age-text);
  margin-bottom: 8px;
}

.age-gate-text {
  font-size: 14px;
  color: var(--age-text-dim);
  line-height: 1.5;
  margin-bottom: 20px;
}

.age-gate-divider {
  height: 1px;
  background: var(--age-border);
  margin: 0 -8px 20px;
}

.age-gate-question {
  font-size: 16px;
  font-weight: 600;
  color: var(--age-text);
  margin-bottom: 20px;
}

.age-gate-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.age-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.age-btn-confirm {
  background: var(--age-accent);
  color: #fff;
}
.age-btn-confirm:hover { background: #00c49a; transform: translateY(-1px); }
.age-btn-confirm:active { transform: translateY(0); }

.age-btn-deny {
  background: transparent;
  color: var(--age-text-dim);
  border: 1px solid var(--age-border);
}
.age-btn-deny:hover { border-color: var(--age-text-dim); }

.age-gate-disclaimer {
  font-size: 11px;
  color: var(--age-text-dim);
  margin-top: 16px;
  line-height: 1.4;
  opacity: 0.7;
}

/* ============================================================
   CHAT SCREEN
   ============================================================ */
#chat-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wa-bg-deeper);
}

/* Chat container - full screen em qualquer tela */
.phone-frame {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--wa-bg-chat);
  overflow: hidden;
}

/* ---- HEADER ---- */
#chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 0 4px;
  height: var(--wa-header-h);
  min-height: var(--wa-header-h);
  background: var(--wa-bg-panel);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  z-index: 10;
}

.header-back {
  background: none;
  border: none;
  color: var(--wa-text-secondary);
  padding: 8px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--wa-bg-input);
}
.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wa-bg-input);
}

.header-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.header-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--wa-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-status {
  font-size: 13px;
  color: var(--wa-text-secondary);
  transition: color 0.3s;
}
.header-status.online { color: var(--wa-text-secondary); }
.header-status.typing { color: var(--wa-green); }

.header-actions {
  display: flex;
  gap: 2px;
}
.header-action {
  background: none;
  border: none;
  color: var(--wa-text-secondary);
  padding: 8px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
}

/* ---- CHAT MESSAGES ---- */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.chat-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Ctext x='10' y='20' font-size='14' fill='white' opacity='0.6'%3E%F0%9F%92%AC%3C/text%3E%3Ctext x='60' y='50' font-size='10' fill='white' opacity='0.4'%3E%F0%9F%93%B7%3C/text%3E%3Ctext x='120' y='30' font-size='12' fill='white' opacity='0.5'%3E%F0%9F%94%92%3C/text%3E%3Ctext x='30' y='90' font-size='11' fill='white' opacity='0.3'%3E%F0%9F%92%95%3C/text%3E%3Ctext x='150' y='80' font-size='13' fill='white' opacity='0.4'%3E%E2%9C%A8%3C/text%3E%3Ctext x='90' y='120' font-size='10' fill='white' opacity='0.3'%3E%F0%9F%93%B1%3C/text%3E%3Ctext x='20' y='150' font-size='12' fill='white' opacity='0.5'%3E%F0%9F%94%91%3C/text%3E%3Ctext x='140' y='140' font-size='11' fill='white' opacity='0.4'%3E%F0%9F%92%8B%3C/text%3E%3Ctext x='70' y='170' font-size='9' fill='white' opacity='0.3'%3E%F0%9F%93%B9%3C/text%3E%3Ctext x='170' y='180' font-size='10' fill='white' opacity='0.3'%3E%F0%9F%94%A5%3C/text%3E%3C/svg%3E");
  background-size: 200px;
}

.messages-container {
  position: relative;
  padding: 8px 16px 12px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

/* Encryption notice */
.encryption-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 168, 132, 0.08);
  color: var(--wa-text-secondary);
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: 8px;
  margin: 4px auto 12px;
  max-width: 320px;
  text-align: center;
  line-height: 1.3;
}
.encryption-notice svg {
  flex-shrink: 0;
  stroke: var(--wa-text-secondary);
}

/* ---- MESSAGE BUBBLES ---- */
.message {
  max-width: 80%;
  margin-bottom: 2px;
  animation: msgAppear 0.25s ease;
  position: relative;
}

@keyframes msgAppear {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.first-in-group { margin-top: 8px; }

.message-received {
  align-self: flex-start;
}
.message-sent {
  align-self: flex-end;
}

.bubble {
  padding: 6px 8px 8px;
  border-radius: 8px;
  position: relative;
  word-wrap: break-word;
  line-height: 1.35;
  font-size: 14.2px;
}

.message-received .bubble {
  background: var(--wa-bg-received);
}
.message-received.has-tail .bubble {
  border-top-left-radius: 0;
}
.message-received.has-tail .bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: -8px;
  width: 8px;
  height: 13px;
  background: var(--wa-bg-received);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.message-sent .bubble {
  background: var(--wa-bg-sent);
  border-top-right-radius: 0;
}

.bubble-text {
  color: var(--wa-text-primary);
  margin-right: 48px;
}

.bubble-meta {
  float: right;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  margin-left: 8px;
  position: relative;
  top: 5px;
}

.bubble-time {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}

.bubble-check {
  display: flex;
  color: var(--wa-blue-check);
}

/* Photo messages */
.message-photo .bubble {
  padding: 3px;
  overflow: hidden;
  max-width: 280px;
}
.message-photo .photo-wrapper {
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: var(--wa-bg-input);
  min-height: 120px;
}
.message-photo img {
  width: 100%;
  display: block;
  border-radius: 5px;
  transition: filter 0.3s;
}
.message-photo img.blurred {
  filter: blur(6px) brightness(0.85);
}
.message-photo .photo-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0,0,0,0.3);
  color: white;
  font-size: 13px;
  font-weight: 500;
}
.message-photo .photo-lock-overlay svg {
  opacity: 0.9;
}
.message-photo .bubble-meta {
  float: right;
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 4px 2px 0 8px;
}
.message-photo .bubble-time {
  color: rgba(255,255,255,0.45);
  font-size: 11px;
}

/* Placeholder for missing images */
.photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 320px;
  background: linear-gradient(135deg, var(--wa-bg-input) 0%, var(--wa-bg-panel) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--wa-text-secondary);
  font-size: 12px;
  border-radius: 5px;
}

/* Video messages */
.message-video .bubble {
  padding: 3px;
  overflow: hidden;
  max-width: 280px;
}
.message-video .video-wrapper {
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: #000;
  min-height: 120px;
  cursor: pointer;
}
.message-video video {
  width: 100%;
  display: block;
  border-radius: 5px;
  transition: filter 0.3s;
  max-height: 360px;
  object-fit: cover;
}
.message-video video.blurred,
.video-viewer-video.blurred {
  filter: blur(6px) brightness(0.85);
}
.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.2s;
}
.video-play-icon.playing {
  opacity: 0;
}
.video-duration {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: white;
  font-size: 11px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  z-index: 1;
}
.video-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0,0,0,0.3);
  color: white;
  font-size: 13px;
  font-weight: 500;
  z-index: 2;
}
.video-lock-overlay svg {
  opacity: 0.9;
}
.message-video .bubble-meta {
  float: right;
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 4px 2px 0 8px;
}
.message-video .bubble-time {
  color: rgba(255,255,255,0.45);
  font-size: 11px;
}
.video-cam-icon {
  display: flex;
  color: rgba(255,255,255,0.9);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.media-check {
  display: flex;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.video-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 240px;
  background: linear-gradient(135deg, var(--wa-bg-input) 0%, var(--wa-bg-panel) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--wa-text-secondary);
  font-size: 12px;
  border-radius: 5px;
}

/* Toast notification */
.wa-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--wa-bg-panel);
  color: var(--wa-text-primary);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 200;
  animation: toastIn 0.25s ease, toastOut 0.25s ease 2.5s forwards;
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ---- TYPING INDICATOR ---- */
.typing-indicator {
  align-self: flex-start;
  animation: msgAppear 0.2s ease;
}
.typing-indicator .bubble {
  background: var(--wa-bg-received);
  padding: 10px 14px;
  display: flex;
  gap: 4px;
  align-items: center;
  border-top-left-radius: 0;
}
.typing-indicator .bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: -8px;
  width: 8px;
  height: 13px;
  background: var(--wa-bg-received);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wa-text-secondary);
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ---- INPUT AREA ---- */
#chat-input {
  background: var(--wa-bg-panel);
  border-top: 1px solid rgba(255,255,255,0.03);
  z-index: 10;
}

.input-container {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  min-height: var(--wa-input-h);
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.input-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  border-radius: 50%;
}

.input-field {
  flex: 1;
  background: var(--wa-bg-input);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 42px;
  display: flex;
  align-items: center;
}
.input-placeholder {
  color: var(--wa-text-secondary);
  font-size: 15px;
}

/* ---- QUICK REPLIES ---- */
.quick-replies {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideUp 0.3s ease;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.quick-reply-btn {
  background: transparent;
  border: 1.5px solid var(--wa-green);
  color: var(--wa-green);
  padding: 12px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.quick-reply-btn:hover {
  background: rgba(0, 168, 132, 0.1);
}
.quick-reply-btn:active {
  background: var(--wa-green);
  color: #fff;
  transform: scale(0.97);
}

/* ============================================================
   PAYMENT MODAL
   ============================================================ */
#payment-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.payment-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.payment-sheet {
  position: relative;
  background: var(--wa-bg-panel);
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 32px;
  animation: sheetUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  .payment-sheet {
    border-radius: 20px;
    margin-bottom: 20px;
    max-height: 85vh;
  }
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.payment-handle {
  width: 36px;
  height: 4px;
  background: var(--wa-border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.payment-header {
  text-align: center;
  margin-bottom: 20px;
}
.payment-lock {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 168, 132, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.payment-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--wa-text-primary);
  margin-bottom: 4px;
}
.payment-desc {
  font-size: 14px;
  color: var(--wa-text-secondary);
}

.payment-price-box {
  text-align: center;
  padding: 16px;
  background: rgba(0, 168, 132, 0.06);
  border: 1px solid rgba(0, 168, 132, 0.15);
  border-radius: 14px;
  margin-bottom: 16px;
}
.payment-currency {
  font-size: 18px;
  font-weight: 600;
  color: var(--wa-green);
  vertical-align: super;
}
.payment-amount {
  font-size: 40px;
  font-weight: 800;
  color: var(--wa-green);
  letter-spacing: -1px;
}
.payment-period {
  display: block;
  font-size: 13px;
  color: var(--wa-text-secondary);
  margin-top: 2px;
}

.payment-benefits {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.benefit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--wa-text-primary);
}
.benefit-item svg { flex-shrink: 0; }

/* Payment methods info (icons) */
.payment-methods-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  margin-bottom: 4px;
}
.method-icon {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--wa-text-secondary);
  font-size: 12px;
}

/* Trust badges */
.trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.trust-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--wa-text-secondary);
  background: var(--wa-bg-input);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--wa-border);
}

/* Payment buttons */
.payment-btn {
  width: 100%;
  padding: 14px;
  background: var(--wa-green);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.payment-btn:hover { background: #00c49a; }
.payment-btn:active { transform: scale(0.98); }

.payment-secure {
  text-align: center;
  font-size: 12px;
  color: var(--wa-text-secondary);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Processing */
.processing-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--wa-border);
  border-top-color: var(--wa-green);
  border-radius: 50%;
  margin: 20px auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.processing-text {
  text-align: center;
  color: var(--wa-text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

/* Success */
#payment-success {
  text-align: center;
  padding: 12px 0;
}
.success-icon {
  margin-bottom: 16px;
  animation: successPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes successPop {
  from { transform: scale(0); }
  50% { transform: scale(1.2); }
  to { transform: scale(1); }
}
.success-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--wa-green);
  margin-bottom: 4px;
}
.success-text {
  font-size: 14px;
  color: var(--wa-text-secondary);
  margin-bottom: 24px;
}

/* Currency label next to amount */
.payment-currency-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--wa-green);
  margin-left: 2px;
}

/* ---- CLABE Display Card ---- */
.clabe-card {
  background: var(--wa-bg-input);
  border: 1px solid var(--wa-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.clabe-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--wa-green);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--wa-border);
}
.clabe-field {
  margin-bottom: 14px;
}
.clabe-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--wa-text-secondary);
  margin-bottom: 6px;
}
.clabe-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.clabe-number {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--wa-text-primary);
  letter-spacing: 1.5px;
  flex: 1;
  word-break: break-all;
}
.clabe-copy-btn {
  background: rgba(0, 168, 132, 0.1);
  border: 1px solid rgba(0, 168, 132, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wa-text-secondary);
  transition: all 0.2s;
  flex-shrink: 0;
}
.clabe-copy-btn:hover {
  background: rgba(0, 168, 132, 0.2);
  color: var(--wa-green);
}
.clabe-copy-btn.copied {
  background: rgba(0, 168, 132, 0.15);
  border-color: var(--wa-green);
}
.clabe-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.clabe-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.clabe-detail-label {
  font-size: 13px;
  color: var(--wa-text-secondary);
}
.clabe-detail-value {
  font-size: 13px;
  color: var(--wa-text-primary);
  font-weight: 500;
  text-align: right;
}
.clabe-detail-value.clabe-amount {
  color: var(--wa-green);
  font-weight: 700;
  font-size: 15px;
}
.clabe-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--wa-text-secondary);
  line-height: 1.4;
}
.clabe-warning svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---- Waiting / Polling Animation ---- */
.clabe-waiting {
  text-align: center;
  padding: 16px 0 4px;
}
.waiting-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}
.waiting-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--wa-green);
  animation: waitingPulse 1.4s infinite ease-in-out;
}
.waiting-dots span:nth-child(1) { animation-delay: 0s; }
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes waitingPulse {
  0%, 60%, 100% { transform: scale(0.6); opacity: 0.3; }
  30% { transform: scale(1); opacity: 1; }
}

.waiting-text {
  font-size: 14px;
  color: var(--wa-text-primary);
  font-weight: 500;
  margin-bottom: 4px;
}
.waiting-ellipsis::after {
  content: '';
  animation: ellipsis 1.5s infinite;
}
@keyframes ellipsis {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}
.waiting-subtext {
  font-size: 12px;
  color: var(--wa-text-secondary);
}

/* ---- Payment Error State ---- */
#payment-error {
  text-align: center;
  padding: 12px 0;
}
.error-icon {
  margin-bottom: 16px;
  animation: successPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.error-title {
  font-size: 20px;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 4px;
}
.error-text {
  font-size: 14px;
  color: var(--wa-text-secondary);
  margin-bottom: 24px;
}

/* ============================================================
   PROFILE VIEW
   ============================================================ */
#profile-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--wa-bg-deeper);
  animation: slideInRight 0.25s ease;
  overflow-y: auto;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.profile-view-screen {
  max-width: 820px;
  margin: 0 auto;
}
.profile-view-header {
  display: flex;
  align-items: center;
  padding: 0 6px;
  height: 56px;
  background: var(--wa-bg-panel);
}
.profile-view-back {
  background: none;
  border: none;
  color: var(--wa-text-secondary);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.profile-view-header-spacer { flex: 1; }
.profile-view-dots {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.profile-view-avatar-section {
  background: var(--wa-bg-panel);
  text-align: center;
  padding: 20px 0 24px;
}
.profile-view-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 14px;
  background: var(--wa-bg-input);
}
.profile-view-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-view-name {
  font-size: 20px;
  font-weight: 500;
  color: var(--wa-text-primary);
  margin-bottom: 2px;
}
.profile-view-phone {
  font-size: 14px;
  color: var(--wa-text-secondary);
}
.profile-view-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
  background: var(--wa-bg-panel);
  padding: 0 20px 20px;
}
.profile-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--wa-green);
  font-size: 12px;
  font-family: inherit;
}
.profile-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 168, 132, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-view-section {
  background: var(--wa-bg-panel);
  margin-top: 8px;
  padding: 14px 20px;
}
.profile-view-recado {
  font-size: 15px;
  color: var(--wa-text-primary);
  margin-bottom: 4px;
}
.profile-view-recado-date {
  font-size: 12px;
  color: var(--wa-text-secondary);
}
.profile-view-media-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--wa-text-secondary);
  margin-bottom: 10px;
}
.profile-media-count {
  color: var(--wa-text-secondary);
  font-size: 13px;
}
.profile-view-media-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}
.profile-media-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 2px;
  background: var(--wa-bg-input);
}
.profile-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-media-thumb-video {
  position: relative;
}
.profile-media-thumb-video::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

/* ============================================================
   IMAGE VIEWER (fullscreen WhatsApp style)
   ============================================================ */
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
}
.image-viewer-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.6);
  min-height: 56px;
}
.image-viewer-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.image-viewer-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.image-viewer-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.image-viewer-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.image-viewer-name {
  color: white;
  font-size: 15px;
  font-weight: 500;
}
.image-viewer-date {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
}
.image-viewer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.image-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ============================================================
   VIDEO VIEWER (fullscreen WhatsApp style with glass controls)
   ============================================================ */
.video-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
}
.video-viewer-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  min-height: 56px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 2;
  transition: opacity 0.3s;
}
.video-viewer-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.video-viewer-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.video-viewer-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.video-viewer-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.video-viewer-name {
  color: white;
  font-size: 15px;
  font-weight: 500;
}
.video-viewer-date {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
}
.video-viewer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.video-viewer-video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.video-viewer-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 24px;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 2;
  transition: opacity 0.3s;
}
.vv-play-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.vv-time {
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 32px;
}
.vv-progress {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.vv-progress-fill {
  height: 100%;
  background: white;
  border-radius: 2px;
  width: 0%;
  position: relative;
  transition: width 0.1s linear;
}
.vv-progress-handle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ============================================================
   ANTI-DOWNLOAD PROTECTION
   ============================================================ */
img, video {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: auto;
}
.photo-wrapper img,
.video-wrapper video,
.image-viewer-img,
.video-viewer-video {
  -webkit-user-drag: none;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
#chat-messages::-webkit-scrollbar {
  width: 6px;
}
#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
#chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

/* ============================================================
   INLINE PAYMENT DATA CARDS
   ============================================================ */
.payment-data-bubble {
  background: var(--wa-bg-received) !important;
  border: 1px solid var(--wa-border);
  padding: 10px 12px 6px !important;
}

.payment-data-label {
  font-size: 11px;
  color: var(--wa-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.payment-data-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-data-value {
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--wa-text-primary);
  word-break: break-all;
  flex: 1;
}

.payment-data-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 168, 132, 0.15);
  border: 1px solid rgba(0, 168, 132, 0.3);
  color: var(--wa-green);
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.payment-data-copy-btn:active {
  transform: scale(0.95);
}

.payment-data-copy-btn.copied {
  background: rgba(0, 168, 132, 0.25);
  border-color: var(--wa-green);
}

/* Payment waiting spinner */
.payment-waiting-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px !important;
  background: var(--wa-bg-received) !important;
}

.payment-waiting-icon {
  flex-shrink: 0;
}

.waiting-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--wa-border);
  border-top-color: var(--wa-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.payment-waiting-text {
  font-size: 13px;
  color: var(--wa-text-secondary);
  font-style: italic;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 374px) {
  .bubble { font-size: 13.5px; }
  .age-gate-card { padding: 28px 20px 24px; }
  .age-gate-title { font-size: 20px; }
  .payment-sheet { padding: 12px 16px 24px; }
  .payment-amount { font-size: 34px; }
}

@media (min-width: 768px) {
  .phone-frame {
    max-width: none;
  }
}
