/* ===== PDF Popup Overlay ===== */
.pdf-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.pdf-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===== Modal Container ===== */
.pdf-popup-modal {
  position: relative;
  background: #fdf8f3;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  height: 90vh;
  max-height: 900px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 3px solid var(--primary, #b8651a);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.pdf-popup-overlay.active .pdf-popup-modal {
  transform: scale(1);
}

/* ===== Header ===== */
.pdf-popup-header {
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.pdf-popup-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.5px;
}

.pdf-popup-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  line-height: 1;
}

.pdf-popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* ===== PDF Frame ===== */
.pdf-popup-body {
  flex: 1;
  overflow: hidden;
  background: #e8e0d5;
}

.pdf-popup-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ===== Floating Button ===== */
.pdf-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 9997;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  letter-spacing: 0.5px;
}

.pdf-floating-btn.visible {
  display: inline-flex;
  animation: pdfBtnPop 0.4s ease;
}

.pdf-floating-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  background: var(--primary);
}

.pdf-floating-btn-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.pdf-floating-btn-label {
  white-space: nowrap;
}

@keyframes pdfBtnPop {
  0%   { transform: scale(0) translateY(20px); opacity: 0; }
  70%  { transform: scale(1.1) translateY(-3px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
  .pdf-popup-overlay {
    padding: 16px; /* Abstand zum Rand bleibt erhalten */
    align-items: center;
    justify-content: center;
  }

  .pdf-popup-modal {
    height: 80vh;          /* Nicht mehr 100vh */
    max-height: 80vh;      /* Sichtbarer Rand um das Modal */
    border-radius: 12px;   /* Abgerundete Ecken bleiben */
    border: 3px solid var(--primary, #b8651a); /* Border bleibt */
    max-width: calc(100% - 32px); /* Seitenabstand links + rechts */
    width: 100%;
  }

  .pdf-popup-title {
    font-size: 1rem;
  }

  .pdf-floating-btn {
    bottom: 16px;
    right: 16px;
    padding: 12px 18px;
    font-size: 0.9rem;
  }

  .pdf-floating-btn-icon {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .pdf-popup-overlay {
    padding: 12px; /* Etwas weniger Padding auf sehr kleinen Screens */
  }

  .pdf-popup-modal {
    height: 78vh;
    max-height: 78vh;
    max-width: calc(100% - 24px);
  }

  .pdf-floating-btn-label {
    display: none;
  }

  .pdf-floating-btn {
    padding: 14px;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    justify-content: center;
  }

  .pdf-floating-btn-icon {
    font-size: 1.5rem;
  }
}

