/* Offer popup — boarding-pass motif (Wiedererkennung) */

/* Mobile-first: dünne Leiste rechts zum manuellen Öffnen */
.offer-rail-trigger {
  --rail-amber: #e8a23a;
  --rail-coral: #e85d4c;
  --rail-ink: #1a1208;
  position: fixed;
  z-index: 45;
  top: 50%;
  right: 0;
  left: auto;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  min-height: 9.5rem;
  max-height: min(62vh, 18rem);
  padding: 0.85rem 0.15rem;
  margin: 0;
  border: 0;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(
    180deg,
    var(--rail-coral) 0%,
    #f0a33a 42%,
    var(--rail-amber) 100%
  );
  color: var(--rail-ink);
  box-shadow:
    -3px 0 18px rgba(232, 93, 76, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  padding-right: max(0.15rem, env(safe-area-inset-right, 0px));
}

.offer-rail-trigger__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.28),
    transparent 40%,
    rgba(0, 0, 0, 0.08)
  );
  pointer-events: none;
}

.offer-rail-trigger__text {
  position: relative;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-family: var(--font-display, Literata, Georgia, serif);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  max-height: min(56vh, 16.5rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

.offer-rail-trigger:hover,
.offer-rail-trigger:focus-visible {
  filter: brightness(1.06);
  box-shadow:
    -5px 0 22px rgba(232, 93, 76, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  outline: none;
}

.offer-rail-trigger:focus-visible {
  box-shadow:
    -5px 0 22px rgba(232, 93, 76, 0.45),
    0 0 0 3px rgba(12, 28, 36, 0.35);
}

.offer-rail-trigger.is-hidden,
.offer-rail-trigger[hidden] {
  display: none !important;
}

@media (min-width: 640px) {
  .offer-rail-trigger {
    width: 2.35rem;
    min-height: 12rem;
    max-height: min(70vh, 22rem);
    padding: 1rem 0.2rem;
  }

  .offer-rail-trigger__text {
    font-size: 0.78rem;
    max-height: min(64vh, 20rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .offer-rail-trigger {
    transition: none;
  }
}

.offer-popup {
  --offer-ink: #0c1c24;
  --offer-sea: #2f6f7e;
  --offer-sea-deep: #1f4f5a;
  --offer-amber: #b8873b;
  --offer-paper: #fffdf8;
  border: 0;
  padding: 0;
  margin: auto;
  max-width: min(34rem, calc(100vw - 1rem));
  max-height: min(100dvh, 100vh);
  width: calc(100% - 0.75rem);
  background: transparent;
  color: var(--offer-ink);
  overflow: visible;
}

.offer-popup::backdrop {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(47, 111, 126, 0.28), transparent 55%),
    rgba(12, 28, 36, 0.58);
  backdrop-filter: blur(3px);
  animation: offer-backdrop-in 0.35s ease-out;
}

.offer-popup[open] {
  animation: offer-dialog-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.offer-popup__ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1.85rem minmax(0, 1fr) 3.25rem;
  max-height: min(92dvh, 92vh);
  background: var(--offer-paper);
  border-radius: 14px;
  box-shadow:
    0 22px 55px rgba(12, 28, 36, 0.35),
    0 0 0 1px rgba(47, 111, 126, 0.18);
  overflow: hidden;
}

.offer-popup__ticket::before,
.offer-popup__ticket::after {
  content: "";
  position: absolute;
  inset-inline: 1.85rem 3.25rem;
  height: 12px;
  background:
    radial-gradient(circle at 6px 0, transparent 6px, var(--offer-paper) 7px) 0 0 / 12px 12px repeat-x;
  pointer-events: none;
  z-index: 1;
}

@media (min-width: 480px) {
  .offer-popup__ticket::before,
  .offer-popup__ticket::after {
    inset-inline: 2.35rem 4.1rem;
  }
}

.offer-popup__ticket::before {
  top: -1px;
  transform: scaleY(-1);
}

.offer-popup__ticket::after {
  bottom: -1px;
}

.offer-popup__close {
  position: absolute;
  top: 0.5rem;
  /* Nach dem teal Rail, oben in der Ticket-Fläche */
  inset-inline-start: 2.7rem;
  z-index: 3;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 28, 36, 0.08);
  color: var(--offer-ink);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.offer-popup__close.is-hidden,
.offer-popup__close[hidden] {
  display: none !important;
}

.offer-popup__close.is-counting {
  cursor: default;
  pointer-events: none;
  background: rgba(47, 111, 126, 0.14);
  color: var(--offer-sea-deep);
  font-family: var(--font-display, Literata, Georgia, serif);
  font-size: 1.05rem;
  font-weight: 800;
  animation: offer-count-pulse 1s ease-in-out infinite;
}

.offer-popup__close.is-ready:hover {
  background: rgba(12, 28, 36, 0.14);
  transform: scale(1.05);
}

/* RTL: Zurück = Pfeil nach rechts, gegenüber vom × */
.offer-popup__nav-back {
  position: absolute;
  top: 0.5rem;
  inset-inline-end: 4.5rem;
  z-index: 3;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 28, 36, 0.08);
  color: var(--offer-ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.offer-popup__nav-back:hover:not(:disabled) {
  background: rgba(12, 28, 36, 0.14);
  transform: scale(1.05);
}

.offer-popup__nav-back[hidden] {
  display: none !important;
}

.offer-popup__back-arrow {
  margin-inline-start: 0.35rem;
  font-size: 1.05rem;
}

.offer-popup--voice .offer-popup__back {
  margin-top: 0.55rem;
}

.offer-popup__close-count,
.offer-popup__close-x {
  display: none;
  line-height: 1;
}

.offer-popup__close.is-counting .offer-popup__close-count,
.offer-popup__close.is-ready .offer-popup__close-x {
  display: inline;
}

@keyframes offer-count-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .offer-popup__close.is-counting {
    animation: none;
  }
}

.offer-popup__rail {
  background: linear-gradient(180deg, var(--offer-sea-deep), var(--offer-sea));
  color: #e8f4f6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.2rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.offer-popup__rail-dots {
  flex: 1;
  width: 2px;
  margin: 0.55rem 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 253, 249, 0.7) 0 3px,
    transparent 3px 8px
  );
}

.offer-popup__rail-code {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.offer-popup__body {
  position: relative;
  padding: 1.1rem 0.85rem 1rem;
  text-align: center;
  min-width: 0;
  max-height: min(92dvh, 92vh);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.offer-popup__brand {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--offer-sea-deep);
  letter-spacing: 0.02em;
}

.offer-popup__stamp {
  position: absolute;
  top: 1.1rem;
  inset-inline-end: 0.7rem;
  width: 3.6rem;
  height: 3.6rem;
  border: 2px solid rgba(184, 135, 59, 0.75);
  border-radius: 50%;
  color: rgba(143, 103, 40, 0.9);
  font-family: var(--font-display, Literata, Georgia, serif);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-12deg);
  opacity: 0.92;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(184, 135, 59, 0.25);
  animation: offer-stamp-in 0.55s 0.2s both cubic-bezier(0.22, 1, 0.36, 1);
}

.offer-popup__title {
  margin: 0.35rem 0 0.55rem;
  font-family: var(--font-display, Literata, Georgia, serif);
  font-size: clamp(1.15rem, 3.6vw, 1.35rem);
  line-height: 1.45;
  color: var(--offer-ink);
  padding-inline-end: 2.2rem;
}

.offer-popup__lead {
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  line-height: 1.75;
  color: #4a5c66;
}

.offer-popup__chips {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  text-align: start;
}

.offer-popup__chips li {
  display: grid;
  grid-template-columns: minmax(5.75rem, max-content) 1fr;
  gap: 0.55rem;
  align-items: center;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  background: rgba(47, 111, 126, 0.07);
  border: 1px solid rgba(47, 111, 126, 0.12);
}

.offer-popup__chip-key {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--offer-sea-deep);
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.3;
}

.offer-popup__chip-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--offer-ink);
  line-height: 1.4;
}

