/* ============================================================
   LEISTUNGEN – GRUNDLAYOUT
============================================================ */

.leistungen {
  padding: 5rem 2rem;
  background: #fafafa;
}

.leistungen h2 {
  font-size: 2.4rem;
  margin-bottom: 2.5rem;
  letter-spacing: 0.03em;
  color: #808042;
  text-align: left;
}

/* 3 große Boxen */
.leistungen-grid {
  max-width: 1400px;
  margin: 0 auto 2rem auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.leistung-card {
  background: rgba(255,255,255,0.9);
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  padding: 1.8rem;
  cursor: pointer;
  transition: 0.25s ease;
  text-align: left;
  position: relative;
}

.leistung-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #000;
}

.leistung-card p {
  margin: 0;
  opacity: 0.8;
  color: #000;
}

.leistung-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* ============================================================
   ACTIVE STATE – GROSSE LEISTUNGSKARTEN
============================================================ */

.leistung-card.active {
  border-color: #808042;
  box-shadow: 0 0 14px rgba(128,128,66,0.35);
  transform: translateY(-3px);
}

.leistungen.mode-tragwerk .leistung-card.active {
  color: #ff7a00;
  border-color: #ff7a00;
}

.leistungen.mode-energie .leistung-card.active {
  color: #4dcaff;
  border-color: #4dcaff;
}

.leistungen.mode-sanierung .leistung-card.active {
  color: #bfc7d1;
  border-color: #bfc7d1;
}

/* ============================================================
   PANELS – STABILISIERUNG (kein Springen)
============================================================ */

.leistungen-panels {
  max-width: 1400px;
  margin: 0 auto;
  min-height: auto;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

/* ============================================================
   EPA-LAYOUT – PANEL-INNENAUFBAU
============================================================ */

.epa-layout {
  display: flex;
  flex-direction: row;
  gap: 40px;
  width: 100%;
}

.epa-sidebar {
  width: 260px;
  display: flex;
  flex-direction: column;
}

.epa-sidebar button {
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(8px);
  border: none;
  border-bottom: 1px solid rgba(230,230,230,0.4);
  padding: 18px 20px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a1a1a;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
  position: relative;
  cursor: pointer;
  transition: 0.25s ease;
}

.epa-sidebar button:hover {
  background: rgba(255,255,255,0.75);
  transform: translateY(-2px);
}

.epa-content {
  width: 100%;
  position: relative;
  min-height: auto;
}

/* ============================================================
   INHALTE – STABIL OHNE SPRINGEN
============================================================ */

.hori-content {
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  text-align: left !important;
}

.hori-content.active {
  display: block;
  opacity: 1;
}

.hori-content h2 {
  font-size: 2.1rem;
  margin-bottom: 16px;
  color: #000 !important;
}

.hori-content p {
  font-size: 1.1rem;
  line-height: 1.7;
  opacity: 0.9;
  color: #000 !important;
}

.hori-content img {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  object-fit: cover;
  margin-top: 1.5rem;
}

/* ============================================================
   TW-INNER – DESKTOP
============================================================ */

.tw-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 80px;
  align-items: start;
}

/* ============================================================
   ⭐ MOBILE FIX – GENAU WIE IM SCREENSHOT ⭐
============================================================ */

@media (max-width: 900px) {

  .tw-inner {
    display: flex;
    flex-direction: column;
    gap: 25px;
  }

  .tw-text {
    width: 100%;
    order: 1;
  }

  .tw-image {
    width: 100%;
    order: 2;
  }

  .tw-image img {
    width: 100%;
    height: auto;
    display: block;
  }
}

/* ============================================================
   MOBILE TABS
============================================================ */

.hori-wrapper {
  display: none;
}

@media (max-width: 900px) {

  .hori-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    flex-shrink: 0;
  }

  .hori-menu {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
  }

  .hori-menu:active {
    scroll-behavior: auto;
  }

  .hori-menu button {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: 0.25s ease;
    position: relative;
  }

  .hori-menu button.active {
    font-weight: 700;
    background: rgba(255,255,255,0.4);
  }
}

/* ============================================================
   LEUCHTBALKEN
============================================================ */

.hori-menu button,
.epa-sidebar button {
  position: relative;
}

.hori-menu button.active::after,
.epa-sidebar button.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -4px;
  height: 4px;
  border-radius: 4px;
  transition: 0.25s ease;
}

/* ⭐ NEUTRALER FALL – Balken verschwindet NIE */
.epa-sidebar button.active::after,
.hori-menu button.active::after {
  background: #808042;
  box-shadow: 0 0 12px #808042, 0 0 24px #808042;
}

