/* Orisun WhatsApp Widget */
.orisun-wa-widget {
  --wa-brand: #4DC247;
  --wa-brand-dark: #3da838;
  --wa-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  font-family: "Open Sans", sans-serif;
}

.orisun-wa-trigger-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.orisun-wa-widget.orisun-wa--open .orisun-wa-trigger-wrap {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
}

.orisun-wa-trigger-msg {
  background: #fff;
  color: #333;
  padding: 10px 16px;
  border-radius: 12px 12px 4px 12px;
  box-shadow: var(--wa-shadow);
  font-size: 14px;
  font-weight: 600;
  max-width: 200px;
  line-height: 1.4;
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.orisun-wa-widget.orisun-wa--hint .orisun-wa-trigger-msg {
  opacity: 1;
  transform: translateX(0);
}

.orisun-wa-trigger {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--wa-brand);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(77, 194, 71, 0.45);
  transition: transform 0.2s ease, background 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.orisun-wa-trigger:hover {
  background: var(--wa-brand-dark);
  transform: scale(1.06);
}

.orisun-wa-trigger svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.orisun-wa-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wa-brand);
  animation: orisun-wa-pulse 2s ease-out infinite;
  z-index: -1;
}

@keyframes orisun-wa-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.orisun-wa-panel {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #f0f2f5;
  border-radius: 16px;
  box-shadow: var(--wa-shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, bottom 0.3s ease;
  display: flex;
  flex-direction: column;
}

.orisun-wa-widget.orisun-wa--open .orisun-wa-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  bottom: 0;
}

.orisun-wa-header {
  background: linear-gradient(135deg, var(--wa-brand) 0%, var(--wa-brand-dark) 100%);
  color: #fff;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}

.orisun-wa-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: #fff;
  flex-shrink: 0;
}

.orisun-wa-header-text {
  flex: 1;
  min-width: 0;
  padding-right: 4px;
}

.orisun-wa-header-text h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.orisun-wa-header-text p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.92;
  line-height: 1.35;
}

.orisun-wa-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  margin-top: 4px;
}

.orisun-wa-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a8f0a4;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.orisun-wa-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
  margin-top: -2px;
}

.orisun-wa-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.orisun-wa-body {
  padding: 16px 16px 8px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.orisun-wa-body::-webkit-scrollbar {
  width: 5px;
}

.orisun-wa-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
}

.orisun-wa-bubble {
  background: #fff;
  border-radius: 0 12px 12px 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  margin-bottom: 14px;
}

.orisun-wa-bubble strong {
  display: block;
  margin-bottom: 4px;
  color: #111;
}

.orisun-wa-options-label {
  font-size: 12px;
  color: #666;
  margin: 0 0 10px;
  font-weight: 600;
}

.orisun-wa-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.orisun-wa-option {
  background: #fff;
  border: 1.5px solid var(--wa-brand);
  color: var(--wa-brand-dark);
  border-radius: 20px;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  text-align: center;
  line-height: 1.3;
}

.orisun-wa-option:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 50%;
  justify-self: center;
}

.orisun-wa-option:hover {
  background: var(--wa-brand);
  color: #fff;
  transform: translateY(-1px);
}

.orisun-wa-footer {
  padding: 10px 16px 14px;
  background: #f0f2f5;
  flex-shrink: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.orisun-wa-compose {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  border-radius: 24px;
  padding: 6px 6px 6px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.orisun-wa-compose input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  min-width: 0;
}

.orisun-wa-send {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--wa-brand);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.orisun-wa-send:hover {
  background: var(--wa-brand-dark);
}

.orisun-wa-send svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.orisun-wa-widget.orisun-wa--open .orisun-wa-pulse {
  display: none;
}

@media (max-width: 480px) {
  .orisun-wa-widget {
    bottom: 16px;
    right: 16px;
  }

  .orisun-wa-panel {
    width: calc(100vw - 32px);
  }

  .orisun-wa-trigger-msg {
    max-width: 160px;
    font-size: 13px;
  }

  .orisun-wa-options {
    grid-template-columns: 1fr;
  }

  .orisun-wa-option:last-child:nth-child(odd) {
    max-width: none;
    justify-self: stretch;
  }
}
