/* =========================================================================
   Floating WhatsApp chat widget ([wp_footer], all pages)

   Every rule below is scoped under the #cura-wa-chat id (not just the
   .cura-wa-chat class): the theme/Elementor ships a global default style
   for every bare <button> element (its own background/border/padding),
   and a plain class selector on <button> ties or loses to that rule's
   specificity depending on load order. An id always wins without needing
   !important, so every button in this widget is addressed through it.
   ========================================================================= */

#cura-wa-chat {
  position: fixed;
  z-index: 99999;
  right: 20px;
  bottom: 20px;
  font-family: 'Amiko', sans-serif;
}

#cura-wa-chat .cura-wa-fab {
  position: relative;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 18px;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: transform 0.15s ease;
}

#cura-wa-chat .cura-wa-fab:hover {
  transform: scale(1.06);
}

#cura-wa-chat .cura-wa-fab-icon-chat {
  width: 48px;
  height: 48px;
  display: block;
}

/* ---- Panel ------------------------------------------------------------ */

#cura-wa-chat .cura-wa-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: 340px;
  max-width: min(360px, calc(100vw - 32px));
  background: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(26, 41, 51, 0.28), 0 2px 8px rgba(26, 41, 51, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

#cura-wa-chat .cura-wa-panel[hidden] {
  display: flex;
}

#cura-wa-chat.is-open .cura-wa-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#cura-wa-chat .cura-wa-panel-head {
  position: relative;
  background: linear-gradient(135deg, #4E7A93 0%, #2F485B 100%);
  color: #FFFFFF;
  padding: 18px 44px 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  flex: none;
}

#cura-wa-chat .cura-wa-panel-head::after {
  content: '';
  position: absolute;
  pointer-events: none;
  right: -30px;
  top: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

#cura-wa-chat .cura-wa-panel-avatar {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

#cura-wa-chat .cura-wa-panel-avatar svg {
  width: 20px;
  height: 20px;
}

#cura-wa-chat .cura-wa-panel-head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

#cura-wa-chat #cura-wa-title {
  font-family: 'Sofia Sans Semi Condensed', 'Sofia Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}

#cura-wa-chat .cura-wa-panel-sub {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  gap: 5px;
}

#cura-wa-chat .cura-wa-panel-sub::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
}

#cura-wa-chat .cura-wa-panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: background 0.15s ease;
}

#cura-wa-chat .cura-wa-panel-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

#cura-wa-chat .cura-wa-panel-body {
  padding: 16px 14px;
  background: #F1F5F9;
  background-image: radial-gradient(circle at 100% 0%, rgba(115, 177, 221, 0.12), transparent 55%);
  min-height: 100px;
  max-height: min(300px, 45vh);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}

#cura-wa-chat .cura-wa-bubble {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  animation: cura-wa-pop 0.18s ease;
}

@keyframes cura-wa-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#cura-wa-chat .cura-wa-bubble-in {
  align-self: flex-start;
  background: #FFFFFF;
  color: #223542;
  box-shadow: 0 2px 6px rgba(26, 41, 51, 0.08);
  border-bottom-left-radius: 4px;
}

#cura-wa-chat .cura-wa-bubble-out {
  align-self: flex-end;
  background: linear-gradient(135deg, #4E7A93, #2F485B);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

#cura-wa-chat .cura-wa-panel-foot {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #E4E9EF;
  background: #FFFFFF;
  flex: none;
}

#cura-wa-chat .cura-wa-panel-foot textarea {
  flex: 1 1 auto;
  resize: none;
  border: 1.5px solid #DCE4EA;
  background: #F7FAFC;
  border-radius: 16px;
  padding: 10px 14px;
  margin: 0;
  font-family: inherit;
  font-size: 13.5px;
  max-height: 90px;
  color: #1A2933;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease;
}

#cura-wa-chat .cura-wa-panel-foot textarea:focus {
  outline: none;
  border-color: #73B1DD;
  background: #FFFFFF;
}

#cura-wa-chat .cura-wa-panel-foot button {
  flex: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #4E7A93, #2F485B);
  color: #FFFFFF;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.15s ease, background 0.15s ease;
}

#cura-wa-chat .cura-wa-panel-foot button svg {
  width: 18px;
  height: 18px;
}

#cura-wa-chat .cura-wa-panel-foot button:not(:disabled):hover {
  transform: scale(1.08);
}

#cura-wa-chat .cura-wa-panel-foot button:disabled {
  background: #DCE4EA;
  color: #8E99A1;
  cursor: default;
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 600px) {
  #cura-wa-chat {
    right: 14px;
    bottom: 14px;
  }

  #cura-wa-chat .cura-wa-panel {
    width: calc(100vw - 28px);
    bottom: 70px;
  }

  #cura-wa-chat .cura-wa-panel-body {
    max-height: min(280px, 42vh);
  }
}

@media (max-width: 360px) {
  #cura-wa-chat .cura-wa-fab,
  #cura-wa-chat .cura-wa-fab-icon-chat {
    width: 44px;
    height: 44px;
  }

  #cura-wa-chat .cura-wa-panel {
    bottom: 62px;
  }

  #cura-wa-chat #cura-wa-title {
    font-size: 14.5px;
  }

  #cura-wa-chat .cura-wa-panel-sub {
    font-size: 10.5px;
  }
}

@media (max-height: 560px) {
  #cura-wa-chat .cura-wa-panel-body {
    max-height: 34vh;
  }
}
