/* =========================================================
   ESTRALIA · WHATSAPP WIDGET
   Botón fijo + panel ligero.
   ========================================================= */

:root {
  --wa-green: #25d366;
  --wa-green-hover: #1fbd5a;
  --wa-head: #159682;
  --wa-panel-bg: #efe6dc;
  --wa-text: #111111;
  --wa-muted: #555555;
  --wa-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.wa-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 12100;

  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;

  /*
    Importante:
    El contenedor NO debe capturar hover/click.
    Solo el botón y la ventana visible deben poder recibir eventos.
  */
  pointer-events: none;
}

.wa-button {
  width: 58px;
  height: 58px;

  display: grid;
  place-items: center;

  background: var(--wa-green);
  color: #ffffff;

  border-radius: 999px;
  box-shadow: var(--wa-shadow);

  text-decoration: none;

  pointer-events: auto;

  transition:
    background-color 0.2s ease,
    transform 0.18s ease,
    box-shadow 0.2s ease;
}

.wa-button:hover {
  background: var(--wa-green-hover);
  transform: translateY(-2px);
}

.wa-button:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.35);
  outline-offset: 4px;
}

.wa-button svg {
  width: 34px;
  height: 34px;
  display: block;
}

.wa-panel {
  width: min(300px, calc(100vw - 40px));

  overflow: hidden;

  background: var(--wa-panel-bg);
  color: var(--wa-text);

  border-radius: 8px;
  box-shadow: var(--wa-shadow);

  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);

  pointer-events: none;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;
}

/*
  El panel solo se abre cuando:
  - el cursor está encima del botón real de WhatsApp;
  - el panel ya está abierto y el cursor está sobre el propio panel;
  - en móvil, JS añade .is-open tras tocar el botón.
*/
.wa-widget:has(.wa-button:hover) .wa-panel,
.wa-widget:has(.wa-button:focus-visible) .wa-panel,
.wa-widget:has(.wa-panel:hover) .wa-panel,
.wa-widget.is-open .wa-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.wa-panel-head {
  min-height: 50px;
  padding: 12px 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  background: var(--wa-head);
  color: #ffffff;
}

.wa-panel-head strong {
  font-size: 0.98rem;
  font-weight: 700;
}

.wa-panel-close {
  display: none;
}

.wa-panel-body {
  padding: 14px;
}

.wa-panel-body p {
  margin: 0 0 12px;

  padding: 10px 12px;

  background: #ffffff;
  color: var(--wa-text);

  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);

  font-size: 0.92rem;
  line-height: 1.35;
  font-weight: 600;
}

.wa-panel-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 38px;
  padding: 0 14px;

  border-radius: 999px;

  background: #ffffff;
  color: var(--wa-muted);

  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;

  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);

  pointer-events: auto;

  transition:
    color 0.2s ease,
    transform 0.15s ease;
}

.wa-panel-cta:hover {
  color: var(--wa-head);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .wa-widget {
    right: 18px;
    bottom: 18px;
  }

  .wa-button {
    width: 56px;
    height: 56px;
  }

  .wa-panel {
    width: min(294px, calc(100vw - 28px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-button,
  .wa-panel,
  .wa-panel-cta {
    transition-duration: 0.001ms !important;
  }
}
/* TEMPORAL: WhatsApp oculto hasta autorización de publicación */
.wa-widget[data-wa-widget] {
  display: none !important;
}
