/**
 * Shared Anbieter Badge Styles
 * Verwendet auf Landing-Page (Kacheln) und Detail-Page (Hero)
 * Single Source of Truth fuer Badge-Farben und -Styling
 */

.anbieter-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f0f7ff;
  border: 1px solid #d0e3f7;
  color: #1a5276;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-appearance: none;
  font-family: inherit;
  white-space: nowrap;
}

.anbieter-badge:hover {
  background: #e3eff9;
  border-color: #b8d4ed;
}

.anbieter-badge__icon {
  flex-shrink: 0;
  opacity: 0.65;
  color: #1a5276;
}

.anbieter-badge__label {
  white-space: nowrap;
}

/* Highlighted Badges (Sofortschutz, Keine Gesundheitsfragen) */
.anbieter-badge--highlight {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
  font-weight: 600;
}

.anbieter-badge--highlight:hover {
  background: #bbf7d0;
  border-color: #4ade80;
}

/* ===== TOOLTIP (Desktop: hover) ===== */
.anbieter-badge__tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 300px;
  background: #ffffff;
  color: #2d3748;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  z-index: 200;
  pointer-events: auto;
}

/* Bridge: Pseudo-Element schließt den Gap zwischen Badge und Tooltip */
.anbieter-badge__tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px; /* schließt den 10px Gap + 2px Puffer */
}

.anbieter-badge__tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #ffffff;
}

/* Link-Styling im Tooltip */
.anbieter-badge__tooltip a {
  color: #1a5276;
  text-decoration: underline;
  font-weight: 500;
}

.anbieter-badge__tooltip a:hover {
  color: #0d3b5e;
}

@media (hover: hover) and (pointer: fine) {
  .anbieter-badge:hover .anbieter-badge__tooltip {
    display: block;
  }
}

/* ===== MOBILE POPOVER OVERLAY ===== */
.anbieter-badge-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.anbieter-badge-overlay.is-active {
  display: flex;
}

.anbieter-badge-overlay__card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
  position: relative;
}

.anbieter-badge-overlay__text {
  font-size: 14px;
  line-height: 1.6;
  color: #2d3748;
  margin: 0;
}

.anbieter-badge-overlay__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7fafc;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #718096;
  transition: background 0.15s ease;
  padding: 0;
  font-family: inherit;
}

.anbieter-badge-overlay__close:hover {
  background: #e2e8f0;
}
