/* ═══════════════════════════════════════════════════════════
   gen-whatsapp.css — simulación de WhatsApp (teléfono, modo claro y oscuro)
   Solo el aspecto de WhatsApp; el editor usa generadores.css.
   ═══════════════════════════════════════════════════════════ */
.wa-font { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
.phone-scale-wrap { flex-shrink: 0; }
.phone-frame, .phone-frame *, .phone-frame *::before, .phone-frame *::after { box-sizing: border-box; }
.phone-frame {
  width: 380px; height: 780px; border-radius: 44px; overflow: hidden; border: 6px solid #1a1a1a; background: #ECE5DD;
  transform-origin: top left; box-shadow: 0 0 0 2px #333, 0 20px 60px rgba(0,0,0,0.5);
  /* La simulación no hereda nada del sitio (interlineado 1.7, peso 300, tamaño variable):
     mismos valores por defecto que tenía el archivo original. */
  line-height: normal; font-weight: 400; font-size: 16px; color: #000; letter-spacing: normal;
}
.capture-area { display: flex; flex-direction: column; height: 100%; }
.phone-statusbar { background: #fff; height: 48px; padding: 14px 24px 0; display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 600; color: #000; flex-shrink: 0; }
.phone-status-icons { display: flex; align-items: center; gap: 6px; }
.wa-ico { width: 22px; height: 22px; fill: #54656F; flex-shrink: 0; }
.chat-header { background: #fff; height: 56px; padding: 0 12px 0 8px; display: flex; align-items: center; gap: 12px; border-bottom: .5px solid #E9EDEF; flex-shrink: 0; }
.avatar-wrap { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 500; color: #fff; }
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.contact-texto { min-width: 0; flex: 1; }
.contact-name { font-size: 16.5px; color: #111B21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-status { font-size: 13px; color: #667781; }
.contact-status.en-linea { color: #00A884; }
.header-icons { display: flex; gap: 16px; margin-left: auto; }
.chat-body { flex: 1; overflow-y: auto; padding: 8px 12px; position: relative; background-color: #ECE5DD; }
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }
.chat-doodle { position: absolute; inset: 0; pointer-events: none; opacity: .35; background-repeat: repeat; background-size: 200px 200px; }
.messages-container { position: relative; z-index: 1; }
.date-sep { text-align: center; margin: 10px 0; }
.date-sep span { background: rgba(225,224,220,.9); color: #54656F; font-size: 12.5px; padding: 5px 12px; border-radius: 7.5px; box-shadow: 0 1px .5px rgba(0,0,0,.13); }
.encryption-msg { text-align: center; margin: 4px 0 12px; padding: 0 40px; }
.encryption-msg span { background: rgba(255,220,100,.35); color: #54656F; font-size: 11.5px; padding: 6px 12px; border-radius: 6px; display: inline-block; line-height: 1.45; }
.msg-wrap { margin: 1.5px 0; display: flex; }
.msg-wrap.sent { justify-content: flex-end; }
.msg-wrap.last-of-group { margin-bottom: 8px; }
.bubble { padding: 6px 7px 8px 9px; position: relative; max-width: 85%; box-shadow: 0 1px .5px rgba(11,20,26,.13); overflow-wrap: anywhere; line-height: 1.35; border-radius: 7.5px; }
.msg-wrap.sent .bubble { background: #D9FDD3; }
.msg-wrap.received .bubble { background: #fff; }
.msg-wrap.sent.first .bubble { border-radius: 7.5px 0 7.5px 7.5px; }
.msg-wrap.sent.first .bubble::after { content: ''; position: absolute; top: 0; right: -8px; border-left: 8px solid #D9FDD3; border-top: 8px solid transparent; }
.msg-wrap.received.first .bubble { border-radius: 0 7.5px 7.5px 7.5px; }
.msg-wrap.received.first .bubble::after { content: ''; position: absolute; top: 0; left: -8px; border-right: 8px solid #fff; border-top: 8px solid transparent; }
.bubble-text { font-size: 14.2px; color: #111B21; white-space: pre-wrap; }
.msg-meta { float: right; margin: 5px 0 -5px 12px; display: flex; align-items: center; gap: 3px; font-size: 11px; color: #667781; position: relative; top: 5px; }
.msg-meta svg { flex-shrink: 0; }
.bubble.bubble-media { padding: 4px; }
.bubble-image { display: block; max-width: 260px; max-height: 340px; border-radius: 5px; }
.bubble.bubble-media .bubble-text { display: block; margin-top: 6px; padding: 0 3px; }
.bubble.bubble-media .msg-meta { position: static; margin: 2px 3px -2px 12px; }
.bubble.bubble-media .msg-meta.meta-overlay { float: none; position: absolute; bottom: 8px; right: 8px; margin: 0; background: rgba(0,0,0,.45); color: #fff; padding: 2px 7px; border-radius: 8px; }
.chat-footer { background: #F0F2F5; padding: 8px 10px; display: flex; align-items: center; gap: 8px; border-top: .5px solid #E9EDEF; flex-shrink: 0; }
.footer-icon { width: 24px; height: 24px; }
.footer-icon.clip { transform: rotate(-45deg); }
.input-mock { flex: 1; background: #fff; border-radius: 8px; padding: 9px 14px; font-size: 15px; color: #8696A0; box-shadow: 0 1px .5px rgba(0,0,0,.13); }
.home-indicator { height: 28px; background: #F0F2F5; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.home-indicator span { width: 134px; height: 5px; background: #000; border-radius: 3px; opacity: .18; }

/* Modo oscuro */
.phone-frame.dark { background: #0B141A; }
.phone-frame.dark .phone-statusbar { background: #000; color: #fff; }
.phone-frame.dark .chat-header { background: #1F2C34; border-bottom-color: #2A3942; }
.phone-frame.dark .contact-name { color: #E9EDEF; }
.phone-frame.dark .contact-status { color: #8696A0; }
.phone-frame.dark .contact-status.en-linea { color: #00A884; }
.phone-frame.dark .wa-ico { fill: #AEBAC1; }
.phone-frame.dark .chat-body { background-color: #0B141A; }
.phone-frame.dark .chat-doodle { opacity: .12; }
.phone-frame.dark .date-sep span { background: rgba(255,255,255,.06); color: #8FA0AB; box-shadow: none; }
.phone-frame.dark .encryption-msg span { background: rgba(255,213,79,.08); color: #8FA0AB; }
.phone-frame.dark .msg-wrap.sent .bubble { background: #005C4B; }
.phone-frame.dark .msg-wrap.received .bubble { background: #202C33; }
.phone-frame.dark .msg-wrap.sent.first .bubble::after { border-left-color: #005C4B; }
.phone-frame.dark .msg-wrap.received.first .bubble::after { border-right-color: #202C33; }
.phone-frame.dark .bubble-text { color: #E9EDEF; }
.phone-frame.dark .msg-meta { color: rgba(233,237,239,.6); }
.phone-frame.dark .chat-footer { background: #1F2C34; border-top-color: #2A3942; }
.phone-frame.dark .input-mock { background: #2A3942; box-shadow: none; }
.phone-frame.dark .home-indicator { background: #1F2C34; }
.phone-frame.dark .home-indicator span { background: #fff; opacity: .3; }

/* Imagen de fondo (vista previa y editor) */
.bg-editor-img { position: absolute; top: 50%; left: 50%; max-width: none; pointer-events: none; user-select: none; }
.bg-editor-img[hidden] { display: none; }
.wa-editor-fondo { grid-template-columns: auto 1fr; align-items: center; }
@media (max-width: 600px) { .wa-editor-fondo { grid-template-columns: 1fr; justify-items: center; } .bg-editor-controls { width: 100%; } }
.bg-editor-phone { line-height: normal; width: 200px; height: 400px; border-radius: 22px; overflow: hidden; border: 5px solid #1a1a1a; box-shadow: 0 0 0 1px #333; display: flex; flex-direction: column; }
.bg-editor-statusbar { height: 20px; background: #fff; }
.bg-editor-header { height: 28px; background: #fff; border-bottom: 1px solid #E9EDEF; }
.bg-editor-canvas { flex: 1; position: relative; overflow: hidden; background: #ECE5DD; cursor: grab; touch-action: none; }
.bg-editor-canvas.arrastrando { cursor: grabbing; }
.bg-editor-footer { height: 26px; background: #F0F2F5; }
.bg-editor-controls { display: grid; gap: .9rem; }

/* Estados temporales durante la exportación por capas */
.cap-hide { opacity: 0 !important; }
.cap-bg-transparent { background: transparent !important; background-image: none !important; border-color: transparent !important; box-shadow: none !important; }
.cap-content-hide .bubble-text, .cap-content-hide .msg-meta, .cap-content-hide .bubble-image { opacity: 0 !important; }
.cap-bubble-hide .bubble { background: transparent !important; box-shadow: none !important; }
.cap-bubble-hide .bubble::after { content: none !important; }
