/* ============================================================
   Birdcom WhatsApp Widget — birdwhatsapp.css v1.0.0
   Prefijo: birdwa-   |   Root ID: #birdwa-root
   Temas: circle | circle-pill | square | square-pill
   ============================================================ */

/* ── Root container ─────────────────────────────────────── */
#birdwa-root {
  position: fixed;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Variables con defaults; el JS las sobreescribe según config */
  --birdwa-color: #25d366;
  --birdwa-offset-x: 25px;
  --birdwa-offset-y: 25px;
}

/* Posicionamiento según data-position */
#birdwa-root[data-position="bottom-right"] {
  bottom: var(--birdwa-offset-y);
  right: var(--birdwa-offset-x);
  align-items: flex-end;
}
#birdwa-root[data-position="bottom-left"] {
  bottom: var(--birdwa-offset-y);
  left: var(--birdwa-offset-x);
  align-items: flex-start;
}
#birdwa-root[data-position="top-right"] {
  top: var(--birdwa-offset-y);
  right: var(--birdwa-offset-x);
  align-items: flex-end;
}
#birdwa-root[data-position="top-left"] {
  top: var(--birdwa-offset-y);
  left: var(--birdwa-offset-x);
  align-items: flex-start;
}

/* Temas cuadrado: siempre pegados al borde (offset 0) */
#birdwa-root[data-theme="square"],
#birdwa-root[data-theme="square-pill"] {
  --birdwa-offset-x: 0px;
  --birdwa-offset-y: 0px;
}

/*
 * Orden visual: el bocadillo está primero en el DOM (encima en flow).
 * Para posiciones "top-*" hay que poner el botón encima del bocadillo,
 * así que subimos el botón con order: -1.
 */
#birdwa-root[data-position^="top"] .birdwa-btn {
  order: -1;
}

/* ── Botón: base común ──────────────────────────────────── */
.birdwa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: var(--birdwa-color);
  color: #fff;
  text-decoration: none !important;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.15s ease;
}
.birdwa-btn:hover,
.birdwa-btn:focus {
  color: #fff;
  text-decoration: none !important;
}
.birdwa-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.75);
  outline-offset: 3px;
}
.birdwa-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.birdwa-btn__icon svg {
  display: block;
}
.birdwa-btn__text {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
}

/* ── Tema: circle ───────────────────────────────────────── */
#birdwa-root[data-theme="circle"] .birdwa-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
#birdwa-root[data-theme="circle"] .birdwa-btn:hover {
  transform: scale(1.09);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.28);
}
#birdwa-root[data-theme="circle"] .birdwa-btn__icon svg {
  width: 32px;
  height: 32px;
}

/* ── Tema: circle-pill ──────────────────────────────────── */
#birdwa-root[data-theme="circle-pill"] .birdwa-btn {
  height: 58px;
  border-radius: 29px; /* completamente redondeado = pill */
  padding: 0 22px 0 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
#birdwa-root[data-theme="circle-pill"] .birdwa-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
#birdwa-root[data-theme="circle-pill"] .birdwa-btn__icon svg {
  width: 28px;
  height: 28px;
}

/* ── Tema: square ───────────────────────────────────────── */
#birdwa-root[data-theme="square"] .birdwa-btn {
  width: 62px;
  height: 62px;
  border-radius: 0;
  box-shadow: none;
}
#birdwa-root[data-theme="square"] .birdwa-btn:hover {
  filter: brightness(1.12);
}
#birdwa-root[data-theme="square"] .birdwa-btn__icon svg {
  width: 30px;
  height: 30px;
}

/* ── Tema: square-pill ──────────────────────────────────── */
#birdwa-root[data-theme="square-pill"] .birdwa-btn {
  height: 56px;
  border-radius: 0;
  padding: 0 20px 0 14px;
  box-shadow: none;
}
#birdwa-root[data-theme="square-pill"] .birdwa-btn:hover {
  filter: brightness(1.12);
}
#birdwa-root[data-theme="square-pill"] .birdwa-btn__icon svg {
  width: 28px;
  height: 28px;
}

/* ── Bocadillo (tooltip) ────────────────────────────────── */
.birdwa-tooltip {
  position: relative;
  background: #fff;
  color: #333;
  padding: 12px 30px 12px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  max-width: 230px;
  /* Oculto por defecto; JS lo activa */
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.birdwa-tooltip--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.birdwa-tooltip__text {
  margin: 0;
  padding: 0;
}

/* Botón de cierre del bocadillo */
.birdwa-tooltip__close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  color: #bbb;
  font-size: 14px;
  line-height: 1;
  transition: color 0.15s;
}
.birdwa-tooltip__close:hover {
  color: #555;
}

/*
 * Flechas del bocadillo
 * — bottom-* : bocadillo está ENCIMA del botón → flecha apunta HACIA ABAJO
 * — top-*    : bocadillo está DEBAJO del botón → flecha apunta HACIA ARRIBA
 */
.birdwa-tooltip::after {
  content: "";
  position: absolute;
  border: 7px solid transparent;
}

/* Posiciones bottom: flecha abajo */
#birdwa-root[data-position^="bottom"] .birdwa-tooltip::after {
  bottom: -6px;
  border-top-color: #fff;
  border-bottom: none;
}
#birdwa-root[data-position="bottom-right"] .birdwa-tooltip::after {
  right: 24px;
}
#birdwa-root[data-position="bottom-left"] .birdwa-tooltip::after {
  left: 20px;
}

/* Posiciones top: flecha arriba */
#birdwa-root[data-position^="top"] .birdwa-tooltip::after {
  top: -6px;
  border-bottom-color: #fff;
  border-top: none;
}
#birdwa-root[data-position="top-right"] .birdwa-tooltip::after {
  right: 20px;
}
#birdwa-root[data-position="top-left"] .birdwa-tooltip::after {
  left: 20px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Bocadillo: oculto en móvil */
  .birdwa-tooltip {
    display: none !important;
  }

  /* Temas pill: colapsan al icono en móvil */
  #birdwa-root[data-theme="circle-pill"] .birdwa-btn,
  #birdwa-root[data-theme="square-pill"] .birdwa-btn {
    gap: 0;
    padding: 0;
  }
  #birdwa-root[data-theme="circle-pill"] .birdwa-btn {
    width: 58px;
    border-radius: 50%;
    justify-content: center;
  }
  #birdwa-root[data-theme="square-pill"] .birdwa-btn {
    width: 58px;
    justify-content: center;
  }
  .birdwa-btn__text {
    display: none;
  }
}
