/* ============================================================
   wa-widget.css — Burbuja de contacto de WhatsApp
   ------------------------------------------------------------
   Antes estos estilos vivían en un <style> en línea dentro de
   includes/footer.php. Se han sacado a un fichero propio porque:
     · el <style> en línea engordaba el HTML en cada página
       (no se puede cachear entre navegaciones),
     · el auditor detectaba .wa-panel y .wa-bubble duplicados,
     · así se puede minificar y cachear como cualquier otro CSS.
   Se carga de forma asíncrona: el widget está fijado abajo a la
   derecha, fuera del contenido crítico.
   ============================================================ */

.wa-widget{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:9999;
  font-family:'Inter',sans-serif;
}

/* ── Burbuja flotante ──────────────────────────────────────── */
/* CORRECCIÓN R-37..R-39: se añade will-change para transform y box-shadow */
.wa-bubble{
  width:60px;
  height:60px;
  border-radius:50%;
  background:#25D366;
  color:#fff;
  border:none;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:30px;
  cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,.25);
  transition:transform .2s ease, box-shadow .2s ease;
  will-change: transform, box-shadow;
}
.wa-bubble:hover{transform:scale(1.08);box-shadow:0 6px 18px rgba(0,0,0,.3)}
.wa-bubble:active{transform:scale(.96)}
.wa-bubble:focus-visible{outline:3px solid #fff;outline-offset:3px}

/* El icono es un SVG en línea (ver footer.php): no depende de que
   Font Awesome haya terminado de cargar. */
.wa-bubble svg{
  width:32px;
  height:32px;
  fill:currentColor;
  display:block;
}

/* ── Panel desplegable ─────────────────────────────────────── */
/* CORRECCIÓN: añadido will-change: transform, opacity */
.wa-panel{
  position:absolute;
  right:0;
  bottom:76px;
  width:320px;
  max-width:calc(100vw - 40px);
  background:#fff;
  border-radius:14px;
  box-shadow:0 10px 35px rgba(0,0,0,.25);
  overflow:hidden;
  opacity:0;
  visibility:hidden;
  transform:translateY(16px) scale(.97);
  transform-origin:bottom right;
  transition:opacity .22s ease, transform .22s ease, visibility .22s;
  will-change: transform, opacity;
}
.wa-widget.is-open .wa-panel{
  opacity:1;
  visibility:visible;
  transform:translateY(0) scale(1);
}

.wa-panel-header{
  background:#25D366;
  color:#fff;
  padding:16px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.wa-panel-header-title{display:flex;align-items:center;gap:10px;font-weight:700;font-size:1.05rem}
.wa-panel-header-title i{font-size:1.3rem}

.wa-close{
  background:rgba(255,255,255,.18);
  border:none;
  color:#fff;
  width:28px;
  height:28px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:.85rem;
  transition:background .15s ease;
}
.wa-close:hover{background:rgba(255,255,255,.32)}

.wa-panel-body{
  padding:16px 18px;
  max-height:min(60vh,420px);
  overflow-y:auto;
}

.wa-message{
  background:#f5f6f7;
  border-radius:10px;
  padding:12px 14px;
  margin-bottom:14px;
}
.wa-message p{margin:0 0 6px;color:#3a3a3a;font-size:.92rem;line-height:1.5}
.wa-message p:last-child{margin-bottom:0}

.wa-info{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.wa-info-item{
  display:flex;
  align-items:flex-start;
  gap:10px;
  color:#3a3a3a;
  text-decoration:none;
  font-size:.86rem;
  line-height:1.5;
}
a.wa-info-item:hover{color:#25D366}
.wa-info-item i{color:#25D366;width:16px;margin-top:2px;font-size:.9rem;flex-shrink:0}
.wa-info-address strong{color:#222;display:block;margin-bottom:2px}

.wa-chat-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:#25D366;
  font-weight:700;
  font-size:.95rem;
  padding:14px;
  text-decoration:none;
  transition:background .15s ease;
}
/* Agrupado para no necesitar !important frente a la regla a:hover
   global de main.css (dos clases ganan en especificidad). */
.wa-chat-btn,.wa-chat-btn:hover,.wa-chat-btn:focus{color:#fff}
.wa-chat-btn:hover{background:#1ebe5a}

@media (max-width:480px){
  .wa-widget{right:14px;bottom:14px}
  .wa-panel{right:-6px;width:300px}
  .wa-bubble{width:54px;height:54px;font-size:26px}
  .wa-bubble svg{width:28px;height:28px}
}