/* Lux Automatizaciones — [lux_whatsapp_showcase] (v2: esmeralda + Space Grotesk/Inter)
   Namespaced bajo .lux-whatsapp-showcase para no chocar con el tema.
   Colores/fuentes iguales a shared/tokens.css v2. El cian queda reservado a LUXI. */

.lux-whatsapp-showcase * { box-sizing: border-box; }

.lux-whatsapp-showcase {
  --navy: #0B0F17; --surface: #0D111A; --surface2: #121826;
  --emerald: #10B981; --emerald-light: #34D399; --emerald-bright: #6EE7B7;
  --on-accent: #04140F;
  --luxi-cyan: #22D3EE; --luxi-cyan-bright: #7EF1FF;
  --text: #F5F7FA; --muted: #8B98AC; --muted-2: #7C8AA0;
  --border: rgba(148, 163, 184, 0.12); --border-strong: rgba(148, 163, 184, 0.2);
  --grad-main: linear-gradient(135deg, #34D399 0%, #10B981 100%);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse 900px 500px at 22% 0%, rgba(16,185,129,0.09), transparent 60%), var(--navy);
  color: var(--text);
  font-family: var(--font-body);
  padding: clamp(3.5rem, 8vw, 7rem) clamp(1.25rem, 5vw, 3rem);
  isolation: isolate;
}

.lux-whatsapp-showcase .showcase-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 60% 40%, black 40%, transparent 78%);
  z-index: 0;
}

.lux-whatsapp-showcase .showcase-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}

.lux-whatsapp-showcase .showcase-copy .eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--emerald-light);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lux-whatsapp-showcase .showcase-copy .eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--emerald-light);
}

.lux-whatsapp-showcase .showcase-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0.9rem 0 1.1rem;
  color: var(--text);
}

.lux-whatsapp-showcase .showcase-copy p {
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 42ch;
}

.lux-whatsapp-showcase .stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 560px;
}

.lux-whatsapp-showcase .luxi {
  position: absolute;
  width: clamp(160px, 22vw, 230px);
  left: 6%;
  top: 6%;
  filter: drop-shadow(0 0 32px rgba(34, 211, 238, 0.14));
}

@media (prefers-reduced-motion: no-preference) {
  .lux-whatsapp-showcase .luxi { animation: lux-luxi-float 4.5s ease-in-out infinite; }
  .lux-whatsapp-showcase .luxi-eye-glow,
  .lux-whatsapp-showcase .luxi-antenna-glow { animation: lux-luxi-pulse 3.2s ease-in-out infinite; transform-origin: center; }
}

@keyframes lux-luxi-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes lux-luxi-pulse { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }

.lux-whatsapp-showcase .phone {
  position: relative;
  z-index: 1;
  width: clamp(280px, 30vw, 340px);
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: 34px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(16,185,129,0.05) inset;
  padding: 10px 10px 16px;
  margin-left: clamp(40px, 8vw, 90px);
}

.lux-whatsapp-showcase .phone-notch { width: 46px; height: 4px; border-radius: 2px; background: var(--surface); margin: 4px auto 10px; }

.lux-whatsapp-showcase .phone-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 14px;
  border-bottom: 1px solid var(--border);
}

.lux-whatsapp-showcase .phone-header-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: linear-gradient(150deg, #1c2434, #0c111c);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.lux-whatsapp-showcase .phone-header-icon .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--emerald-light);
  box-shadow: 0 0 10px 3px rgba(16, 185, 129, 0.75);
}

@media (prefers-reduced-motion: no-preference) {
  .lux-whatsapp-showcase .phone-header-icon .dot { animation: lux-header-glow 3s ease-in-out infinite; }
}
@keyframes lux-header-glow { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }

.lux-whatsapp-showcase .phone-header-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.lux-whatsapp-showcase .phone-header-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lux-whatsapp-showcase .phone-header-status {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--emerald-bright);
}

.lux-whatsapp-showcase .phone-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 10px 6px; min-height: 380px; }

.lux-whatsapp-showcase .msg { max-width: 84%; padding: 9px 13px; font-size: 0.86rem; line-height: 1.5; font-weight: 400; }
.lux-whatsapp-showcase .msg p { margin: 0; }
.lux-whatsapp-showcase .msg .mono { font-family: var(--font-body); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--emerald-light); font-size: 0.92em; }

