/* =========================================================
   1. VARIABLES Y BASE
   ========================================================= */
:root{
  --af-primary:#0B3D6B;
  --af-primary-dark:#082c4f;
  --af-primary-soft:#e7eef5;
  --af-accent:#1BB8A6;
  --af-accent-dark:#149384;
  --af-bg-light:#F7FAFC;
  --af-gray:#5C6B7A;
  --af-gray-light:#9AA7B4;
  --af-white:#FFFFFF;
  --af-radius-lg:24px;
  --af-radius-md:16px;
  --af-radius-sm:10px;
  --af-shadow-sm:0 4px 14px rgba(11,61,107,0.08);
  --af-shadow-md:0 12px 30px rgba(11,61,107,0.12);
  --af-shadow-lg:0 20px 50px rgba(11,61,107,0.18);
  --af-transition:all .3s ease;
}

*{ box-sizing:border-box; }

html{ scroll-behavior:smooth; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *, *::before, *::after{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; }
}

body{
  font-family:'Inter', sans-serif;
  color:#26313D;
  background-color:var(--af-white);
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3,h4,h5,.af-display{
  font-family:'Poppins', sans-serif;
  font-weight:700;
  color:var(--af-primary);
}

a{ text-decoration:none; }

/* Foco visible accesible para navegación por teclado */
a:focus-visible, button:focus-visible, input:focus-visible, .af-card:focus-visible{
  outline:3px solid var(--af-accent);
  outline-offset:3px;
  border-radius:4px;
}

.af-section{ padding:96px 0; }
.af-eyebrow{
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:.78rem;
  font-weight:600;
  color:var(--af-accent-dark);
}
.af-lead{ color:var(--af-gray); font-size:1.08rem; }

.af-btn{
  font-family:'Poppins', sans-serif;
  font-weight:600;
  border-radius:50px;
  padding:.85rem 1.9rem;
  border:2px solid transparent;
  transition:var(--af-transition);
  display:inline-flex;
  align-items:center;
  gap:.5rem;
}
.af-btn-primary{ background-color:var(--af-accent); color:var(--af-white); }
.af-btn-primary:hover{ background-color:var(--af-accent-dark); color:var(--af-white); transform:translateY(-2px); box-shadow:var(--af-shadow-md); }
.af-btn-outline{ background-color:transparent; color:var(--af-white); border-color:rgba(255,255,255,.6); }
.af-btn-outline:hover{ background-color:rgba(255,255,255,.15); color:var(--af-white); border-color:var(--af-white); }
.af-btn-ghost-dark{ background:transparent; color:var(--af-primary); border-color:var(--af-primary-soft); }
.af-btn-ghost-dark:hover{ background:var(--af-primary-soft); }

/* =========================================================
   2. NAVBAR
   ========================================================= */
.af-navbar{
  position:fixed; top:0; left:0; right:0; z-index:1030;
  padding:18px 0;
  background:transparent;
  transition:var(--af-transition);
}
.af-navbar.is-scrolled{
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(8px);
  box-shadow:0 4px 18px rgba(11,61,107,0.08);
  padding:10px 0;
}
.af-navbar .af-logo{
  font-family:'Poppins', sans-serif;
  font-weight:700;
  font-size:1.25rem;
  color:var(--af-white);
  display:flex; align-items:center; gap:.5rem;
  transition:var(--af-transition);
}
.af-navbar.is-scrolled .af-logo{ color:var(--af-primary); }
.af-navbar .af-logo i{ color:var(--af-accent); font-size:1.5rem; }

.af-nav-link{
  color:rgba(255,255,255,.9);
  font-weight:500;
  margin:0 .75rem;
  position:relative;
  transition:var(--af-transition);
}
.af-nav-link::after{
  content:'';
  position:absolute; left:0; bottom:-6px;
  width:0; height:2px; background:var(--af-accent);
  transition:width .25s ease;
}
.af-nav-link:hover::after, .af-nav-link.active::after{ width:100%; }
.af-nav-link:hover{ color:var(--af-white); }
.af-navbar.is-scrolled .af-nav-link{ color:var(--af-primary); }
.af-navbar.is-scrolled .af-nav-link:hover{ color:var(--af-primary-dark); }

.af-nav-cta{
  background-color:var(--af-accent);
  color:var(--af-white) !important;
  font-weight:600;
  border-radius:50px;
  padding:.55rem 1.4rem;
  transition:var(--af-transition);
}
.af-nav-cta:hover{ background-color:var(--af-accent-dark); transform:translateY(-1px); }

.af-navbar .navbar-toggler{ border:none; }
.af-navbar .navbar-toggler-icon{ filter:none; }
.af-navbar:not(.is-scrolled) .navbar-toggler i{ color:#fff; }
.af-navbar.is-scrolled .navbar-toggler i{ color:var(--af-primary); }

@media (max-width:991.98px){
  .af-navbar .navbar-collapse{
    background:var(--af-white);
    margin-top:14px;
    padding:18px;
    border-radius:var(--af-radius-md);
    box-shadow:var(--af-shadow-md);
  }
  .af-navbar .af-nav-link, .af-navbar.is-scrolled .af-nav-link{ color:var(--af-primary); margin:.3rem 0; }
  .af-nav-cta{ display:inline-block; margin-top:.5rem; }
}

/* =========================================================
   3. HERO
   ========================================================= */
.af-hero{
  position:relative;
  min-height:100vh;
  display:flex; align-items:center;
  padding-top:140px; padding-bottom:80px;
  background:linear-gradient(135deg, var(--af-primary) 0%, var(--af-primary-dark) 60%, #062138 100%);
  overflow:hidden;
}
.af-hero::before{
  content:'';
  position:absolute; inset:0;
  background:
    radial-gradient(circle at 85% 20%, rgba(27,184,166,.25), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(27,184,166,.15), transparent 40%);
  pointer-events:none;
}
.af-hero-content{ position:relative; z-index:2; color:var(--af-white); }
.af-hero-content h1{
  color:var(--af-white);
  font-size:clamp(2.1rem, 4vw, 3.4rem);
  line-height:1.15;
  margin-bottom:1.2rem;
}
.af-hero-content h1 span{ color:var(--af-accent); }
.af-hero-content p.af-hero-sub{
  color:rgba(255,255,255,.85);
  font-size:1.15rem;
  max-width:540px;
  margin-bottom:2rem;
}
.af-hero-badges{
  margin-top:2.5rem;
  display:flex; gap:1.5rem; flex-wrap:wrap;
  color:rgba(255,255,255,.75); font-size:.9rem;
}
.af-hero-badges span{ display:flex; align-items:center; gap:.4rem; }
.af-hero-badges i{ color:var(--af-accent); }

.af-hero-media{ position:relative; z-index:2; }
.af-hero-media .af-img-frame{
  border-radius:var(--af-radius-lg);
  overflow:hidden;
  box-shadow:var(--af-shadow-lg);
  border:6px solid rgba(255,255,255,.08);
  aspect-ratio:4/5;
  background:linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
}
.af-hero-media img{ width:100%; height:100%; object-fit:cover; display:block; }
.af-hero-floating-card{
  position:absolute; bottom:-24px; left:-24px;
  background:var(--af-white);
  border-radius:var(--af-radius-md);
  box-shadow:var(--af-shadow-lg);
  padding:1.1rem 1.4rem;
  display:flex; align-items:center; gap:.8rem;
  max-width:240px;
}
.af-hero-floating-card .af-icon-circle{
  background:var(--af-accent); color:var(--af-white);
  width:44px; height:44px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; font-size:1.2rem; flex-shrink:0;
}
.af-hero-floating-card strong{ display:block; color:var(--af-primary); font-family:'Poppins',sans-serif; }
.af-hero-floating-card span{ font-size:.82rem; color:var(--af-gray); }

@media (max-width:991.98px){
  .af-hero{ padding-top:120px; text-align:center; }
  .af-hero-content{ margin-bottom:3rem; }
  .af-hero-content p.af-hero-sub{ margin-left:auto; margin-right:auto; }
  .af-hero-badges{ justify-content:center; }
  .af-hero-floating-card{ left:50%; transform:translateX(-50%); }
}

/* =========================================================
   4. INDICADORES DE CONFIANZA
   ========================================================= */
.af-trust{
  background:var(--af-white);
  margin-top:-1px;
}
.af-counter-item{ text-align:center; padding:1rem; }
.af-counter-number{
  font-family:'Poppins',sans-serif;
  font-weight:800;
  font-size:clamp(2rem, 3.5vw, 2.8rem);
  color:var(--af-primary);
  line-height:1;
}
.af-counter-number .af-accent-text{ color:var(--af-accent); }
.af-counter-label{
  color:var(--af-gray);
  font-weight:500;
  margin-top:.4rem;
  font-size:.95rem;
}

/* =========================================================
   5. PRODUCTOS
   ========================================================= */
.af-bg-light{ background-color:var(--af-bg-light); }

.af-section-title{ font-size:clamp(1.8rem, 3vw, 2.4rem); margin-bottom:.6rem; }
.af-section-head{ max-width:680px; margin-bottom:3.5rem; }

.af-product-card{
  background:var(--af-white);
  border-radius:var(--af-radius-md);
  padding:2.2rem 1.8rem;
  height:100%;
  box-shadow:var(--af-shadow-sm);
  transition:var(--af-transition);
  border:1px solid rgba(11,61,107,.06);
}
.af-product-card:hover{
  transform:translateY(-8px);
  box-shadow:var(--af-shadow-md);
  border-color:rgba(27,184,166,.25);
}
.af-product-icon{
  width:60px; height:60px; border-radius:16px;
  background:var(--af-primary-soft);
  color:var(--af-primary);
  display:flex; align-items:center; justify-content:center;
  font-size:1.6rem; margin-bottom:1.3rem;
  transition:var(--af-transition);
}
.af-product-card:hover .af-product-icon{ background:var(--af-accent); color:var(--af-white); }
.af-product-card h3{ font-size:1.15rem; margin-bottom:.6rem; }
.af-product-card p{ color:var(--af-gray); font-size:.95rem; margin-bottom:1.2rem; }
.af-product-link{ color:var(--af-accent-dark); font-weight:600; font-size:.92rem; }
.af-product-link i{ transition:transform .2s ease; }
.af-product-link:hover i{ transform:translateX(4px); }
.af-product-link:hover{ color:var(--af-primary); }

/* =========================================================
   6. BENEFICIOS
   ========================================================= */
.af-benefit-item{
  display:flex; gap:1.1rem; margin-bottom:1.8rem;
}
.af-benefit-icon{
  width:50px; height:50px; border-radius:50%;
  background:var(--af-accent); color:var(--af-white);
  display:flex; align-items:center; justify-content:center;
  font-size:1.25rem; flex-shrink:0;
}
.af-benefit-item h3{ font-size:1.05rem; margin-bottom:.3rem; }
.af-benefit-item p{ color:var(--af-gray); font-size:.93rem; margin-bottom:0; }
.af-benefits-media{
  border-radius:var(--af-radius-lg);
  overflow:hidden;
  box-shadow:var(--af-shadow-md);
  aspect-ratio:4/3;
  background:linear-gradient(160deg, var(--af-primary-soft), #ffffff);
}
.af-benefits-media img{ width:100%; height:100%; object-fit:cover; display:block; }

/* =========================================================
   7. CÓMO FUNCIONA
   ========================================================= */
.af-steps{ position:relative; }
.af-step{
  text-align:center;
  padding:2rem 1.4rem;
  position:relative;
}
.af-step-number{
  width:64px; height:64px; border-radius:50%;
  background:var(--af-white);
  border:2px solid var(--af-accent);
  color:var(--af-primary);
  font-family:'Poppins',sans-serif; font-weight:700; font-size:1.4rem;
  display:flex; align-items:center; justify-content:center;
  margin:0 auto 1.3rem;
  box-shadow:var(--af-shadow-sm);
}
.af-step h3{ font-size:1.1rem; margin-bottom:.5rem; }
.af-step p{ color:var(--af-gray); font-size:.93rem; max-width:260px; margin:0 auto; }
.af-step-connector{
  position:absolute; top:32px; left:100%;
  width:100%; height:2px;
  background:repeating-linear-gradient(90deg, var(--af-accent) 0 8px, transparent 8px 16px);
  display:none;
}
@media (min-width:768px){
  .af-step-connector{ display:block; }
}

/* =========================================================
   8. TESTIMONIOS
   ========================================================= */
.af-testimonial-card{
  background:var(--af-white);
  border-radius:var(--af-radius-lg);
  box-shadow:var(--af-shadow-md);
  padding:3rem 2rem;
  text-align:center;
  max-width:680px;
  margin:0 auto;
}
.af-testimonial-avatar{
  width:84px; height:84px; border-radius:50%;
  object-fit:cover;
  border:4px solid var(--af-primary-soft);
  margin:0 auto 1.2rem;
  display:block;
}
.af-testimonial-quote{
  font-size:1.1rem; color:#3A4856; font-style:italic; margin-bottom:1.2rem;
}
.af-testimonial-quote i.bi-quote{ color:var(--af-accent); font-size:1.6rem; display:block; margin-bottom:.4rem; }
.af-testimonial-name{ font-family:'Poppins',sans-serif; color:var(--af-primary); font-weight:600; }
.af-testimonial-role{ color:var(--af-gray); font-size:.88rem; }

#afCarousel .carousel-indicators [data-bs-target]{
  background-color:var(--af-primary-soft);
  width:10px; height:10px; border-radius:50%; opacity:1;
}
#afCarousel .carousel-indicators .active{ background-color:var(--af-accent); }
#afCarousel .carousel-control-prev, #afCarousel .carousel-control-next{
  width:44px; height:44px; top:50%; transform:translateY(-50%);
  background:var(--af-white); border-radius:50%; box-shadow:var(--af-shadow-sm);
  opacity:1;
}
#afCarousel .carousel-control-prev{ left:-10px; }
#afCarousel .carousel-control-next{ right:-10px; }
@media (max-width:575.98px){
  #afCarousel .carousel-control-prev, #afCarousel .carousel-control-next{ display:none; }
}
#afCarousel .carousel-control-prev-icon, #afCarousel .carousel-control-next-icon{ filter:invert(.3) sepia(1) saturate(3) hue-rotate(165deg); }

/* =========================================================
   9. CTA FINAL + FOOTER
   ========================================================= */
.af-cta-final{
  background:linear-gradient(120deg, var(--af-primary), var(--af-primary-dark));
  border-radius:var(--af-radius-lg);
  padding:3.5rem 2.5rem;
  color:var(--af-white);
  text-align:center;
  position:relative;
  overflow:hidden;
}
.af-cta-final::before{
  content:''; position:absolute; inset:0;
  background:radial-gradient(circle at 90% 10%, rgba(27,184,166,.3), transparent 50%);
}
.af-cta-final h2{ color:var(--af-white); position:relative; z-index:1; }
.af-cta-final p{ color:rgba(255,255,255,.85); position:relative; z-index:1; max-width:560px; margin:0 auto 1.8rem; }
.af-cta-final .af-btn{ position:relative; z-index:1; }

.af-footer{
  background:#082235;
  color:rgba(255,255,255,.75);
  padding:70px 0 0;
}
.af-footer .af-logo{ color:var(--af-white); font-family:'Poppins',sans-serif; font-weight:700; font-size:1.2rem; display:flex; align-items:center; gap:.5rem; margin-bottom:1rem; }
.af-footer .af-logo i{ color:var(--af-accent); }
.af-footer h5{ color:var(--af-white); font-family:'Poppins',sans-serif; font-size:1rem; margin-bottom:1.2rem; }
.af-footer a{ color:rgba(255,255,255,.7); transition:var(--af-transition); }
.af-footer a:hover{ color:var(--af-accent); }
.af-footer ul{ list-style:none; padding:0; margin:0; }
.af-footer ul li{ margin-bottom:.6rem; }
.af-footer .af-social a{
  width:38px; height:38px; border-radius:50%;
  background:rgba(255,255,255,.08);
  display:inline-flex; align-items:center; justify-content:center;
  margin-right:.5rem;
}
.af-footer .af-social a:hover{ background:var(--af-accent); color:var(--af-white); }
.af-footer-bottom{
  border-top:1px solid rgba(255,255,255,.1);
  margin-top:50px; padding:24px 0;
  font-size:.82rem; color:rgba(255,255,255,.55);
}
.af-footer-legal{
  font-size:.8rem; color:rgba(255,255,255,.55);
  line-height:1.6; margin-bottom:1.5rem;
}
.af-footer-legal i{ color:var(--af-accent); margin-right:.4rem; }

/* =========================================================
   10. WIDGET CHATBOT (Aurorita)
   ========================================================= */
.af-bot-toggle{
  position:fixed; bottom:24px; right:24px; z-index:1080;
  width:64px; height:64px; border-radius:50%;
  background:var(--af-accent);
  border:none; cursor:pointer;
  box-shadow:0 10px 25px rgba(11,61,107,.35);
  display:flex; align-items:center; justify-content:center;
  transition:var(--af-transition);
  overflow:hidden;
}
.af-bot-toggle:hover{ transform:scale(1.06); background:var(--af-accent-dark); }
.af-bot-toggle img{ width:100%; height:100%; object-fit:cover; border-radius:50%; }
.af-bot-toggle i{ color:var(--af-white); font-size:1.6rem; }
.af-bot-toggle .af-bot-close-icon{ display:none; }
.af-bot-toggle.is-open .af-bot-open-icon{ display:none; }
.af-bot-toggle.is-open .af-bot-close-icon{ display:block; }
.af-bot-pulse{
  position:absolute; top:-2px; right:-2px;
  width:14px; height:14px; border-radius:50%;
  background:#FF5C5C; border:2px solid var(--af-white);
}

.af-bot-window{
  position:fixed; bottom:100px; right:24px; z-index:1079;
  width:360px; max-width:92vw; height:600px; max-height:82vh;
  background:var(--af-white);
  border-radius:var(--af-radius-md);
  box-shadow:var(--af-shadow-lg);
  display:flex; flex-direction:column;
  overflow:hidden;
  transform-origin:bottom right;
  transform:scale(0.85) translateY(20px);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .28s ease, transform .28s ease, visibility .28s ease, bottom .28s ease;
}
.af-bot-window.is-open{
  bottom:24px;
  transform:scale(1) translateY(0);
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.af-bot-header{
  background:linear-gradient(120deg, var(--af-primary), var(--af-primary-dark));
  color:var(--af-white);
  padding:14px 16px;
  display:flex; align-items:center; gap:.7rem;
  flex-shrink:0;
}
.af-bot-avatar{
  width:42px; height:42px; border-radius:50%;
  background:rgba(255,255,255,.15);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden; flex-shrink:0;
}
.af-bot-avatar img{ width:100%; height:100%; object-fit:cover; }
.af-bot-avatar i{ font-size:1.3rem; color:var(--af-white); }
.af-bot-header-info strong{ display:block; font-family:'Poppins',sans-serif; font-size:.95rem; }
.af-bot-header-info span{ font-size:.75rem; color:rgba(255,255,255,.75); display:flex; align-items:center; gap:.3rem; }
.af-bot-status-dot{ width:7px; height:7px; border-radius:50%; background:#4ADE80; display:inline-block; }
.af-bot-header-close{
  margin-left:auto; background:transparent; border:none; color:rgba(255,255,255,.8);
  font-size:1.1rem; cursor:pointer; padding:.3rem;
}
.af-bot-header-close:hover{ color:var(--af-white); }

.af-bot-messages{
  flex:1; overflow-y:auto;
  padding:18px 16px;
  background:var(--af-bg-light);
  display:flex; flex-direction:column; gap:10px;
}
.af-bot-msg{
  max-width:100%;
  padding:.65rem .9rem;
  border-radius:14px;
  font-size:.88rem; line-height:1.45;
}
.af-bot-msg-bot{
  background:var(--af-white);
  color:#2C3A47;
  align-self:flex-start;
  border-bottom-left-radius:4px;
  box-shadow:var(--af-shadow-sm);
}
.af-bot-msg-user{
  background:var(--af-accent);
  color:var(--af-white);
  align-self:flex-end;
  border-bottom-right-radius:4px;
}

/* Formato enriquecido dentro de las respuestas del bot (Markdown -> HTML) */
.af-bot-msg-bot strong{ font-weight:700; color:var(--af-primary); }
.af-bot-msg-bot > * + *{ margin-top:.35rem; }        /* separa bloques/líneas */
.af-bot-msg-bot .af-bot-list{
  margin:.15rem 0; padding-left:1.15rem;
  list-style:disc;
}
.af-bot-msg-bot .af-bot-list li{ margin:.12rem 0; }

.af-bot-inputbar{
  display:flex; align-items:center; gap:.5rem;
  padding:12px 14px;
  border-top:1px solid rgba(11,61,107,.08);
  background:var(--af-white);
  flex-shrink:0;
}
.af-bot-inputbar input{
  flex:1; border:1px solid rgba(11,61,107,.15);
  border-radius:50px; padding:.6rem 1rem;
  font-size:.88rem; outline:none;
}
.af-bot-inputbar input:focus{ border-color:var(--af-accent); }
.af-bot-send{
  width:40px; height:40px; border-radius:50%;
  background:var(--af-primary); color:var(--af-white);
  border:none; display:flex; align-items:center; justify-content:center;
  flex-shrink:0; cursor:pointer; transition:var(--af-transition);
}
.af-bot-send:hover{ background:var(--af-accent-dark); }
.af-bot-send:disabled{ opacity:.5; cursor:not-allowed; }

@keyframes afMicPulse{
  0%, 100%{ box-shadow:0 0 0 0 rgba(229,72,77,.55); }
  50%     { box-shadow:0 0 0 7px rgba(229,72,77,0); }
}

/* =========================================================
   MENÚ DESPLEGABLE DE ADJUNTOS (documento / ubicación / audio)
   ========================================================= */
.af-bot-menu-wrap{ position:relative; flex-shrink:0; }

/* Botón principal que abre el menú (hamburguesa). Se transforma en
   botón "detener" mientras se graba una nota de voz. */
.af-bot-menu-toggle{
  width:38px; height:38px; border-radius:50%;
  background:var(--af-primary-soft); color:var(--af-primary);
  border:none; display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-size:1.25rem; transition:var(--af-transition);
}
.af-bot-menu-toggle:hover{ background:var(--af-accent); color:var(--af-white); }
.af-bot-menu-toggle.is-active{ background:var(--af-primary); color:var(--af-white); }
.af-bot-menu-toggle:disabled{ opacity:.5; cursor:not-allowed; }
.af-bot-menu-toggle.is-recording{
  background:#e5484d; color:var(--af-white);
  animation:afMicPulse 1.3s infinite;
}

/* Tooltip instantáneo que explica la acción del botón (aparece encima) */
.af-tip{ position:relative; }
.af-tip::after{
  content:attr(data-tooltip);
  position:absolute; bottom:calc(100% + 11px); left:0;
  transform:translateY(4px);
  background:var(--af-primary); color:var(--af-white);
  font-size:.72rem; font-weight:600; line-height:1.1; white-space:nowrap;
  padding:7px 11px; border-radius:8px;
  box-shadow:0 6px 16px rgba(11,61,107,.22);
  opacity:0; pointer-events:none; z-index:6;
  transition:opacity .16s ease, transform .16s ease;
}
.af-tip::before{
  content:''; position:absolute; bottom:calc(100% + 5px); left:19px;
  transform:translateX(-50%);
  border:5px solid transparent; border-top-color:var(--af-primary);
  opacity:0; pointer-events:none; z-index:6;
  transition:opacity .16s ease;
}
.af-tip:hover::after, .af-tip:focus-visible::after{ opacity:1; transform:translateY(0); }
.af-tip:hover::before, .af-tip:focus-visible::before{ opacity:1; }
/* Ocultar el tooltip mientras el menú está abierto (evita solaparse con el popover) */
.af-tip.is-active::after, .af-tip.is-active::before{ opacity:0; }

/* Popover con las opciones */
.af-bot-menu{
  position:absolute; bottom:calc(100% + 12px); left:0;
  min-width:216px; padding:8px;
  background:var(--af-white);
  border:1px solid rgba(11,61,107,.10);
  border-radius:var(--af-radius-md);
  box-shadow:0 12px 34px rgba(11,61,107,.18);
  display:flex; flex-direction:column; gap:2px;
  opacity:0; transform:translateY(10px) scale(.96); transform-origin:bottom left;
  pointer-events:none; z-index:5;
  transition:opacity .18s ease, transform .18s ease;
}
.af-bot-menu.is-open{ opacity:1; transform:translateY(0) scale(1); pointer-events:auto; }

/* Flecha del popover apuntando al botón */
.af-bot-menu::after{
  content:''; position:absolute; top:100%; left:20px;
  border:7px solid transparent; border-top-color:var(--af-white);
}

.af-bot-menu-item{
  display:flex; align-items:center; gap:.7rem;
  width:100%; padding:9px 10px;
  background:transparent; border:none; border-radius:10px;
  cursor:pointer; text-align:left;
  font-family:inherit; font-size:.9rem; font-weight:600;
  color:var(--af-primary); transition:background .15s ease;
}
.af-bot-menu-item:hover{ background:var(--af-primary-soft); }
.af-bot-menu-item:disabled{ opacity:.5; cursor:not-allowed; }

.af-bot-menu-ico{
  width:34px; height:34px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:1.05rem; color:var(--af-white);
}
.af-bot-menu-ico-doc{   background:var(--af-primary); }
.af-bot-menu-ico-geo{   background:var(--af-accent); }
.af-bot-menu-ico-audio{ background:#e5484d; }

/* Burbuja de ubicación compartida (enlace a mapa) */
.af-bot-msg-geo a{
  display:flex; align-items:center; gap:.5rem;
  color:inherit; text-decoration:none; font-weight:600;
}
.af-bot-msg-geo .bi{ font-size:1.2rem; }
.af-bot-msg-geo small{ display:block; font-weight:400; opacity:.85; }

/* Miniatura de la imagen del documento dentro de una burbuja */
.af-bot-msg-img{ padding:5px; }
.af-bot-msg-img img{
  display:block; max-width:200px; width:100%;
  border-radius:10px;
}

/* Reproductor de la nota de voz dentro de una burbuja */
.af-bot-msg-audio{ padding:6px 8px; }
.af-bot-msg-audio audio{
  display:block; width:210px; max-width:100%;
}

/* Indicador "escribiendo…" (tres puntos animados) */
.af-bot-typing{ display:flex; gap:4px; align-items:center; width:auto; }
.af-bot-typing span{
  width:7px; height:7px; border-radius:50%;
  background:var(--af-primary); opacity:.4;
  animation:afTypingBlink 1.2s infinite ease-in-out;
}
.af-bot-typing span:nth-child(2){ animation-delay:.2s; }
.af-bot-typing span:nth-child(3){ animation-delay:.4s; }
@keyframes afTypingBlink{
  0%, 80%, 100%{ opacity:.3; transform:translateY(0); }
  40%{ opacity:1; transform:translateY(-3px); }
}

@media (max-width:480px){
  .af-bot-window{ right:4vw; bottom:90px; width:92vw; height:80vh; }
  .af-bot-window.is-open{ bottom:12px; }
  .af-bot-toggle{ right:18px; bottom:18px; }
}
