/* ==========================================================
   Dreams Flying — Mini widget de WhatsApp (burbuja + panel 3D)
   ========================================================== */

/* Ocultar el widget cuando el menú móvil está abierto (body.menu-open) */
body.menu-open .dfw-wrapper{
  display: none !important;
}

.dfw-wrapper{
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  pointer-events: none;
}

/* ---------- Burbuja flotante ---------- */
.dfw-bubble{
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #22c55e, #16a34a);
  box-shadow:
    0 10px 25px rgba(0,0,0,0.35),
    0 0 0 0 rgba(34,197,94,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  pointer-events: auto;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
}
.dfw-bubble:hover{
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 16px 34px rgba(0,0,0,0.45), 0 0 30px rgba(34,197,94,0.45);
}
.dfw-bubble.is-open{
  transform: rotate(90deg) scale(0.92);
}
.dfw-wa-icon{
  width: 30px;
  height: 30px;
  color: #fff;
  transition: opacity .2s ease;
}
.dfw-bubble.is-open .dfw-wa-icon{
  opacity: 0;
}
.dfw-bubble.is-open::after{
  content: "✕";
  position: absolute;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
}

.dfw-ping{
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(34,197,94,0.6);
  animation: dfw-pulse 2.2s ease-out infinite;
}
@keyframes dfw-pulse{
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ---------- Panel de mini chat ---------- */
.dfw-panel{
  width: 320px;
  max-width: calc(100vw - 48px);
  margin-bottom: 16px;
  background: linear-gradient(165deg, #16203a, #0f1526);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.55), 0 0 40px rgba(59,130,246,0.12);
  overflow: hidden;
  transform: translateY(20px) scale(0.94);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .3s ease, visibility .3s ease;
}
.dfw-panel.active{
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.dfw-panel-header{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  position: relative;
}
.dfw-avatar{
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}
.dfw-header-text{
  display: flex;
  flex-direction: column;
  color: #fff;
  line-height: 1.3;
}
.dfw-header-text strong{
  font-size: 0.95rem;
}
.dfw-status{
  font-size: 0.72rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dfw-dot{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bbf7d0;
  box-shadow: 0 0 6px #bbf7d0;
}
.dfw-close{
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background .2s ease;
}
.dfw-close:hover{ background: rgba(255,255,255,0.3); }

.dfw-panel-body{
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dfw-bubble-bot{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 14px;
  color: #eef2ff;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: dfw-fade-in .4s ease;
}
@keyframes dfw-fade-in{
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dfw-quick-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dfw-quick-btn{
  text-align: left;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3);
  color: #cfe0ff;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.dfw-quick-btn:hover{
  background: rgba(59,130,246,0.22);
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(59,130,246,0.25);
}

.dfw-panel-footer{
  padding: 10px 16px 14px;
  font-size: 0.68rem;
  color: #8b95b3;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 420px){
  .dfw-wrapper{ right: 14px; bottom: 14px; }
  .dfw-panel{ width: 280px; }
}
