/* ==========================================
   RN TOLDOS — WHATSAPP FLUTUANTE
========================================== */

#rn-whatsapp-widget {
  font-family: Arial, Helvetica, sans-serif;
  position: relative;
  z-index: 999999;
}

/* BOTÃO FLUTUANTE */

#rn-whatsapp-toggle {
  position: fixed !important;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border: none !important;
  border-radius: 50% !important;
  background: #25d366 !important;
  color: #fff !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 8px !important;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 999999 !important;
}

#rn-whatsapp-toggle:hover {
  background: #1ebe5d !important;
  transform: scale(1.06);
}

#rn-whatsapp-toggle svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* JANELA POP-UP */

#rn-whatsapp-popup {
  position: fixed !important;
  right: 22px;
  bottom: 94px;
  width: 330px;
  max-width: calc(100vw - 28px);
  background: #efeae2;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  z-index: 999998 !important;
}

#rn-whatsapp-popup.rn-wa-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* CABEÇALHO */

.rn-wa-header {
  background: #075e54;
  color: #fff;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.rn-wa-avatar {
  width: 40px;
  height: 40px;
  background: #fff;
  color: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rn-wa-avatar svg {
  width: 25px;
  height: 25px;
}

.rn-wa-identification {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.rn-wa-identification strong {
  font-size: 15px;
  color: #fff;
}

.rn-wa-identification span {
  font-size: 12px;
  color: #d8f5e9;
}

.rn-wa-close {
  border: none !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
  padding: 0 3px;
}

/* STATUS ONLINE / OFFLINE */

.rn-wa-status {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rn-wa-status i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rn-wa-status.rn-wa-online i {
  background: #25d366;
  box-shadow: 0 0 5px rgba(37, 211, 102, 0.5);
}

.rn-wa-status.rn-wa-offline i {
  background: #ff8a8a;
}

.rn-wa-status.rn-wa-offline {
  color: #ffe0e0;
}

/* MENSAGEM */

.rn-wa-content {
  padding: 18px 13px;
  min-height: 205px;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 14px 14px;
}

.rn-wa-date {
  text-align: center;
  color: #4b5a61;
  font-size: 10px;
  margin-bottom: 13px;
}

.rn-wa-message {
  position: relative;
  background: #fff;
  padding: 13px 12px 23px;
  border-radius: 0 10px 10px 10px;
  color: #303b40;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.rn-wa-message strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #263238;
  margin-bottom: 8px;
}

.rn-wa-message p {
  margin: 0 0 9px;
  color: #38474e;
  font-size: 13px;
}

.rn-wa-message p:last-of-type {
  margin-bottom: 0;
}

.rn-wa-time {
  position: absolute;
  right: 10px;
  bottom: 5px;
  font-size: 10px;
  color: #5c6a70;
}

/* RODAPÉ */

.rn-wa-footer {
  background: #f7f7f7;
  padding: 12px;
}

.rn-wa-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  background: #128c4b;
  color: #fff !important;
  border-radius: 25px;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.rn-wa-start:hover {
  background: #0f7440;
  color: #fff !important;
}

.rn-wa-start svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.rn-wa-hours {
  text-align: center;
  margin-top: 10px;
  color: #4b5a61;
  font-size: 10px;
  line-height: 1.4;
}

/* FOCO VISÍVEL */

#rn-whatsapp-toggle:focus-visible,
.rn-wa-close:focus-visible,
.rn-wa-start:focus-visible {
  outline: 3px solid #0b3d36;
  outline-offset: 3px;
}

/* RESPONSIVIDADE */

@media (max-width: 480px) {
  #rn-whatsapp-toggle {
    right: 16px;
    bottom: 16px;
    width: 54px;
    height: 54px;
  }

  #rn-whatsapp-popup {
    right: 14px;
    bottom: 82px;
    width: 330px;
    max-width: calc(100vw - 28px);
  }
}

/* ACESSIBILIDADE */

@media (prefers-reduced-motion: reduce) {
  #rn-whatsapp-popup,
  #rn-whatsapp-toggle {
    transition: none;
  }
}
