/* ============================================================
   LEISTUNGEN DETAIL – Liquid Glass Design
   ============================================================ */

.leistungen-detail-page {
  padding-top: 0;
}

.main:has(.leistungen-detail-page) {
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
  max-width: 100%;
  padding-bottom: 0;
}

/* ── Hauptinhalt ─────────────────────────────────────────── */
.leistungen-detail-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x) 5rem;
}

/* ── Zurück-Link ─────────────────────────────────────────── */
.leistungen-back {
  display: none;
}

/* ── Hintergrund-Dekoration ──────────────────────────────── */
.leistungen-detail-page::before,
.leistungen-detail-page::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(80px);
  opacity: 0.25;
}

.leistungen-detail-page::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(120, 196, 58, 0.5), transparent 70%);
  top: 10%;
  right: -10%;
}

.leistungen-detail-page::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(120, 196, 58, 0.35), transparent 70%);
  bottom: 20%;
  left: -8%;
}

/* ══════════════════════════════════════════════════════════
   LEISTUNGS-BOXEN-GRID (mit per-Box-Hintergrundbild)
   ══════════════════════════════════════════════════════════ */

/* ── Grid-Abschnitt ──────────────────────────────────────── */
.leistungen-grid-section {
  padding: 3.5rem 0 4rem;
}

.leistungen-grid-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ── Grid mit variabler Spaltenanzahl via CSS Custom Property ── */
.leistungen-boxen-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 4), 1fr);
  gap: 1.25rem;
}

@media (max-width: 56rem) {
  .leistungen-boxen-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 32rem) {
  .leistungen-boxen-grid {
    grid-template-columns: 1fr;
  }
}

.leistungen-box.col-span-1 { grid-column: span 1; }
.leistungen-box.col-span-2 { grid-column: span 2; }
.leistungen-box.col-span-3 { grid-column: span 3; }
.leistungen-box.col-span-4 { grid-column: span 4; }

@media (max-width: 56rem) {
  .leistungen-box.col-span-3,
  .leistungen-box.col-span-4 { grid-column: span 2; }
}

@media (max-width: 32rem) {
  .leistungen-box.col-span-1,
  .leistungen-box.col-span-2,
  .leistungen-box.col-span-3,
  .leistungen-box.col-span-4 { grid-column: span 1; }
}

/* ── Einzelne Glas-Box ───────────────────────────────────── */
.leistungen-box {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.07),
    0 1px 4px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform var(--tr-slow),
    box-shadow var(--tr),
    border-color var(--tr),
    background var(--tr);
  outline: none;
  cursor: pointer;
}

.leistungen-box:hover,
.leistungen-box:focus-visible {
  transform: translateY(-6px) scale(1.015);
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(120, 196, 58, 0.4);
  box-shadow:
    0 16px 48px rgba(120, 196, 58, 0.18),
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  outline: none;
}

/* ── Hintergrundbild der Box ─────────────────────────────── */
.leistungen-box-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.08) translateZ(0);
  filter: blur(4px) brightness(0.32) saturate(0.7);
  z-index: 0;
  will-change: transform;
  transition:
    transform var(--tr-slow),
    filter var(--tr);
}

.leistungen-box:hover .leistungen-box-bg,
.leistungen-box:focus-visible .leistungen-box-bg {
  transform: scale(1.14);
  filter: blur(3px) brightness(0.45) saturate(0.85);
}

/* Box mit Hintergrundbild */
.leistungen-box.has-bg-img {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.leistungen-box.has-bg-img:hover,
.leistungen-box.has-bg-img:focus-visible {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(120, 196, 58, 0.45);
}

/* ── Inhalts-Schicht ─────────────────────────────────────── */
.leistungen-box-content {
  position: relative;
  z-index: 1;
  padding: 2rem 1.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

/* ── Icon: Emoji oder Bild ───────────────────────────────── */
.leistungen-box-icon {
  font-size: 2.25rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.leistungen-box-icon img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  display: block;
}

/* ── Titel ───────────────────────────────────────────────── */
.leistungen-box-titel {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.leistungen-box.has-bg-img .leistungen-box-titel {
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* ── Kurzbeschreibung ────────────────────────────────────── */
.leistungen-box-kurz {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--c-text-muted);
  flex: 1;
}

.leistungen-box.has-bg-img .leistungen-box-kurz {
  color: rgba(255, 255, 255, 0.82);
}

/* ── „Details"-Hinweis ───────────────────────────────────── */
.leistungen-box-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--c-brand-hover);
  margin-top: auto;
  padding-top: 0.75rem;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity var(--tr),
    transform var(--tr);
}

.leistungen-box.has-bg-img .leistungen-box-hint {
  color: rgba(255, 255, 255, 0.8);
}

.leistungen-box:hover .leistungen-box-hint,
.leistungen-box:focus-visible .leistungen-box-hint {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════
   POPUP MODAL
   ══════════════════════════════════════════════════════════ */

.leistungen-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 320ms;
}

.leistungen-modal.is-open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s linear 0s;
}

