/* Widget WhatsApp flutuante (include /includes/whatsapp.asp) */

.wa-fab {
  position: fixed;
  z-index: 99999;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 0;
}

.wa-fab img {
  height: 50px;
  width: 50px;
  display: block;
}

.wa-panel {
  position: fixed;
  z-index: 99999;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(78px, calc(env(safe-area-inset-bottom, 0px) + 78px));
  width: min(290px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: none;
  font-family: Lato, Arial, sans-serif;
  box-sizing: border-box;
}

.wa-panel.is-open {
  display: block;
}

.wa-panel-header {
  background: #0b3d66;
  color: #fff;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
}

.wa-panel-body {
  padding: 10px 12px 12px;
  max-height: min(50vh, 320px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.wa-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #1f2937;
  background: #f3f4f6;
  font-size: 14px;
  font-weight: 600;
  box-sizing: border-box;
}

.wa-option:first-of-type {
  margin-top: 0;
}

.wa-option:hover {
  background: #e5e7eb;
  text-decoration: none;
  color: #1f2937;
}

.wa-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  flex: 0 0 10px;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.wa-unavailable {
  color: #4b5563;
  font-size: 14px;
  padding: 6px 2px;
}

.wa-loading,
.wa-empty {
  margin-top: 6px;
  color: #4b5563;
  font-size: 13px;
}

@media (max-width: 576px) {
  .wa-fab {
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  }

  .wa-fab img {
    height: 46px;
    width: 46px;
  }

  .wa-panel {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    width: auto;
    max-width: none;
    bottom: max(68px, calc(env(safe-area-inset-bottom, 0px) + 68px));
  }

  .wa-panel-header {
    font-size: 14px;
    padding: 10px 12px;
  }
}
