/* Embi stays with the visitor while the section tips change on scroll.
   Barra inferior de ancho completo: al extremo izquierdo vive el bot
   de Embi y al extremo derecho el botón del Libro de Reclamaciones. */
.floating-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 55;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding-inline: 22px;
  /* La barra no intercepta clics: solo sus hijos son interactivos. */
  pointer-events: none;
}
.floating-dock > * { pointer-events: auto; }
.embi-assistant {
  --embi-blue: #1D4ED8;
  position: relative;
  font-family: 'Manrope', system-ui, sans-serif;
  color: #0F172A;
  transition: opacity .25s, visibility .25s;
}
.embi-assistant[hidden], .embi-panel[hidden], .embi-teaser[hidden] { display: none !important; }
.js body:not(.site-ready) .embi-assistant, .js body:not(.site-ready) .floating-dock,
body.logo-intro-active .embi-assistant, body.logo-intro-active .floating-dock,
body.no-scroll .embi-assistant, body.no-scroll .floating-dock,
body.modal-open .embi-assistant, body.modal-open .floating-dock { opacity: 0; visibility: hidden; pointer-events: none; }
.embi-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.embi-assistant button, .embi-assistant input { font: inherit; }
.embi-launcher {
  display: flex; align-items: center; gap: 7px;
  min-height: 50px; padding: 4px 14px 4px 5px;
  border: 1px solid #DBEAFE; border-radius: 18px;
  background: #FFF;
  color: #1D4ED8; text-align: left;
  box-shadow: 0 4px 18px rgba(15,23,42,.12);
  transition: transform .25s, box-shadow .25s;
}
.embi-launcher:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(29,78,216,.16); }
.embi-launcher-copy { display: grid; gap: 3px; }
.embi-launcher-copy strong { font-family: 'Sora', sans-serif; font-size: 13px; letter-spacing: -.04em; }
.embi-launcher-copy small { display: none; }
.embi-mascot { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; }
.embi-mascot > svg { width: 42px; height: 42px; overflow: visible; animation: embiFloat 4s ease-in-out infinite; }
.embi-whatsapp-badge {
  position: absolute; right: -1px; bottom: -1px; display: grid; place-items: center;
  width: 18px; height: 18px; border: 2px solid white; border-radius: 50%; background: #15803D; color: white; font-size: 9px;
}
.embi-eye { transform-box: fill-box; transform-origin: center; animation: embiBlink 5.6s infinite; }
.embi-antenna { animation: embiSignal 3s ease-in-out infinite; }
@keyframes embiFloat { 0%, 100% { transform: translateY(1px) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
@keyframes embiBlink { 0%, 42%, 46%, 100% { transform: scaleY(1); } 44% { transform: scaleY(.12); } }
@keyframes embiSignal { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.embi-teaser {
  display: none; position: absolute; left: 0; bottom: 62px; width: 220px;
  padding: 13px 15px; border: 1px solid #E2E8F0; border-radius: 14px;
  background: #FFF; box-shadow: 0 5px 20px rgba(15,23,42,.08);
}
@media (hover: hover) and (pointer: fine) {
  .embi-assistant:hover .embi-teaser, .embi-assistant:focus-within .embi-teaser { display: block; }
}
.embi-teaser-close { position: absolute; right: 7px; top: 5px; width: 28px; height: 28px; border: 0; background: transparent; color: #64748B; font-size: 19px !important; }
.embi-eyebrow { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: #1D4ED8; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.embi-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #EAB308; box-shadow: 0 0 0 3px #FEF9C3; }
.embi-teaser p:last-of-type { margin: 0; font-size: 11px; line-height: 1.6; color: #475569; }
.embi-teaser-open { margin-top: 11px; padding: 0; border: 0; background: none; color: #1D4ED8; font-size: 11px !important; font-weight: 800 !important; }
.embi-teaser-open span { margin-left: 5px; }
.embi-panel {
  position: absolute; left: 0; bottom: 0; display: flex; flex-direction: column;
  width: 300px; height: 400px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 104px);
  overflow: hidden; border: 1px solid #E2E8F0; border-radius: 16px;
  background: #FFF; box-shadow: 0 8px 32px rgba(15,23,42,.14);
  animation: embiAppear .25s ease-out;
}
@keyframes embiAppear { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.embi-header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; flex-shrink: 0; border-bottom: 1px solid #F1F5F9; background: #FFF; color: #0F172A; }
.embi-header-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #EFF6FF; }
.embi-header-avatar svg { width: 29px; height: 29px; }
.embi-header h2 { margin: 0; font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; letter-spacing: -.04em; color: #0F172A; }
.embi-header p { margin: 2px 0 0; font-size: 9px; color: #64748B; }
.embi-minimize { display: grid; place-items: center; width: 32px; height: 32px; margin-left: auto; border: 0; border-radius: 9px; background: #F8FAFC; color: #64748B; font-size: 20px !important; }
.embi-context { display: flex; align-items: center; gap: 6px; padding: 7px 12px; background: #FFF; font-size: 9px; color: #64748B; }
.embi-context i { color: #1D4ED8; }
.embi-context strong { color: #1D4ED8; font-weight: 800; }
.embi-messages { display: flex; flex: 1 1 0; min-height: 0; flex-direction: column; gap: 9px; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px; scrollbar-width: thin; }
.embi-message { align-self: flex-start; max-width: 96%; padding: 9px 11px; border: 0; border-radius: 3px 12px 12px; background: #F4F6F9; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; animation: embiAppear .2s ease-out; }
.embi-message p { margin: 0; white-space: pre-line; }
.embi-message-label { display: none; }
.embi-message.is-user { align-self: flex-end; border-color: #1D4ED8; border-radius: 16px 4px 16px 16px; background: #1D4ED8; color: white; }
.embi-message.is-user .embi-message-label { color: #DBEAFE; }
.embi-message a { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; color: #1D4ED8; font-weight: 700; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.embi-suggestions { display: flex; flex-wrap: nowrap; flex-shrink: 0; gap: 5px; overflow-x: auto; scrollbar-width: none; padding: 5px 12px 8px; }
.embi-suggestions::-webkit-scrollbar { display: none; }
.embi-suggestions button { flex-shrink: 0; padding: 6px 8px; border: 1px solid #E2E8F0; border-radius: 8px; background: #FFF; color: #475569; font-size: 9px; font-weight: 600; text-align: left; transition: background .2s, border-color .2s; }
.embi-suggestions button:hover { background: #DBEAFE; border-color: #60A5FA; }
.embi-form { display: flex; flex-shrink: 0; gap: 6px; margin: 0; padding: 8px 12px; border-top: 1px solid #F1F5F9; background: white; }
.embi-form input { min-width: 0; width: 100%; padding: 8px 9px; border: 1px solid #E2E8F0; border-radius: 9px; background: #FFF; color: #0F172A; font-size: 11px; }
.embi-form input::placeholder { color: #64748B; }
.embi-form button { display: grid; place-items: center; width: 34px; flex-shrink: 0; border: 0; border-radius: 9px; background: #1D4ED8; color: white; }
.embi-footer { flex-shrink: 0; padding: 0 12px 9px; background: white; }
.embi-whatsapp { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px; border-radius: 9px; background: #F0FDF4; color: #166534; font-size: 10px; font-weight: 700; text-decoration: none; transition: background .2s; }
.embi-whatsapp:hover { background: #DCFCE7; color: #166534; }
.embi-whatsapp i { font-size: 14px; }
.embi-footer p { display: none; }
.embi-fallback { position: fixed; right: 24px; bottom: 24px; z-index: 55; border-radius: 16px; background: #15803D; color: white; padding: 15px 20px; font-weight: 700; }
#backTop { right: 28px; bottom: 90px; }
body.embi-open #backTop { opacity: 0; pointer-events: none; }
body.embi-open .embi-launcher { visibility: hidden; pointer-events: none; }
@media (max-width: 639px) {
  .floating-dock { bottom: max(16px, env(safe-area-inset-bottom)); padding-inline: 16px; }
  .embi-panel { max-height: calc(100dvh - 100px); }
  .embi-form input { font-size: 16px; }
}
@media (max-width: 639px) and (max-height: 720px) {
  .embi-teaser { display: none; }
  .embi-footer p { display: none; }
}
@media (max-height: 560px) {
  .embi-panel { bottom: 0; height: calc(100dvh - 104px); max-height: calc(100dvh - 104px); }
  body.embi-open .embi-launcher { visibility: hidden; }
  .embi-header { padding-block: 8px; }
  .embi-header-avatar { width: 32px; height: 32px; border-radius: 10px; }
  .embi-header-avatar svg { width: 30px; height: 30px; }
  .embi-context, .embi-footer p { display: none; }
  .embi-messages { min-height: 0; padding-block: 8px; }
  .embi-suggestions { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; }
  .embi-suggestions button { flex-shrink: 0; }
  .embi-form { padding-block: 8px; }
  .embi-footer { padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .embi-assistant *, .embi-assistant *::before, .embi-assistant *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------
   Botón "Libro de Reclamaciones" dentro del hero: anclado al extremo
   derecho del contenido (misma línea vertical que el header) y con la
   base a la altura de las tarjetas "Explorar" y "Doc", por encima de
   la foto. Con JS activo queda fijo: acompaña al usuario hasta el
   final de la página, en la misma recta horizontal que "Ir arriba";
   sin JS (o en pantallas estrechas) conserva su posición dentro del
   hero. Embi sigue fijo abajo-izquierda.
------------------------------------------------------------------ */
/* Aparece junto al contenido del hero, nunca durante la intro/modales */
.js body:not(.site-ready) .reclamos-fab,
body.logo-intro-active .reclamos-fab,
body.no-scroll .reclamos-fab,
body.modal-open .reclamos-fab { opacity: 0; visibility: hidden; pointer-events: none; }
.reclamos-fab { display: none; }
.js .reclamos-fab {
  position: absolute;
  /* Con colocación definida, el bloque contenedor es el área de la
     celda: su borde derecho es el borde derecho del contenido del
     layout y su base cae sobre la línea de las tarjetas del hero. */
  grid-column: 2;
  grid-row: 1;
  right: 0;
  bottom: 0;
  display: flex; align-items: center; gap: 10px;
  min-height: 62px; padding: 6px 18px 6px 6px;
  border: 1px solid #BAE6FD; border-radius: 20px;
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  color: #1D4ED8; text-align: left; text-decoration: none;
  box-shadow: 0 6px 20px rgba(15,23,42,.16);
  transition: transform .25s, box-shadow .25s, border-color .25s, opacity .3s, visibility .3s;
  animation: fabNudge 3.4s ease-in-out infinite;
}
/* El JS lo suelta de la retícula: mientras el hero está en vista se
   queda a la altura de las tarjetas "Explorar"/"Doc" (borde derecho
   del contenido) y, cuando éstas salen de la pantalla, baja a la
   esquina inferior derecha en la misma recta horizontal que el
   botón "Ir arriba" y permanece así hasta el final de la página. */
.js .reclamos-fab.is-stuck {
  grid-column: auto;
  grid-row: auto;
  position: fixed;
  bottom: auto;
  top: var(--fab-top, auto);
  right: var(--fab-right, 0px);
  transition: transform .25s, box-shadow .25s, border-color .25s,
    opacity .3s, visibility .3s,
    top .45s var(--ease, ease), right .45s var(--ease, ease);
}
/* Acomodo final: misma recta horizontal que el círculo "Ir arriba",
   a su izquierda y centrado (medido por el JS). */
.js .reclamos-fab.is-stuck.is-docked {
  top: var(--fab-dock-top, calc(100vh - 83px));
  right: var(--fab-dock-right, 88px);
}
.js .reclamos-fab:hover { animation: none; transform: translateY(-3px); border-color: #60A5FA; box-shadow: 0 10px 26px rgba(29,78,216,.26); }
.js .reclamos-fab:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 3px; }
/* Halo que pulsa en sintonía con el saludo, para invitar al clic */
.js .reclamos-fab::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid #3B82F6;
  border-radius: 24px;
  opacity: 0;
  pointer-events: none;
  animation: fabHalo 3.4s ease-out infinite;
}
@keyframes fabNudge {
  0%, 70%, 100% { transform: translateY(0) scale(1); }
  76% { transform: translateY(-5px) scale(1.03); }
  82% { transform: translateY(0) scale(1); }
  88% { transform: translateY(-3px) scale(1.02); }
  94% { transform: translateY(0) scale(1); }
}
@keyframes fabHalo {
  0%, 68% { opacity: 0; transform: scale(.97); }
  76% { opacity: .65; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.12); }
}
.reclamos-fab-icon {
  position: relative; display: grid; place-items: center;
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 14px; background: rgba(255,255,255,.85); color: #1D4ED8;
}
.reclamos-fab-icon .complaints-book { width: 34px; height: 34px; }
.reclamos-fab-copy { display: grid; gap: 3px; line-height: 1.15; }
.reclamos-fab-copy span { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #475569; }
.reclamos-fab-copy strong { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 600; letter-spacing: -.04em; color: #0F172A; }
@media (prefers-reduced-motion: reduce) {
  .js .reclamos-fab, .js .reclamos-fab::after { animation: none !important; }
  .js .reclamos-fab:hover { transform: none; }
  .js .reclamos-fab.is-stuck { transition-duration: 0s; }
}
@media (max-width: 1023px) {
  /* Sin columna de imagen ni celda derecha: el botón fluye bajo las
     tarjetas del hero, a la izquierda (gap del layout es 0). */
  .js .reclamos-fab,
  .js .reclamos-fab.is-stuck,
  .js .reclamos-fab.is-stuck.is-docked {
    position: static;
    grid-column: auto;
    grid-row: auto;
    top: auto;
    right: auto;
    bottom: auto;
    justify-self: start;
    margin-top: 14px;
  }
}

/* Modo oscuro del asistente Embi */
[data-theme='dark'] .embi-assistant { color: #E8EDF6; }
[data-theme='dark'] .embi-launcher {
  background: #162035; border-color: rgba(96,165,250,.3); color: #BFDBFE;
  box-shadow: 0 6px 22px rgba(0,0,0,.55);
}
[data-theme='dark'] .embi-launcher:hover { box-shadow: 0 8px 26px rgba(2,132,199,.35); }
[data-theme='dark'] .embi-panel { background: #111A2B; border-color: #26334D; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
[data-theme='dark'] .embi-header { background: #162035; border-bottom-color: #26334D; color: #E8EDF6; }
[data-theme='dark'] .embi-header h2 { color: #E8EDF6; }
[data-theme='dark'] .embi-header p { color: #94A3B8; }
[data-theme='dark'] .embi-header-avatar { background: rgba(96,165,250,.16); }
[data-theme='dark'] .embi-minimize { background: #1B2740; color: #94A3B8; }
[data-theme='dark'] .embi-context { background: #111A2B; color: #94A3B8; }
[data-theme='dark'] .embi-context strong, [data-theme='dark'] .embi-context i { color: #7DD3FC; }
[data-theme='dark'] .embi-message { background: #1B2740; color: #DCE4F2; }
[data-theme='dark'] .embi-message.is-user { background: #1D4ED8; color: #fff; }
[data-theme='dark'] .embi-message a { color: #93C5FD; }
[data-theme='dark'] .embi-suggestions button { background: #162035; border-color: #26334D; color: #B6C2D6; }
[data-theme='dark'] .embi-suggestions button:hover { background: #1E3A5F; border-color: #3B82F6; }
[data-theme='dark'] .embi-form { background: #111A2B; border-top-color: #26334D; }
[data-theme='dark'] .embi-form input { background: #0C1424; border-color: #26334D; color: #E8EDF6; }
[data-theme='dark'] .embi-form input::placeholder { color: #7C8CA5; }
[data-theme='dark'] .embi-footer { background: #111A2B; }
[data-theme='dark'] .embi-whatsapp { background: rgba(37,211,102,.14); color: #86EFAC; }
[data-theme='dark'] .embi-whatsapp:hover { background: rgba(37,211,102,.24); color: #BBF7D0; }
[data-theme='dark'] .embi-teaser { background: #162035; border-color: #26334D; box-shadow: 0 8px 26px rgba(0,0,0,.5); }
[data-theme='dark'] .embi-teaser p:last-of-type { color: #A9B6CC; }
[data-theme='dark'] .embi-teaser-open { color: #93C5FD; }
[data-theme='dark'] .embi-eyebrow { color: #93C5FD; }
[data-theme='dark'] .embi-whatsapp-badge { border-color: #111A2B; }
html[data-theme='dark'] .reclamos-fab {
  background: linear-gradient(135deg, #162035, #1B2740);
  border-color: rgba(96,165,250,.3); color: #BFDBFE;
  box-shadow: 0 6px 22px rgba(0,0,0,.55);
}
html[data-theme='dark'] .reclamos-fab:hover { border-color: #3B82F6; box-shadow: 0 8px 26px rgba(2,132,199,.35); }
html[data-theme='dark'] .reclamos-fab::after { border-color: #38BDF8; }
html[data-theme='dark'] .reclamos-fab:focus-visible { outline-color: #60A5FA; }
html[data-theme='dark'] .reclamos-fab-icon { background: rgba(96,165,250,.16); color: #93C5FD; }
html[data-theme='dark'] .reclamos-fab-copy span { color: #94A3B8; }
html[data-theme='dark'] .reclamos-fab-copy strong { color: #E8EDF6; }
