/**
 * wishlist.css — Gemeinsamer "Merken"-Button (Issue #19).
 *
 * Self-contained (vgl. LL-028): NUR eigene --wish-*-Werte, keine globalen
 * --c-*-Tokens (wirkt modulübergreifend auf booking/events/infrastructure/
 * packages, deren Token-Sets sich unterscheiden).
 *
 * Zwei Kontexte:
 *   .osttirol-wish--card   → runder Overlay-Button oben rechts auf der Karte
 *   .osttirol-wish--detail → flacher Button neben dem Detail-Titel
 */
:root {
  --wish-saved: #b51621;        /* Osttirol-Markenrot, gefülltes Herz = gemerkt */
  --wish-idle: #5a5f66;         /* neutrales Grau, Umriss-Herz = nicht gemerkt */
  --wish-bg: rgba(255, 255, 255, 0.92);
  --wish-bg-hover: #ffffff;
  --wish-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.osttirol-wish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  cursor: pointer;
  background: transparent;
  color: var(--wish-idle);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, transform 0.12s ease, background-color 0.15s ease;
}

.osttirol-wish:focus-visible {
  outline: 2px solid var(--wish-saved);
  outline-offset: 2px;
}

.osttirol-wish__icon {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Gemerkt: Herz gefüllt + Markenrot. */
.osttirol-wish.is-saved {
  color: var(--wish-saved);
}
.osttirol-wish.is-saved .osttirol-wish__icon {
  fill: var(--wish-saved);
  stroke: var(--wish-saved);
}

.osttirol-wish:active {
  transform: scale(0.9);
}

/* --- Karten-Overlay --------------------------------------------------- */
.osttirol-wish--card {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;                    /* über dem Karten-Link/Bild */
  /* Touch-Target >= 44px (UI-Checkliste) bei optisch kleinerem Kreis. */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--wish-bg);
  box-shadow: var(--wish-shadow);
}
.osttirol-wish--card:hover {
  background: var(--wish-bg-hover);
}

/* Karten-Wurzeln müssen positioniert sein, damit das Overlay sitzt
   (Badges sind dort i. d. R. bereits absolut — defensiv hier sichergestellt). */
.osttirol-card,
.ev-card,
.pk-card {
  position: relative;
}

/* --- Detail-Header ---------------------------------------------------- */
.osttirol-wish--detail {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: #ffffff;
  font: inherit;
  font-size: 14.4px;
  font-weight: 600;
  white-space: nowrap;
}
.osttirol-wish--detail:hover {
  background: rgba(181, 22, 33, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .osttirol-wish,
  .osttirol-wish:active {
    transition: none;
    transform: none;
  }
}

/* ======================================================================
   Schwebende Merkliste (Button + Panel), gebaut von wishlist.js.
   Self-contained: nur --wish-*-Werte; z-index aus der Token-Skala
   (--z-overlay/--z-modal) mit Fallback, falls tokens.css nicht geladen ist.
   Position anpassbar: --wish-fab-right / --wish-fab-bottom (z. B. um einem
   Chat-Button der Site auszuweichen).
   ====================================================================== */
:root {
  --wish-fab-right: 16px;
  --wish-fab-bottom: 16px;
  --wish-text: #1f2328;
  --wish-border: #d9dce0;
  --wish-surface: #ffffff;
  --wish-muted: #5a5f66;
}

.osttirol-wl__dock {
  position: fixed;
  right: var(--wish-fab-right);
  bottom: var(--wish-fab-bottom);
  z-index: var(--z-overlay, 600);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
/* Chat-Button der Site (Chatbase, unten rechts; Klasse setzt wishlist-widget.js): darueber stapeln. */
.osttirol-wl.has-chat .osttirol-wl__dock {
  right: 13px;
  bottom: calc(var(--wish-fab-bottom) + 64px);
}
.osttirol-wl__fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--wish-saved);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--wish-shadow);
  -webkit-tap-highlight-color: transparent;
}
.osttirol-wl__fab--cart {
  background: var(--wish-text);
}
.osttirol-wl__fab[hidden] {
  display: none;
}
.osttirol-wl__fab:focus-visible,
.osttirol-wl__close:focus-visible,
.osttirol-wl__remove:focus-visible,
.osttirol-wl__clear:focus-visible,
.osttirol-wl__link:focus-visible {
  outline: 2px solid var(--wish-saved);
  outline-offset: 2px;
}
.osttirol-wl__fab:focus-visible {
  outline-color: #ffffff;
  box-shadow: 0 0 0 4px var(--wish-saved);
}
.osttirol-wl__icon.osttirol-wl__icon--stroke {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
.osttirol-wl__icon {
  width: 26px;
  height: 26px;
  fill: #ffffff;
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-linejoin: round;
  pointer-events: none;
}
.osttirol-wl__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 11px;
  background: #ffffff;
  color: var(--wish-saved);
  border: 2px solid var(--wish-saved);
  font: 700 12px/18px sans-serif;
  text-align: center;
  pointer-events: none;
}
.osttirol-wl__fab.is-pulse {
  animation: osttirol-wl-pulse 0.9s ease-out 1;
}
@keyframes osttirol-wl-pulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.22); }
  60% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.osttirol-wl__backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay, 600);
  background: rgba(31, 35, 40, 0.4);
}
.osttirol-wl__backdrop[hidden],
.osttirol-wl__panel[hidden] {
  display: none;
}
.osttirol-wl__panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-modal, 700);
  display: flex;
  flex-direction: column;
  width: 400px;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--wish-surface);
  color: var(--wish-text);
  border-left: 1px solid var(--wish-border);
  font-size: 15px;
  line-height: 1.4;
}
.osttirol-wl__panel:focus {
  outline: none;
}
.osttirol-wl__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px 12px 20px;
  border-bottom: 1px solid var(--wish-border);
}
.osttirol-wl__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.osttirol-wl__close {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--wish-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.osttirol-wl__close:hover {
  background: #f1f2f3;
}
.osttirol-wl__list {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
}
.osttirol-wl__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--wish-border);
}
.osttirol-wl__img {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 2px;
  object-fit: cover;
  background: #f1f2f3;
}
.osttirol-wl__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.osttirol-wl__type {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wish-muted);
}
.osttirol-wl__link {
  color: var(--wish-text);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.osttirol-wl__link:hover {
  color: var(--wish-saved);
  text-decoration: underline;
}
.osttirol-wl__remove,
.osttirol-wl__clear {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--wish-border);
  border-radius: 2px;
  background: var(--wish-surface);
  color: var(--wish-text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.osttirol-wl__remove {
  flex: none;
  min-width: 44px;
}
.osttirol-wl__remove:hover,
.osttirol-wl__clear:hover {
  border-color: var(--wish-saved);
  color: var(--wish-saved);
}
.osttirol-wl__foot {
  padding: 12px 20px;
  border-top: 1px solid var(--wish-border);
}
.osttirol-wl__clear {
  width: 100%;
}

/* Der Chat-Button der Site liegt ueber dem Panel: Fussleiste davor freihalten. */
.osttirol-wl.has-chat .osttirol-wl__foot {
  padding-right: 88px;
}

/* Scroll der Seite sperren, solange das Panel offen ist. */
html.osttirol-wl-lock {
  overflow: hidden;
}

@media (max-width: 480px) {
  .osttirol-wl__panel {
    width: 100%;
    border-left: 0;
  }
  .osttirol-wl__item {
    padding-left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .osttirol-wl__fab.is-pulse {
    animation: none;
  }
}
