.cyn-popup-root {
  position: fixed;
  z-index: 2147483647 !important;
  isolation: isolate;

  width: auto;
  max-width: calc(100vw - 40px);
}

/* LEFT / RIGHT */
.cyn-popup-root.left {
  left: 20px;
}
.cyn-popup-root.right {
  right: 20px;
}

.cyn-popup-wrapper {
  position: relative;
}

/* =========================
   BUTTON
========================= */

.cyn-btn {
  position: relative;
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 14px 18px;
  border-radius: 50px;
  cursor: pointer;

  white-space: nowrap;
  overflow: visible;

  transition: transform 0.2s ease;
}

/* Hover */
.cyn-btn:hover {
  transform: scale(1.05);
}

/* Circle */
.cyn-btn-circle {
  width: 56px;
  height: 56px;
  padding: 0;

  border-radius: 50%;
}

/* =========================
   ICON / MORPH SYSTEM
========================= */

.cyn-btn-icon,
.cyn-btn-close-icon {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: all 0.25s ease;
}

/* Image fix */
.cyn-btn-img {
  width: 60%;
  height: 60%;
  object-fit: contain;
  display: block;
}

/* Close Icon initial */
.cyn-btn-close-icon {
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
}

/* OPEN STATE */
.cyn-btn.is-open .cyn-btn-icon {
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
}

.cyn-btn.is-open .cyn-btn-close-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* =========================
   BADGE
========================= */

.cyn-badge {
  position: absolute;
  top: 0;
  right: 0;

  transform: translate(35%, -35%);

  background: red;
  color: #fff;

  font-size: 11px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;

  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 5;
}

/* =========================
   POPUP
========================= */

.cyn-box {
  position: absolute;
  z-index: 1;

  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;

  width: 260px;
  max-width: calc(100vw - 40px);

  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);

  transition: all 0.25s ease;
}

/* sichtbar */
.cyn-box.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Horizontal */
.cyn-popup-root.right .cyn-box {
  right: 0;
}

.cyn-popup-root.left .cyn-box {
  left: 0;
}

/* Vertical */
.cyn-dir-up .cyn-box {
  bottom: 100%;
  margin-bottom: 10px;
}

.cyn-dir-down .cyn-box {
  top: 100%;
  margin-top: 10px;
}

/* =========================
   HEADER / ACTIONS
========================= */

.cyn-header {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.cyn-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.cyn-actions a {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  text-decoration: none;

  border-radius: 8px;
  background: #f5f5f5;

  white-space: nowrap;
}

.cyn-actions a i {
  width: 18px;
  text-align: center;
}

/* =========================
   ANIMATIONEN
========================= */

/* Fade */
.cyn-popup-root[data-animation="fade"] .cyn-box {
  transform: scale(0.95);
}

.cyn-popup-root[data-animation="fade"] .cyn-box.is-open {
  transform: scale(1);
}

/* None */
.cyn-popup-root[data-animation="none"] .cyn-box {
  transition: none;
  transform: none;
}

/* Pulse */
@keyframes cynPulse {
  0% {
    box-shadow: 0 0 0 0 var(--cyn-pulse);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(0, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

.cyn-btn.pulse {
  animation: cynPulse 2s infinite;
}

/* Rotation */
@keyframes cynRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.cyn-btn.is-rotating {
  animation: cynRotate 0.6s ease;
}