/* ============================================================
   FARBLOGIK
============================================================ */

.leistungen.mode-tragwerk .epa-sidebar button.active,
.leistungen.mode-tragwerk .hori-menu button.active {
  color: #ff7a00;
  border-color: #ff7a00;
}

.leistungen.mode-tragwerk .epa-sidebar button.active::after,
.leistungen.mode-tragwerk .hori-menu button.active::after {
  background: #ff7a00;
  box-shadow: 0 0 12px #ff7a00, 0 0 24px #ff7a00;
}

.leistungen.mode-energie .epa-sidebar button.active,
.leistungen.mode-energie .hori-menu button.active {
  color: #4dcaff;
  border-color: #4dcaff;
}

.leistungen.mode-energie .epa-sidebar button.active::after,
.leistungen.mode-energie .hori-menu button.active::after {
  background: #4dcaff;
  box-shadow: 0 0 12px #4dcaff, 0 0 24px #4dcaff;
}

.leistungen.mode-sanierung .epa-sidebar button.active,
.leistungen.mode-sanierung .hori-menu button.active {
  color: #bfc7d1;
  border-color: #bfc7d1;
}

.leistungen.mode-sanierung .epa-sidebar button.active::after,
.leistungen.mode-sanierung .hori-menu button.active::after {
  background: #bfc7d1;
  box-shadow: 0 0 12px #bfc7d1, 0 0 24px #bfc7d1;
}

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 900px) {
  .leistungen-grid {
    grid-template-columns: 1fr;
  }

  .epa-layout {
    flex-direction: column;
    gap: 24px;
  }

  .hori-content img {
    border-radius: 10px;
  }
}

/* ============================================================
   ⭐ MOBILE HEIGHT FIX – verhindert zu große weiße Fläche ⭐
============================================================ */

@media (max-width: 900px) {

  .epa-layout,
  .epa-content,
  .leistungen-panels {
    height: auto !important;
    min-height: auto !important;
  }

  .leistungen {
    padding: 2.5rem 1.5rem;
  }
}


/* ============================================================
   COOKIE-BANNER – EXTRA BREIT, FLACH, PERFEKT AUSGERICHTET
============================================================ */

.cookie-banner {
  position: fixed;
  bottom: 28px;
  right: 40px;
  z-index: 99999;
  animation: fadeIn 0.4s ease;
}

.cookie-box {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 20px 30px;
  width: 660px; /* NOCH BREITER */
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.55);
  font-size: 15px;
  line-height: 1.55;
  color: #1a1a1a;
  font-weight: 500;
}

.cookie-box p {
  margin: 0 0 14px 0;
}

/* ============================================================
   COOKIE-BUTTONS – NEBENEINANDER, SAUBER AUSGERICHTET
============================================================ */

.cookie-buttons {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px; /* etwas mehr Platz */
  margin-top: 12px;
}

.cookie-btn {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s ease;
  text-align: center;
  border: none;
  white-space: nowrap;
}

/* Hauptbutton */
.cookie-btn.accept {
  background: linear-gradient(135deg, #2b2b2b, #000);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.cookie-btn.accept:hover {
  background: linear-gradient(135deg, #1f1f1f, #000);
}

/* Nur notwendige Cookies */
.cookie-btn.decline {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.15);
  color: #333;
  min-width: 180px; /* breiter → perfekt lesbar */
}

.cookie-btn.decline:hover {
  background: rgba(255,255,255,0.75);
}

/* Datenschutzerklärung */
.cookie-btn.info {
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(0,0,0,0.15);
  color: #000;
  text-decoration: none;
  font-size: 0.9rem;
  min-width: 160px; /* breiter → harmonisch */
}

.cookie-btn.info:hover {
  background: rgba(255,255,255,0.55);
}

/* Fade-In Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MOBILE OPTIMIERUNG – 3 BUTTONS UNTEREINANDER
============================================================ */

@media (max-width: 600px) {

  .cookie-banner {
    bottom: 16px;
    right: 16px;
    left: 16px; /* zentriert + kein Rausrutschen */
  }

  .cookie-box {
    width: 100%; /* volle Breite */
    padding: 18px 20px;
    border-radius: 14px;
  }

  .cookie-buttons {
    flex-direction: column; /* Buttons untereinander */
    gap: 12px;
    width: 100%;
  }

  .cookie-btn {
    width: 100%; /* volle Breite */
    padding: 14px 0;
    font-size: 1rem;
    min-width: unset; /* verhindert Überlauf */
  }

  .cookie-btn.decline,
  .cookie-btn.info {
    min-width: unset; /* verhindert Überlauf */
  }
}

