/* /chatbot-whatsapp/: cómo ayuda a vender, sectores, rutas, integraciones e
   implementación. Se enlaza justo antes de la primera sección que lo usa, no en
   el <head>, para que el primer pintado no espere estos estilos.
   Colores de marca: --mk-primario #191d66 y --mk-secundario #35aad5 (site.css). */

/* ---------- comparación con un chatbot genérico ---------- */
.wa-cmp { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 1.2rem; border: 1px solid #e3e6f2; border-radius: 20px; overflow: hidden; font-size: .9rem; background: #fff; }
.wa-cmp th, .wa-cmp td { text-align: left; vertical-align: top; padding: .85rem 1.1rem; border-bottom: 1px solid #eceef6; line-height: 1.5; }
.wa-cmp tbody tr:last-child th, .wa-cmp tbody tr:last-child td { border-bottom: 0; }
.wa-cmp thead th { background: var(--mk-primario); color: #fff; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; border-bottom: 0; }
.wa-cmp thead th:last-child { background: linear-gradient(135deg, var(--mk-primario), #23489a); }
.wa-cmp tbody th { width: 22%; font-weight: 700; color: var(--mk-primario); background: #fafbfe; }
.wa-cmp td { color: var(--muted); }
.wa-cmp td + td { color: var(--mk-texto); font-weight: 500; background: color-mix(in srgb, var(--mk-secundario) 6%, #fff); }
.wa-cmp td + td::before { content: "✓ "; color: var(--mk-secundario); font-weight: 800; }
.wa-cmp-k { display: none; }
@media (max-width: 680px) {
  .wa-cmp, .wa-cmp tbody, .wa-cmp tr, .wa-cmp th, .wa-cmp td { display: block; width: auto; }
  .wa-cmp thead { display: none; }
  .wa-cmp tbody tr { border-bottom: 1px solid #e3e6f2; }
  .wa-cmp tbody tr:last-child { border-bottom: 0; }
  .wa-cmp tbody th { width: auto; border-bottom: 0; padding-bottom: .3rem; }
  .wa-cmp td { border-bottom: 0; padding-top: .45rem; }
  .wa-cmp td + td::before { content: none; }
  .wa-cmp-k { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .15rem; }
}

/* ---------- sectores: pestañas (las arma chatbot.js; sin JS son enlaces) ---------- */
.wa-sec { background: var(--light-band); border-radius: 32px; margin: 0 clamp(0px, 2vw, 1.2rem); scroll-margin-top: 64px; }
.wa-sec .lead { color: var(--muted); max-width: 64ch; }
.wa-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.6rem 0 1.2rem; }
.wa-tabs a { display: inline-flex; align-items: center; gap: .5rem; padding: .62rem 1.15rem; border-radius: 999px; border: 1px solid #d9ddef; background: #fff; color: var(--mk-primario); font-weight: 700; font-size: .92rem; text-decoration: none; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.wa-tabs a:hover { border-color: var(--mk-secundario); }
.wa-tabs a[aria-selected="true"] { background: var(--mk-primario); border-color: var(--mk-primario); color: #fff; }
.wa-tabs a:focus-visible { outline: 3px solid var(--mk-secundario); outline-offset: 2px; }
.wa-tabs svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.wa-panel { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); gap: clamp(1.4rem, 3.5vw, 2.6rem); align-items: start; background: #fff; border: 1px solid #e3e6f2; border-radius: 24px; padding: clamp(1.2rem, 3.4vw, 2.2rem); scroll-margin-top: 90px; }
.wa-panel + .wa-panel { margin-top: 1.2rem; }
.wa-panel[hidden] { display: none; }
.wa-panel:focus-visible { outline: 3px solid var(--mk-secundario); outline-offset: 3px; }
.wa-panel h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); color: var(--mk-primario); margin: 0 0 .6rem; }
.wa-panel .wa-lead { color: var(--muted); margin: 0 0 1.2rem; }
.wa-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.wa-cols > div { border-radius: 16px; padding: 1rem 1.1rem; }
.wa-cols h4, .wa-cols .h4 { font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .65rem; }
.wa-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.wa-cols li { position: relative; padding-left: 1.35rem; font-size: .9rem; line-height: 1.5; }
.wa-loss { background: #fbf6f2; }
.wa-loss h4, .wa-loss .h4 { color: #a8461f; }
.wa-loss li { color: var(--muted); }
.wa-loss li::before { content: ""; position: absolute; left: .15rem; top: .7em; width: .62rem; height: 2px; border-radius: 2px; background: #d9825b; }
.wa-gain { background: color-mix(in srgb, var(--mk-secundario) 8%, #fff); }
.wa-gain h4, .wa-gain .h4 { color: var(--mk-secundario-texto); }
.wa-gain li { color: var(--mk-texto); }
.wa-gain li::before { content: "✓"; position: absolute; left: 0; color: var(--mk-secundario); font-weight: 800; }
.wa-rule { margin: 1rem 0 0; padding: .8rem 1rem; border-left: 3px solid var(--mk-secundario); background: var(--light-band); border-radius: 0 12px 12px 0; font-size: .87rem; line-height: 1.55; }
.wa-rule b { color: var(--mk-primario); }
.wa-team { margin: 1rem 0 .4rem; font-size: .88rem; color: var(--muted); }
.wa-team b { color: var(--mk-texto); }
.wa-panel .link { font-weight: 700; font-size: .9rem; color: var(--mk-secundario-texto); text-decoration: none; }
.wa-panel .link:hover { text-decoration: underline; }

/* Conversación de ejemplo, con los colores del panel del producto */
.wa-phone { margin: 0; position: sticky; top: 96px; }
.wa-phone-box { border-radius: 26px; overflow: hidden; background: #0d1045; border: 1px solid rgba(25,29,102,.25); box-shadow: 0 30px 60px -24px rgba(17,20,60,.55); }
.wa-phone-top { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; background: #161a63; color: #fff; }
.wa-av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: #0a0c36; background: linear-gradient(135deg, #5fd0f5, #8ea2ff); }
.wa-phone-top b { display: block; font-size: .92rem; line-height: 1.25; }
.wa-phone-top small { display: block; font-size: .74rem; color: #8fdcf6; }
.wa-msgs { display: flex; flex-direction: column; gap: .55rem; padding: 1.1rem 1rem 1.3rem; background: radial-gradient(320px 220px at 90% 8%, rgba(53,170,213,.2), transparent 70%), #0d1045; }
.wa-msgs p { margin: 0; max-width: 86%; font-size: .84rem; line-height: 1.45; padding: .55rem .8rem; }
.wa-msgs .in { align-self: flex-start; background: #fff; color: #12142e; border-radius: 14px 14px 14px 4px; }
.wa-msgs .out { align-self: flex-end; background: linear-gradient(135deg, #1f6fb0, #4652d6); color: #fff; border-radius: 14px 14px 4px 14px; }
.wa-phone figcaption { margin-top: .6rem; font-size: .76rem; color: var(--muted); text-align: center; }

.wa-otro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.6rem; margin-top: 1.2rem; padding: 1.3rem 1.5rem; border-radius: 22px; background: var(--mk-primario); color: #fff; scroll-margin-top: 90px; }
.wa-otro p { margin: 0; max-width: 72ch; font-size: .92rem; color: #d7dbf7; }
.wa-otro b { display: block; margin-bottom: .2rem; font-size: 1.04rem; color: #fff; }

/* ---------- cómo funciona: rutas por tipo de contacto y lo que entiende ---------- */
.wa-sub { font-size: clamp(1.1rem, 2.2vw, 1.35rem); margin: 2.4rem 0 .4rem; }
.wa-sub + p { color: var(--muted); max-width: 62ch; }
.wa-routes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-top: 1.2rem; }
.wa-route { display: flex; flex-direction: column; gap: .4rem; padding: 1.2rem 1.2rem 1.1rem; border: 1px solid #e3e6f2; border-radius: 18px; background: #fff; }
.wa-route h4, .wa-route .h4 { margin: 0; font-size: 1rem; color: var(--mk-primario); }
.wa-route p { margin: 0; font-size: .86rem; line-height: 1.5; color: var(--muted); }
.wa-route p.r { margin-top: auto; padding-top: .7rem; border-top: 1px dashed #dfe3f1; color: var(--mk-texto); }
.wa-route p.r::before { content: "→ "; color: var(--mk-secundario); font-weight: 800; }
.wa-recon { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-top: 1.2rem; }
.wa-recon > div { display: grid; gap: .25rem; padding: 1rem 1.1rem; border-radius: 16px; background: var(--light-band); }
.wa-recon b { font-size: .92rem; color: var(--mk-primario); }
.wa-recon span { font-size: .86rem; line-height: 1.5; color: var(--muted); }

/* ---------- ruta para nuevas integraciones ---------- */
.wa-phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.wa-phase { display: flex; flex-direction: column; gap: .45rem; padding: 1.1rem 1.2rem; border: 1px solid #e3e6f2; border-radius: 18px; background: #fff; }
.wa-phase .k { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mk-secundario-texto); }
.wa-phase h4, .wa-phase .h4 { margin: 0; font-size: 1rem; color: var(--mk-primario); }
.wa-phase p { margin: 0; font-size: .86rem; line-height: 1.5; color: var(--muted); }
.wa-phase p.dec { margin-top: auto; align-self: flex-start; padding: .3rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--mk-primario); background: color-mix(in srgb, var(--mk-secundario) 12%, #fff); }
.wa-phase p.dec::before { content: "◆ "; color: var(--mk-secundario); }

@media (max-width: 899px) {
  .wa-panel { grid-template-columns: 1fr; }
  .wa-phone { position: static; max-width: 460px; }
}
@media (max-width: 760px) { .wa-phases { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .wa-cols { grid-template-columns: 1fr; }
  .wa-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .wa-tabs a { justify-content: center; padding: .6rem .7rem; font-size: .86rem; }
}
@media (prefers-reduced-motion: reduce) { .wa-tabs a { transition: none; } }
