/* ============================================================
   MoosFrei Dach — interaktiver 3D-Hero (Dach reinigen)
   ============================================================ */

.hero-3d { padding-top: clamp(2.5rem, 6vw, 5rem); padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.hero-3d .hero-inner { grid-template-columns: 0.92fr 1.08fr; gap: clamp(1.75rem, 3.5vw, 3rem); }
.hero-3d h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }

.hero3d-wrap { gap: 0.9rem; }

.hero3d {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
  min-height: 340px;
  max-height: 620px;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 24px 60px rgba(0,0,0,0.38), inset 0 0 0 1px rgba(255,255,255,0.04);
  /* Himmel: kühles Salbei-Blau → Creme am Horizont */
  background: linear-gradient(180deg, #b9d3cb 0%, #d4e4dc 38%, #ebf0e4 64%, #faf7f2 100%);
  outline: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.hero3d:focus-visible { box-shadow: 0 0 0 3px var(--green-accent), 0 24px 60px rgba(0,0,0,0.38); }

.hero3d canvas {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
  display: block;
  touch-action: pan-y;
  cursor: crosshair;
  z-index: 1;
}

/* ---------- Fallback: Vorher/Nachher-Slider ---------- */
.hero3d-fallback { position: absolute; inset: 0; z-index: 0; }
.hero3d.is-3d .hero3d-fallback { display: none; }
.ba-slider img { width: 100%; height: 100%; object-fit: cover; }
.ba-before-tint {
  position: absolute; inset: 0;
  background: rgba(15, 46, 36, 0.28);
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
  pointer-events: none;
}
.ba-divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 3px; margin-left: -1.5px;
  background: #fff; box-shadow: 0 0 12px rgba(0,0,0,0.35);
  pointer-events: none;
}
.ba-divider span {
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.ba-divider span::before {
  content: "‹ ›"; position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--green-900); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.1em;
}
.ba-label {
  position: absolute; bottom: 14px;
  padding: 0.3rem 0.7rem; border-radius: 4px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  pointer-events: none;
}
.ba-label-left { left: 14px; background: rgba(15,46,36,0.85); color: #fff; }
.ba-label-right { right: 14px; background: rgba(167,201,87,0.95); color: var(--green-950); }
.ba-range {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: ew-resize; margin: 0;
  touch-action: pan-y;
}

/* ---------- 3D-Overlay ---------- */
.hero3d-ui { display: none; }
.hero3d.is-3d .hero3d-ui { display: block; }
.hero3d-ui > * { z-index: 3; }

.hero3d-hint {
  position: absolute; left: 14px; top: 14px; right: 150px;
  width: fit-content; max-width: calc(100% - 170px);
  margin: 0;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 46, 36, 0.78);
  color: #fff;
  font-size: 0.82rem; font-weight: 500; line-height: 1.35;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.hero3d-hint-icon { color: var(--green-accent); font-weight: 700; margin-right: 0.2rem; display: inline-block; animation: hint-nudge 1.8s var(--ease) infinite; }
.hero3d.is-touched .hero3d-hint { opacity: 0.55; }
.hero3d.is-done .hero3d-hint { opacity: 0; transform: translateY(-6px); }
@keyframes hint-nudge { 0%,100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

.hero3d-progress {
  position: absolute; right: 14px; top: 14px;
  min-width: 128px;
  padding: 0.45rem 0.75rem 0.55rem;
  border-radius: 12px;
  background: rgba(250, 247, 242, 0.92);
  color: var(--green-950);
  box-shadow: 0 6px 18px rgba(15,46,36,0.18);
  pointer-events: none;
}
.hero3d-progress-text { display: block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; }
.hero3d-progress-text strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero3d-progress-bar { display: block; height: 5px; margin-top: 0.3rem; border-radius: 99px; background: rgba(26,77,62,0.15); overflow: hidden; }
.hero3d-progress-bar span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--green-700), var(--green-accent)); border-radius: inherit; transition: width 0.2s linear; }

.hero3d-reset {
  position: absolute; right: 14px; bottom: 14px;
  border: 1px solid rgba(26,77,62,0.25);
  background: rgba(250,247,242,0.92);
  color: var(--green-900);
  font-weight: 600; font-size: 0.82rem;
  padding: 0.4rem 0.85rem; border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15,46,36,0.15);
  transition: background 0.2s, transform 0.2s var(--ease);
}
.hero3d-reset:hover { background: #fff; transform: translateY(-1px); }
.hero3d-reset:focus-visible { outline: 3px solid var(--green-accent); outline-offset: 2px; }

.hero3d-badge {
  position: absolute; left: 14px; bottom: 14px; z-index: 3;
  padding: 0.25rem 0.6rem; border-radius: 4px;
  background: rgba(15,46,36,0.7); color: rgba(255,255,255,0.9);
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  pointer-events: none;
}
.hero3d:not(.is-3d) .hero3d-badge { display: none; }
.hero3d.is-done .hero3d-badge { opacity: 0; }

.hero3d-cta {
  position: absolute; left: 50%; bottom: 58px;
  width: min(92%, 420px);
  transform: translate(-50%, 12px);
  opacity: 0;
  padding: 1rem 1.15rem 1.1rem;
  border-radius: 14px;
  background: rgba(15, 46, 36, 0.93);
  color: #fff;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.hero3d-cta[hidden] { display: none; }
.hero3d-cta.show { opacity: 1; transform: translate(-50%, 0); }
.hero3d-cta-title { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; line-height: 1.15; margin: 0 0 0.25rem; color: #fff; }
.hero3d-cta-text { font-size: 0.88rem; line-height: 1.45; margin: 0 0 0.8rem; color: rgba(255,255,255,0.85); }
.hero3d-cta-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.55rem; }
.hero3d-cta-primary { background: var(--green-accent); color: var(--green-950); box-shadow: 0 4px 14px rgba(167,201,87,0.35); }
.hero3d-cta-primary:hover { background: #b8d66b; color: var(--green-950); }

.hero3d-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; padding: 0; }
.hero3d-chips li {
  font-size: 0.8rem; font-weight: 600; color: rgba(255,255,255,0.9);
  padding: 0.3rem 0.7rem; border-radius: 999px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-3d .hero-inner { grid-template-columns: 1fr; }
  .hero3d-wrap { order: -1; }
  .hero3d { aspect-ratio: 4 / 3.3; max-height: 70vh; }
}
@media (max-width: 520px) {
  .hero3d { aspect-ratio: 1 / 1; min-height: 300px; border-radius: 14px; }
  .hero3d-hint { font-size: 0.74rem; left: 10px; top: 10px; max-width: calc(100% - 132px); padding: 0.4rem 0.65rem; border-radius: 12px; }
  .hero3d-progress { right: 10px; top: 10px; min-width: 104px; padding: 0.35rem 0.6rem 0.45rem; }
  .hero3d-progress-text strong { font-size: 1.1rem; }
  .hero3d-reset { right: 10px; bottom: 10px; }
  .hero3d-badge { left: 10px; bottom: 12px; font-size: 0.6rem; }
  .hero3d-cta { bottom: 50px; padding: 0.8rem 0.9rem 0.9rem; }
  .hero3d-cta-title { font-size: 1.2rem; }
  .hero3d-cta-text { font-size: 0.8rem; margin-bottom: 0.6rem; }
  .hero3d-chips { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero3d-hint-icon { animation: none; }
  .hero3d-cta, .hero3d-hint, .hero3d-progress-bar span { transition: none; }
}