.offer-popup__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #c9984a, var(--offer-amber) 40%, #8f6728);
  color: var(--offer-ink);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(184, 135, 59, 0.28);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.offer-popup__cta:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.offer-popup__lead-form {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 0.35rem;
}

.offer-popup__field {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  text-align: right;
}

.offer-popup__field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #5a6a72;
}

.offer-popup__field input {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(12, 28, 36, 0.16);
  border-radius: 10px;
  background: #fff;
  color: var(--offer-ink, #0c1c24);
  font: inherit;
  font-size: 0.95rem;
}

.offer-popup__field input:focus {
  outline: none;
  border-color: rgba(47, 111, 126, 0.55);
  box-shadow: 0 0 0 2px rgba(47, 111, 126, 0.12);
}

.offer-popup__hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.offer-popup__back {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(12, 28, 36, 0.18);
  border-radius: 12px;
  background: transparent;
  color: var(--offer-ink, #0c1c24);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.offer-popup__back:hover {
  background: rgba(12, 28, 36, 0.04);
}

.offer-popup__lead-error {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #8a3d3d;
}

.offer-popup__lead-ok {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #2f6b4a;
}

.offer-popup__cta:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  color: var(--offer-ink);
}

.offer-popup__cta-arrow {
  font-size: 1.05rem;
  transition: transform 0.2s ease;
}

.offer-popup__cta:hover .offer-popup__cta-arrow {
  transform: translateX(-3px);
}

.offer-popup__fine {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  line-height: 1.55;
  color: #6a7a82;
}

/* Popup 2: Sprachnachrichten-Mix */
.offer-popup__audio {
  margin: 0 0 1rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(12, 28, 36, 0.1);
  border-radius: 12px;
  background: rgba(12, 28, 36, 0.03);
  text-align: center;
}

.offer-popup__audio-visual {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.28rem;
  height: 2.2rem;
  margin: 0 0 0.55rem;
}

.offer-popup__audio-visual span {
  display: block;
  width: 0.28rem;
  height: 0.45rem;
  border-radius: 2px;
  background: rgba(47, 111, 126, 0.45);
}

.offer-popup.is-playing .offer-popup__audio-visual span {
  animation: offer-voice-bar 0.9s ease-in-out infinite;
  background: rgba(47, 111, 126, 0.75);
}

.offer-popup.is-playing .offer-popup__audio-visual span:nth-child(2) {
  animation-delay: 0.12s;
}
.offer-popup.is-playing .offer-popup__audio-visual span:nth-child(3) {
  animation-delay: 0.24s;
}
.offer-popup.is-playing .offer-popup__audio-visual span:nth-child(4) {
  animation-delay: 0.36s;
}
.offer-popup.is-playing .offer-popup__audio-visual span:nth-child(5) {
  animation-delay: 0.48s;
}

@keyframes offer-voice-bar {
  0%,
  100% {
    height: 0.4rem;
  }
  50% {
    height: 1.7rem;
  }
}

.offer-popup__audio-status {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: #4a5c64;
  line-height: 1.5;
}

.offer-popup__audio-play {
  margin-top: 0.65rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(12, 28, 36, 0.2);
  border-radius: 10px;
  background: #fff;
  color: var(--offer-ink, #0c1c24);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.offer-popup__audio-play:hover {
  background: rgba(12, 28, 36, 0.04);
}

@media (prefers-reduced-motion: reduce) {
  .offer-popup.is-playing .offer-popup__audio-visual span {
    animation: none;
    height: 0.9rem;
  }
}

.offer-popup__stub {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(12, 28, 36, 0.04) 0 2px,
      transparent 2px 5px
    ),
    linear-gradient(180deg, #f3ebe0, #ebe2d4);
  border-inline-start: 1.5px dashed rgba(12, 28, 36, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 0.35rem;
}

.offer-popup__stub-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--offer-sea-deep);
}

.offer-popup__stub-num {
  font-family: var(--font-display, Literata, Georgia, serif);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--offer-ink);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.12em;
}

