/* =========================================================
   SM Digital · Nuevos servicios: Automatizaciones, IA y SEO/GEO
   Usa las variables de styles.css (--ink, --blue, --line…)
   Cargar DESPUÉS de anim.css
   ========================================================= */

/* ---------- Automatizaciones (flujo) ---------- */
.flow { padding: 10px 12px; gap: 0; }
.fl-n { position: relative; display: flex; align-items: center; gap: 9px; padding: 4px 8px; border-radius: 9px; background: var(--soft); border: 1px solid transparent; transition: background .3s, border-color .3s; }
.fl-n + .fl-n { margin-top: 7px; }
.fl-n + .fl-n::before { content: ""; position: absolute; left: 18px; top: -8px; width: 1.5px; height: 7px; background: #d8d8d3; transition: background .3s; }
.fl-n.ld::before, .fl-n.dn::before { background: var(--blue); }
.fl-ic { width: 20px; height: 20px; border-radius: 7px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; flex: 0 0 auto; color: var(--ink); }
.fl-ic svg { width: 11px; height: 11px; }
.fl-n:first-child .fl-ic { background: var(--blue); border-color: var(--blue); color: #fff; }
.fl-t { flex: 1; min-width: 0; line-height: 1.2; }
.fl-t b { display: block; font-weight: 600; font-size: .66rem; }
.fl-t small { color: var(--mute); font-size: .56rem; }
.fl-s { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #d8d8d3; display: grid; place-items: center; flex: 0 0 auto; font-size: .52rem; font-weight: 700; font-style: normal; color: transparent; transition: background .3s, border-color .3s, color .3s; }
.fl-n.dn { background: #fff; border-color: var(--line); }
.fl-n.dn .fl-s { background: var(--ok); border-color: var(--ok); color: #fff; }
.fl-n.ld .fl-s { border-color: #d8d8d3; border-top-color: var(--blue); animation: smSpin .7s linear infinite; }

/* ---------- Inteligencia artificial (chat) ---------- */
.ia-h { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fbfbfa; }
.ia-av { width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: .55rem; flex: 0 0 auto; }
.ia-h b { display: block; font-weight: 600; font-size: .66rem; line-height: 1.2; }
.ia-h small { display: flex; align-items: center; gap: 4px; color: var(--mute); font-size: .56rem; }
.ia-h small::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.ia-b { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.ia-m { max-width: 84%; padding: 6px 9px; border-radius: 11px 11px 11px 3px; background: var(--soft); font-size: .64rem; line-height: 1.35; color: var(--ink-2); align-self: flex-start; }
.ia-m--me { align-self: flex-end; background: var(--ink); color: #fff; border-radius: 11px 11px 3px 11px; }
.ia-m .dots b { width: 5px; height: 5px; }

/* ---------- SEO y GEO (buscador + respuesta IA) ---------- */
.se-q { display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .68rem; box-shadow: 0 6px 16px -12px rgba(0,0,0,.3); }
.se-q svg { width: 12px; height: 12px; color: var(--mute); flex: 0 0 auto; }
.se-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.se-t::after { content: ""; display: inline-block; width: 1px; height: .95em; background: var(--ink); vertical-align: -2px; margin-left: 1px; opacity: 0; }
.se-q.typing .se-t::after { opacity: 1; animation: smBlink 1s steps(1) infinite; }
.se-ai { padding: 9px 10px; border-radius: 10px; background: var(--blue-soft); display: grid; gap: 5px; }
.se-ai-h { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: .6rem; color: var(--blue); }
.se-ai-h svg { width: 11px; height: 11px; }
.se-ai .ln { height: 5px; background: #d9ddff; }
.se-src { justify-self: start; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: #fff; border: 1px solid #d9ddff; font-size: .56rem; font-weight: 600; color: var(--ink); transition: transform .2s, box-shadow .3s; }
.se-src::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.se-src.pr { transform: scale(.94); box-shadow: 0 0 0 4px rgba(0,32,255,.14); }
.se-r { display: grid; gap: 2px; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.se-r small { font-size: .54rem; color: var(--mute); }
.se-r b { font-size: .7rem; font-weight: 500; letter-spacing: -.01em; color: var(--blue); line-height: 1.2; }
.se-r b em { font-size: 1.05em; }
.se-r2 { display: grid; gap: 5px; padding: 2px 9px; }
.se-r2 .ln { height: 5px; }

/* ---------- Redes sociales (calendario) ---------- */
.rs { gap: 6px; padding: 12px; }
.rs-d, .rs-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.rs-d span { text-align: center; font-size: .54rem; font-weight: 600; color: var(--mute); }
.rs-g div { position: relative; height: 44px; border-radius: 7px; background: var(--soft); padding: 4px; display: flex; flex-direction: column; justify-content: space-between; }
.rs-g div.today { box-shadow: inset 0 0 0 1.5px var(--blue); background: #fff; }
.rs-g small { font-size: .5rem; color: var(--mute); line-height: 1; }
.rs-p { display: block; font-size: .5rem; font-weight: 600; text-align: center; padding: 3px 0; border-radius: 4px; background: var(--ink); color: #fff; line-height: 1.1; }
.rs-p--b { background: var(--blue); }
.rs-p--s { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.a .rs-p.st { translate: 0 -6px; scale: .8; transition: opacity .35s, translate .45s cubic-bezier(.3,1.6,.5,1), scale .45s cubic-bezier(.3,1.6,.5,1); }
.a .rs-p.st.sh { translate: 0; scale: 1; }
.rs-p.pr { box-shadow: 0 0 0 3px rgba(0,32,255,.18); }

/* ---------- Tarjeta ancha (7.º servicio) ---------- */
.svc a.svc--wide { grid-column: 1 / -1; }
@media (min-width: 1001px) { .svc a.svc--wide.svc--crm { grid-column: span 2; } }
@media (min-width: 641px) {
  .svc a.svc--wide { flex-direction: row; align-items: center; gap: 32px; padding: 14px 32px 14px 14px; }
  .svc--wide .svc-vis { flex: 0 0 56%; height: 270px; }
  .svc--wide .svc-txt { flex: 1; }
  .svc--wide .svc-txt h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
}

/* ---------- Tarjeta CRM en la home (data-anim="crm") ---------- */
.kb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px; }
.kb > div { border-radius: 8px; background: var(--soft); padding: 6px; display: grid; gap: 5px; align-content: start; min-height: 132px; }
.kb > div > small { font-size: .52rem; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; }
.kb .kb-c { font-size: .58rem; padding: 5px 6px; transition: border-color .3s, box-shadow .3s; }
.a[data-anim="crm"] .toast { opacity: 0; translate: 0 -10px; transition: opacity .4s, translate .5s cubic-bezier(.2,.7,.2,1); }
.a[data-anim="crm"] .toast.sh { opacity: 1; translate: 0; }

/* Colocación en la home: 8 servicios → 3 + 3 + (SEO + CRM ancho) */
@media (min-width: 1001px) {
  .svc a.svc--crm { grid-column: span 2; }
}
@media (min-width: 641px) and (max-width: 1000px) {
  .svc a.svc--crm, .svc a.svc--seo { grid-column: 1 / -1; }
}

.kb-c { padding: 5px 6px; border-radius: 7px; background: #fff; border: 1px solid var(--line); font-size: .58rem; line-height: 1.25; box-shadow: 0 4px 10px -8px rgba(0,0,0,.25); transition: border-color .3s, box-shadow .3s; }
.kb-c b { display: block; font-weight: 600; }
.kb-c span { color: var(--mute); }
.kb-c.mv { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,32,255,.12); }
.kb-c.won { border-color: var(--ok); }

/* ---------- Estados de animación propios ---------- */
.a[data-anim="rrss"] .toast, .a[data-anim="auto"] .toast, .a[data-anim="ia"] .toast, .a[data-anim="seo"] .toast { opacity: 0; translate: 0 -10px; transition: opacity .4s, translate .5s cubic-bezier(.2,.7,.2,1); }
.a[data-anim="rrss"] .toast.sh, .a[data-anim="auto"] .toast.sh, .a[data-anim="ia"] .toast.sh, .a[data-anim="seo"] .toast.sh { opacity: 1; translate: 0; }

@keyframes smSpin { to { transform: rotate(360deg); } }
@keyframes smBlink { 50% { opacity: 0; } }

/* ---------- Menú de escritorio: desplegable "Más servicios" (se añade junto a tus enlaces) ---------- */
.hd-dd { position: relative; }
.hd-dd > button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: .86rem; color: var(--h-ink2); cursor: pointer; transition: background .2s; }
.hd-dd > button svg { width: 12px; height: 12px; transition: transform .3s var(--h-ease); }
.hd-dd:hover > button, .hd-dd:focus-within > button, .hd-dd.open > button { background: var(--h-g1); color: var(--h-ink); }
.hd-dd:hover > button svg, .hd-dd:focus-within > button svg, .hd-dd.open > button svg { transform: rotate(180deg); }
.hd-dd-m { position: absolute; top: calc(100% + 10px); left: 50%; width: 330px; display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px; background: #fff; border-radius: 18px; box-shadow: 0 24px 50px -20px rgba(0,0,0,.28), 0 0 0 1px rgba(0,0,0,.05); opacity: 0; visibility: hidden; transform: translate(-50%, -6px); transition: opacity .25s, transform .35s var(--h-ease), visibility 0s linear .35s; }
.hd-dd-m::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.hd-dd:hover .hd-dd-m, .hd-dd:focus-within .hd-dd-m, .hd-dd.open .hd-dd-m { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .25s, transform .35s var(--h-ease), visibility 0s; }
.hd-nav .hd-dd-m a { display: flex; flex-direction: column; gap: 2px; padding: 11px 12px; border-radius: 12px; }
.hd-dd-m a b { font-weight: 500; font-size: .88rem; color: var(--h-ink); letter-spacing: -.01em; }
.hd-dd-m a small { font-size: .74rem; color: var(--h-mute); line-height: 1.35; }
.hd-dd-m a b i { font-style: normal; font-size: .6rem; font-weight: 600; color: var(--h-blue); background: #eef0ff; padding: 2px 6px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }

@media (max-width: 640px) {
  .fl-t small { display: none; }
  .fl-n { padding: 6px 8px; }
  .ia-m:nth-child(1) { display: none; }
  .se-r2 { display: none; }
  .rs-g div { height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .fl-n.ld .fl-s, .se-q.typing .se-t::after { animation: none; }
}


/* ---------- Menú "Servicios" (8 servicios en 2 grupos) ---------- */
.hd-mg .hd-dd-m { width: min(620px, 92vw); grid-template-columns: 1fr 1fr; gap: 4px 8px; padding: 10px; }
.hd-mg-c { display: grid; gap: 2px; align-content: start; }
.hd-mg-c > span { padding: 8px 12px 4px; font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--h-mute); }
.hd-mg-all { grid-column: 1 / -1; justify-content: center; text-align: center; font-size: .82rem !important; font-weight: 500; color: var(--h-blue) !important; background: #f4f5ff; border-radius: 12px !important; padding: 10px !important; }
.hd-nav .hd-dd-m a:hover { background: var(--h-g1); }
.hd-nav .hd-dd-m a[aria-current] b { color: var(--h-blue); }

/* ---------- Banda SM Digital Partners (home) ---------- */
.pt-band { border-radius: var(--r); background: var(--blue); color: #fff; padding: clamp(28px, 4vw, 56px); display: grid; grid-template-columns: auto 1fr auto; gap: clamp(20px, 4vw, 48px); align-items: center; }
.pt-band .pt-n { font-size: clamp(4rem, 11vw, 8rem); font-weight: 500; letter-spacing: -.06em; line-height: .9; }
.pt-band h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.pt-band p { margin: 10px 0 0; color: rgba(255,255,255,.82); max-width: 52ch; }
.pt-band small { display: inline-block; margin-bottom: 10px; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.7); }
@media (max-width: 1000px) { .pt-band { grid-template-columns: 1fr; } }
