/*
 * mobile-overrides.css — Mobile-Verhalten der statischen Kopie (<= 1024px).
 *
 * Die exakten Element-Werte (Schriftgrößen, Abstände, Höhen) kommen aus
 * assets/css/mobile-real.css (generiert aus dem 390px-Live-Capture, siehe
 * transplant-mobile-styles.mjs). Diese Datei enthält nur:
 *   - Struktur-Verhalten, das Onepage per JS machte (Spalten-Stacking,
 *     Team-Foto-Slider, Header-Umschaltung)
 *   - Burger-Menü + Overlay (Eigenbau, an Live-Optik angelehnt)
 *   - kleine Robustheits-Regeln (Overflow, Touch-Targets)
 */

/* Burger-Button und Overlay standardmäßig versteckt (Desktop) */
.mobile-burger-btn,
.mobile-nav-overlay,
.rackl-slider-dots {
  display: none;
}

@media (max-width: 1024px) {
  /* === Desktop-Navigation & Header-CTA verstecken (live: nur Logo + Burger).
         Nur im Header — der Footer-Menü-Block (Datenschutz/Impressum) bleibt
         mobil sichtbar wie live === */
  .con-kit-molecule-header-v2 .con-kit-atom-menu-v2--device-desktop,
  .con-kit-atom-menu-v2--in-header,
  .con-kit-molecule-header-v2 .con-kit-component-menu-v2-more {
    display: none !important;
  }
  .con-kit-molecule-header-v2 a.con-kit-component-button {
    display: none !important;
  }

  /* === Formular-Seite: live gibt es mobil keinen Header und keinen Burger === */
  [data-page="formular"] .con-kit-section--type-header,
  [data-page="formular"] .mobile-burger-btn {
    display: none !important;
  }

  /* === Inhalts-Spalten stacken (Onepage rendert mobil einspaltig);
         Header bleibt Zeile (Logo links, Burger rechts) === */
  main .con-kit-section:not(.con-kit-section--type-header) .con-kit-row {
    flex-direction: column !important;
  }
  main .con-kit-section:not(.con-kit-section--type-header) .con-kit-row > .con-kit-col {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
  }

  /* === Team-Foto-Slider (live: Slider mit Dots statt 2-Spalten-Raster) === */
  .rackl-team-slider {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .rackl-team-slider::-webkit-scrollbar {
    display: none;
  }
  .rackl-team-slider .con-kit-component-masonry__column {
    display: contents;
  }
  .rackl-team-slider .con-kit-component-masonry__column > div {
    flex: 0 0 100%;
    max-width: 100%;
    scroll-snap-align: center;
  }
  /* Bild-Optik wie im Live-Slider (Radius 8px + Schatten) */
  .rackl-team-slider .con-kit-component-image {
    --one-kit-radius: 8px !important;
    --one-kit-shadow: 0px 1px 4px rgba(17, 17, 26, 0.05), 0px 0px 8px rgba(17, 17, 26, 0.1) !important;
  }
  .rackl-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 16px;
  }
  .rackl-slider-dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: #c9c9c9;
    cursor: pointer;
  }
  .rackl-slider-dots button.is-active {
    background: #333;
  }

  /* === Burger-Button (Live-Optik: hellgraues abgerundetes Feld, dunkle Linien,
         scrollt mit dem Header weg) === */
  .mobile-burger-btn {
    display: flex !important;
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 998;
    width: 46px;
    height: 42px;
    background: #f2f2f2;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
  .mobile-burger-btn:active {
    transform: scale(0.95);
  }
  .mobile-burger-btn__lines {
    display: block;
    width: 18px;
    height: 10px;
    position: relative;
  }
  .mobile-burger-btn__lines::before,
  .mobile-burger-btn__lines::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #191919;
    border-radius: 1px;
  }
  .mobile-burger-btn__lines::before { top: 0; }
  .mobile-burger-btn__lines::after { bottom: 0; }
  .mobile-burger-btn__lines span { display: none; }

  /* === Mobile-Nav-Overlay === */
  .mobile-nav-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 9999;
    overflow-y: auto;
    padding: 72px 20px 32px;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    visibility: hidden;
  }
  .mobile-nav-overlay.is-open {
    transform: translateX(0);
    visibility: visible;
  }
  .mobile-nav-overlay__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 46px;
    height: 42px;
    background: #f2f2f2;
    border: none;
    border-radius: 8px;
    color: #191919;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    z-index: 1;
  }
  .mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .mobile-nav-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }
  .mobile-nav-item--cta {
    border-bottom: none !important;
  }
  .mobile-nav-item--cta .mobile-nav-link {
    background: #62b32b;
    color: #fff !important;
    text-align: center;
    border-radius: 8px;
    margin: 12px 0;
    padding: 16px;
    justify-content: center;
  }
  .mobile-nav-link {
    color: #191919;
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 8px 4px;
    cursor: pointer;
    user-select: none;
  }
  body.mobile-nav-locked {
    overflow: hidden;
  }

  /* === Hero-Marker: bei Zeilenumbruch bekommt live JEDE Zeile ihren grünen
         Balken. Statisch: Inline-Gradient + box-decoration-break statt ::before === */
  .con-kit-quark-highlight[data-highlight-type="marker"]::before {
    display: none !important;
  }
  .con-kit-quark-highlight[data-highlight-type="marker"] {
    background-image: linear-gradient(
      rgba(var(--color-border), var(--alpha-border)),
      rgba(var(--color-border), var(--alpha-border))
    );
    background-repeat: no-repeat;
    background-size: 100% 60%;
    background-position: 0 92%;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    padding: 0 0.12em;
    margin: 0 -0.12em;
  }

  /* === background-Highlight (Formular): bei Zeilenumbruch bekommt live jede
         Zeile ihre eigene Box — statisch per box-decoration-break statt ::before === */
  .con-kit-quark-highlight[data-highlight-type="background"]::before {
    display: none !important;
  }
  .con-kit-quark-highlight[data-highlight-type="background"] {
    background-color: rgba(var(--color-bg), var(--alpha-bg));
    border-radius: calc(var(--one-kit-quark-radius, 4) * .02em);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    padding: 0.08em 0.5ch;
  }

  /* === Brush-Underlines, die live mobil nicht gerendert werden
         (Benefits-Überschrift + "Wer ist R.A.C.K.L.").
         Spezifität muss die display:block-Regel aus highlight-fix.css schlagen === */
  .con-kit-quark-highlight[data-highlight-type="brush-underline"][data-highlight-id="vdVE-xiVUvc7Q8C5RYdPb"] svg,
  .con-kit-quark-highlight[data-highlight-type="brush-underline"][data-highlight-id="yO-D8arWtEdcTt1yOel5X"] svg {
    display: none !important;
  }

  /* === Cookie-Banner: live mobil gestapelt (Buttons unter dem Text) === */
  .con-kit-component-cookie-banner__wrapper,
  .con-kit-component-cookie-banner__section,
  .con-kit-component-cookie-banner__section-left {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .con-kit-component-cookie-banner__wrapper > * {
    width: 100% !important;
    max-width: 100% !important;
  }
  .con-kit-component-cookie-banner button {
    width: 100%;
  }

  /* === Touch-Targets === */
  .con-kit-component-list-item-accordion__trigger button,
  .con-kit-component-list-item-accordion__toggle {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 10px !important;
  }

  /* === Horizontales Overflow verhindern === */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  .con-kit-organism,
  .con-kit-frame,
  .con-kit-container {
    max-width: 100vw !important;
  }
}