.offer-popup__barcode {
  width: 1.15rem;
  height: 3.4rem;
  margin-top: 0.35rem;
  background: repeating-linear-gradient(
    90deg,
    #0c1c24 0 1px,
    transparent 1px 3px,
    #0c1c24 3px 4px,
    transparent 4px 7px
  );
  opacity: 0.55;
}

@keyframes offer-dialog-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes offer-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes offer-stamp-in {
  from {
    opacity: 0;
    transform: rotate(-28deg) scale(1.25);
  }
  to {
    opacity: 0.92;
    transform: rotate(-12deg) scale(1);
  }
}

@media (min-width: 480px) {
  .offer-popup {
    max-width: min(34rem, calc(100vw - 1.5rem));
    width: 100%;
  }

  .offer-popup__ticket {
    grid-template-columns: 2.35rem minmax(0, 1fr) 4.1rem;
  }

  .offer-popup__body {
    padding: 1.35rem 1.1rem 1.15rem;
  }
}

@media (max-width: 379px) {
  .offer-popup__ticket {
    grid-template-columns: 1.55rem minmax(0, 1fr) 2.75rem;
  }

  .offer-popup__stamp {
    width: 2.85rem;
    height: 2.85rem;
    font-size: 0.58rem;
    top: 0.85rem;
    inset-inline-end: 0.45rem;
  }

  .offer-popup__title {
    font-size: clamp(1.02rem, 4.6vw, 1.2rem);
    padding-inline-end: 1.35rem;
  }

  .offer-popup__chips li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .offer-popup__chip-key {
    white-space: normal;
  }

  .offer-popup__close {
    inset-inline-start: 1.85rem;
    width: 2rem;
    height: 2rem;
  }

  .offer-popup__nav-back {
    inset-inline-end: 3.1rem;
    width: 2rem;
    height: 2rem;
  }
}

@media (max-width: 420px) {
  .offer-popup__stamp {
    width: 3.1rem;
    height: 3.1rem;
    font-size: 0.64rem;
  }

  .offer-popup__title {
    padding-inline-end: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .offer-popup[open],
  .offer-popup::backdrop,
  .offer-popup__stamp {
    animation: none;
  }
}