.leistungen-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 28, 16, 0);
  backdrop-filter: blur(0px) saturate(1);
  -webkit-backdrop-filter: blur(0px) saturate(1);
  transition:
    background 320ms ease,
    backdrop-filter 320ms ease,
    -webkit-backdrop-filter 320ms ease;
}

.leistungen-modal.is-open .leistungen-modal-backdrop {
  background: rgba(17, 28, 16, 0.55);
  backdrop-filter: blur(8px) saturate(0.9);
  -webkit-backdrop-filter: blur(8px) saturate(0.9);
}

.leistungen-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition:
    transform 360ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 320ms ease;
}

.leistungen-modal.is-open .leistungen-modal-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.leistungen-modal-inner {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--r-xl);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.leistungen-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 2.25rem;
  height: 2.25rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text);
  cursor: pointer;
  transition:
    background var(--tr-fast),
    transform var(--tr-fast),
    color var(--tr-fast);
  box-shadow: var(--sh-s);
}

.leistungen-modal-close:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.1) rotate(90deg);
  color: var(--c-brand-hover);
}

.leistungen-modal-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  scrollbar-width: none;
}
.leistungen-modal-content::-webkit-scrollbar {
  display: none;
}

.leistungen-modal-body {
  padding: 2.25rem 2.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: lm-body-in 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes lm-body-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.leistungen-modal-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Icon-Bild (SVG/PNG) im Modal */
.leistungen-modal-icon .lmd-icon-img {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  display: block;
}

.leistungen-modal-titel {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.leistungen-modal-titel::after {
  content: "";
  display: block;
  height: 2px;
  width: 3rem;
  background: var(--c-brand);
  border-radius: 999px;
  margin-top: 0.75rem;
  opacity: 0.6;
}

.leistungen-modal-lang {
  font-size: 0.925rem;
  line-height: 1.75;
  color: var(--c-text-muted);
  margin-top: 0.5rem;
}

.leistungen-modal-lang p   { margin-bottom: 0.75rem; }
.leistungen-modal-lang p:last-child { margin-bottom: 0; }
.leistungen-modal-lang ul,
.leistungen-modal-lang ol  { margin: 0.5rem 0 0.75rem 1.25rem; }
.leistungen-modal-lang li  { margin-bottom: 0.3rem; }
.leistungen-modal-lang a   {
  color: var(--c-brand-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.leistungen-modal-lang a:hover { color: var(--c-text); }
.leistungen-modal-lang strong { color: var(--c-text); font-weight: 600; }
.leistungen-modal-lang h2,
.leistungen-modal-lang h3  {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  margin: 1rem 0 0.4rem;
}

/* ── Reduced Motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .leistungen-modal,
  .leistungen-modal-dialog,
  .leistungen-modal-backdrop {
    transition: none;
  }
  .leistungen-modal-body {
    animation: none;
  }
  .leistungen-box:hover {
    transform: none;
  }
  .leistungen-grid-section.has-bg:hover .leistungen-grid-bg {
    transform: none;
  }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 48rem) {
  .leistungen-modal {
    padding: 1rem;
    align-items: center;
  }
  .leistungen-modal-dialog {
    max-width: 100%;
  }
  .leistungen-modal-inner {
    border-radius: var(--r-xl) var(--r-xl) var(--r-m) var(--r-m);
  }
  .leistungen-modal-body {
    padding: 1.75rem 1.5rem 2rem;
  }
}