.lux-whatsapp-showcase .msg-client {
  align-self: flex-end;
  background: var(--grad-main);
  color: var(--on-accent);
  font-weight: 500;
  border-radius: 14px 14px 3px 14px;
}
.lux-whatsapp-showcase .msg-client .mono { color: #04140F; }

.lux-whatsapp-showcase .msg-agent {
  align-self: flex-start;
  background: #1A2333;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 14px 14px 14px 3px;
}

.lux-whatsapp-showcase .msg-agent.card { max-width: 92%; position: relative; padding: 16px 16px 14px; overflow: hidden; }
.lux-whatsapp-showcase .msg-agent.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--grad-main);
}

.lux-whatsapp-showcase .card-row.card-head {
  display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display);
  font-size: 0.82rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text);
  margin-bottom: 10px;
}

.lux-whatsapp-showcase .card-line { font-size: 0.82rem; color: var(--muted); font-weight: 400; margin-bottom: 10px; }

.lux-whatsapp-showcase .card-total {
  display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px;
  border-top: 1px dashed var(--border); font-size: 0.82rem; color: var(--muted);
}
.lux-whatsapp-showcase .card-total .mono {
  font-family: var(--font-body); font-variant-numeric: tabular-nums; color: var(--emerald-light); font-size: 1rem; font-weight: 700;
}

.lux-whatsapp-showcase .card-confirm { margin-top: 10px; font-size: 0.8rem; color: var(--muted); font-style: italic; }

.lux-whatsapp-showcase .tag {
  display: inline-block; font-family: var(--font-body); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 10px; border-radius: 100px; background: rgba(16, 185, 129, 0.1); color: var(--emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.lux-whatsapp-showcase .tag-teal { background: rgba(16, 185, 129, 0.1); color: var(--emerald-bright); border-color: rgba(16, 185, 129, 0.3); }

.lux-whatsapp-showcase .attachment {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 0.78rem;
}
.lux-whatsapp-showcase .attachment-icon { font-size: 1rem; }
.lux-whatsapp-showcase .attachment-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-family: var(--font-body); font-size: 0.72rem;
}

.lux-whatsapp-showcase .typing {
  display: none; align-self: flex-start; align-items: center; gap: 4px; padding: 10px 14px;
  background: #1A2333; border: 1px solid var(--border); border-radius: 14px 14px 14px 3px;
}
.lux-whatsapp-showcase .typing.is-active { display: flex; }

/* Durante la secuencia animada reservamos siempre el espacio del bubble de "escribiendo"
   y solo alternamos visibilidad/opacidad — evita que el chat crezca y se achique (jump)
   cada vez que el indicador aparece o desaparece. */
.lux-whatsapp-showcase.is-animating .typing {
  display: flex; visibility: hidden; opacity: 0; transition: opacity 0.25s ease;
}
.lux-whatsapp-showcase.is-animating .typing.is-active { visibility: visible; opacity: 1; }
.lux-whatsapp-showcase .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: 0.5; }

@media (prefers-reduced-motion: no-preference) {
  .lux-whatsapp-showcase .typing.is-active .dot { animation: lux-dot-bounce 1.1s ease-in-out infinite; }
  .lux-whatsapp-showcase .typing.is-active .dot:nth-child(2) { animation-delay: 0.15s; }
  .lux-whatsapp-showcase .typing.is-active .dot:nth-child(3) { animation-delay: 0.3s; }
}
@keyframes lux-dot-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-4px); opacity: 1; } }

.lux-whatsapp-showcase.is-animating .msg[data-step] {
  opacity: 0; transform: translateY(10px) scale(0.98); transition: opacity 0.45s ease, transform 0.45s ease;
}
.lux-whatsapp-showcase.is-animating .msg[data-step].is-shown { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .lux-whatsapp-showcase .showcase-inner { grid-template-columns: 1fr; text-align: center; }
  .lux-whatsapp-showcase .showcase-copy p { margin: 0 auto; }
  .lux-whatsapp-showcase .showcase-copy .eyebrow { justify-content: center; }
  .lux-whatsapp-showcase .stage { min-height: auto; padding-top: 2rem; }
  .lux-whatsapp-showcase .luxi { position: static; width: 120px; margin: 0 auto -50px; }
  .lux-whatsapp-showcase .phone { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .lux-whatsapp-showcase .luxi,
  .lux-whatsapp-showcase .luxi-eye-glow,
  .lux-whatsapp-showcase .luxi-antenna-glow,
  .lux-whatsapp-showcase .phone-header-icon .dot { animation: none !important; }
}
