.pi-widget {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 10001;
  width: 280px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  font-family: "Montserrat", "Open Sans", "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: #0f172a;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(110%);
}

.pi-widget.is-in {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.pi-widget * {
  box-sizing: border-box;
}

.pi-card {
  position: relative;
  width: 100%;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
  padding: 10px 10px 8px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.pi-widget.is-closed .pi-card {
  display: none;
}

.pi-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-right: 24px;
}

img.pi-logo {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: transparent;
  box-shadow: none;
  display: block;
}

.pi-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  color: #0f172a;
}

.pi-tag {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.3;
  color: #8b95a7;
  font-weight: 500;
}

.pi-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.pi-close svg {
  width: 14px;
  height: 14px;
  display: block;
}

.pi-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pi-body {
  margin-top: 8px;
}

.pi-widget h3 {
  margin: 0;
  padding: 0;
  font-family: "Montserrat", "Open Sans", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.28;
  color: #0f172a;
}

.pi-widget p {
  margin: 6px 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
  font-weight: 400;
}

.pi-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.pi-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  color: #334155;
}

.pi-feature i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef4ff;
  color: #2f6fed;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pi-feature svg {
  width: 14px;
  height: 14px;
  display: block;
}

.pi-rupee {
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  font-family: "Segoe UI", Arial, sans-serif;
}

.pi-widget .pi-cta,
.pi-widget .pi-cta:hover,
.pi-widget .pi-cta:focus,
.pi-widget .pi-cta:active,
.pi-widget .pi-cta:visited {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  width: 100%;
  min-height: 36px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #0c1b33;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background 0.2s ease;
}

.pi-widget .pi-cta:hover {
  background: #163056;
}

.pi-dock {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  align-self: flex-end;
}

.pi-dock .whatsapp-float,
.pi-dock .back-to-top {
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  top: auto !important;
  margin: 0;
  flex: 0 0 auto;
}

.pi-widget > .whatsapp-float {
  position: relative;
  right: auto;
  bottom: auto;
  left: auto;
  flex: 0 0 auto;
  z-index: 1;
}

.pi-launcher {
  display: none;
  width: 48px;
  height: 48px;
  margin-left: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(47, 111, 237, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pi-launcher svg {
  width: 22px;
  height: 22px;
}

.pi-widget.is-closed .pi-launcher {
  display: flex;
}

.pi-launcher:hover {
  box-shadow: 0 10px 24px rgba(47, 111, 237, 0.45);
}

.pi-close:focus-visible,
.pi-launcher:focus-visible,
.pi-widget .pi-cta:focus-visible {
  outline: 2px solid #2f6fed;
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .pi-widget {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    width: min(280px, calc(100vw - 24px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .pi-widget,
  .pi-widget.is-in,
  .pi-card,
  .pi-launcher,
  .pi-dock .whatsapp-float {
    transition: none;
    transform: none;
  }
}
