/* =========================================================
   MOBILE-AKKORDEON – Produktseiten
   Klappt markierte Abschnitte NUR am Handy (<=767px) ein.
   Desktop/Tablet bleiben unveraendert (Inhalt immer offen).
   Nutzt das vorhandene Bootstrap-Collapse (kein neues JS).
   Ans Ende von products.css einfuegen.
   ========================================================= */

/* Toggle-Leiste: standardmaessig aus (Desktop) */
.prod-mtoggle {
  display: none;
}

/* ---------------------------------------------------------
   Desktop / Tablet: Inhalte immer offen, Toggle aus
   --------------------------------------------------------- */
@media (min-width: 768px) {

  .prod-mtoggle {
    display: none !important;
  }

  .prod-mcollapse {
    display: block !important;
    height: auto !important;
  }

}

/* ---------------------------------------------------------
   Mobile: Abschnitt zugeklappt, Ueberschrift + Toggle sichtbar
   --------------------------------------------------------- */
@media (max-width: 767px) {

  /* Textlink-Stil wie .intro-more-toggle (oranger Text + Pfeil), keine Box */
  .prod-mtoggle {
    display: inline-block;
    width: auto;

    /* Abstand oben kommt aus .section-title { margin-bottom: 15px } */
    margin: 0;
    padding: 6px 0;

    background: none;
    border: 0;
    border-radius: 0;

    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--orange, #ec9345);

    text-decoration: none;
    cursor: pointer;

    -webkit-tap-highlight-color: transparent;
  }

  .prod-mtoggle:hover,
  .prod-mtoggle:focus {
    color: var(--orange, #ec9345);
    text-decoration: none;
  }

  /* Pfeil-Indikator ▾ / ▴ */
  .prod-mtoggle::after {
    content: " \25BE";
    color: var(--orange, #ec9345);
  }

  .prod-mtoggle[aria-expanded="true"]::after {
    content: " \25B4";
  }

  /* Erstes Element im aufgeklappten Inhalt: Eigen-Oberrand aus
     (z.B. .product-feature-text h3 hat margin-top:28px), damit der
     Abstand allein ueber .prod-mcollapse gesteuert wird -> 50/50 */
  .prod-mcollapse > :first-child,
  .prod-mcollapse > :first-child > :first-child,
  .prod-mcollapse > :first-child > :first-child > :first-child {
    margin-top: 0 !important;
  }

  /* Abstand unten zum aufgeklappten Inhalt */
  .prod-mcollapse {
    margin-top: 20px;
  }

}

/* =========================================================
   Umgebaute Toggle-Sektionen: Ausrichtung + Abstaende
   (Tablet/Desktop, wo der Toggle aus und der Inhalt offen ist)
   ========================================================= */

/* Tablet: Collapse-Text volle Breite -> linke Kante wie der Teaser
   (sonst 700px-zentriert = eingerueckt gegenueber dem Teaser) */
@media (min-width: 768px) and (max-width: 991px) {
  .prod-mcollapse .product-feature-text {
    max-width: none;
    margin: 0;
  }
}

/* Tablet + Desktop: Abstaende in den umgebauten Sektionen */
@media (min-width: 768px) {
  /* Abstand zwischen gestapelten Modell-Textbloecken (Modellauswahl) */
  .prod-mcollapse .product-feature-text + .product-feature-text {
    margin-top: 34px;
  }
  /* Modellauswahl: Abstand zwischen Tabelle und folgendem Text */
  #machine-selection .table-container {
    margin-bottom: 48px;
  }
  /* einfache Listen im Collapse: Luft davor/danach */
  .prod-mcollapse .product-feature-text ul:not(.marked-list) {
    margin: 8px 0 16px 0;
  }
}

/* ---------------------------------------------------------
   Anwendungs-Kacheln: Slider nur am Handy (<=767px)
   Karte voll breit (eine pro Ansicht) + Punkte/Dots darunter.
   Desktop/Tablet bleiben das Raster.
   --------------------------------------------------------- */

/* Dots standardmaessig aus (Desktop/Tablet) */
.product-applications-section .application-dots {
  display: none;
}

@media (max-width: 767px) {

  .product-applications-section .application-grid {
    display: flex !important;
    grid-template-columns: none !important;   /* altes Raster aufheben */
    flex-wrap: nowrap !important;

    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;

    scroll-snap-type: x mandatory;

    gap: 0;
    margin: 0;
    padding: 0;

    scrollbar-width: none;               /* Firefox: Scrollbar aus */
  }

  .product-applications-section .application-grid::-webkit-scrollbar {
    display: none;                        /* iOS / Chrome: Scrollbar aus */
  }

  .product-applications-section .application-card {
    flex: 0 0 100% !important;            /* eine Karte pro Ansicht, kein Anschnitt */
    width: 100% !important;
    min-width: 100% !important;

    scroll-snap-align: start;
  }

  /* Punkte / Dots unter dem Slider */
  .product-applications-section .application-dots {
    display: flex;
    justify-content: center;
    gap: 8px;

    margin-top: 14px;
  }

  .product-applications-section .application-dot {
    width: 8px;
    height: 8px;

    padding: 0;
    border: 0;
    border-radius: 50%;

    background: rgba(31, 41, 51, .22);    /* inaktiv */

    cursor: pointer;
    transition: background .2s ease, transform .2s ease;

    -webkit-tap-highlight-color: transparent;
  }

  .product-applications-section .application-dot.is-active {
    background: var(--orange, #ec9345);
    transform: scale(1.25);
  }

}

/* ---------------------------------------------------------
   Vergleichstabelle als Maschinen-Slider (Handy)
   Linke Spalte (Zeilennamen) fix, Maschinen-Spalten wischbar,
   Punkte darunter. Klasse am .table-container: .table-slider
   --------------------------------------------------------- */
.table-dots { display: none; }

@media (max-width: 767px) {

  .table-slider {
    padding: 10px 0 !important;          /* kein Seiten-Padding -> fixe Spalte buendig */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 180px;
    scrollbar-width: none;
  }
  .table-slider::-webkit-scrollbar { display: none; }

  .table-slider .tech-table {
    table-layout: fixed;              /* Breiten werden per JS exakt gesetzt */
  }

  /* fixe linke Spalte = Zeilennamen.
     Breite setzt das JS dynamisch auf das breiteste Label (nowrap);
     nur bei extrem langen Labels wird bewusst umgebrochen. */
  .table-slider .tech-table th:first-child,
  .table-slider .tech-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 6;                 /* ueber den Maschinenspalten-Inhalten (Buttons/Links) */

    min-width: 120px;

    box-shadow: 2px 0 5px rgba(0, 0, 0, .05);
  }
  .table-slider .tech-table td:first-child { background: #ffffff; }
  .table-slider .tech-table th:first-child { background: #f5f6f7; }

  /* Opaker Hintergrund als Pseudo-Element – unabhaengig von der Spezifitaet.
     Grund: products.css setzt bei manchen Zeilen (z.B. der Button-Zeile) den
     Zell-Hintergrund transparent; dann scheinen durchscrollende Inhalte
     (Anfrage-Buttons) durch die fixe Spalte. Das ::before fuellt die Zelle
     opak hinter ihrem eigenen Inhalt und deckt die Maschinenspalten ab. */
  .table-slider .tech-table th:first-child,
  .table-slider .tech-table td:first-child { background-clip: padding-box; }
  .table-slider .tech-table td:first-child::before,
  .table-slider .tech-table th:first-child::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ffffff;
    z-index: -1;
  }
  .table-slider .tech-table th:first-child::before { background: #f5f6f7; }

  /* Buttons/Links der Maschinenspalten unter die fixe Spalte legen,
     damit sie beim Wischen sauber dahinter verschwinden. */
  .table-slider .tech-table td:not(:first-child),
  .table-slider .tech-table th:not(:first-child) {
    position: relative;
    z-index: 1;
  }
  .table-slider .tech-table td:not(:first-child) .button,
  .table-slider .tech-table td:not(:first-child) a {
    position: relative;
    z-index: 1;
  }

  /* Maschinen-Spalten: feste Breite + Einrasten */
  .table-slider .tech-table th:nth-child(n+2),
  .table-slider .tech-table td:nth-child(n+2) {
    min-width: 130px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  /* Punkte */
  .table-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
  }
  .table-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(31, 41, 51, .22);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .table-dot.is-active {
    background: var(--orange, #ec9345);
    transform: scale(1.25);
  }
}


/* =========================================================
   Sticky "Anfrage"-CTA
   Handy: volle Leiste unten.  Desktop: Pille unten rechts ueber dem ToTop.
   Erscheint per JS, sobald der Hero (#top) wegscrollt.
   ========================================================= */
.cta-sticky {
  position: fixed;
  z-index: 25;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}

.cta-sticky.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cta-sticky .cta-sticky-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

/* ---- Handy: volle Leiste unten ---- */
@media (max-width: 767px) {
  .cta-sticky {
    left: 0;
    right: 0;
    bottom: 0;

    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));

    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line, #e6e9ec);
    box-shadow: 0 -3px 12px rgba(0, 0, 0, .08);

    transform: translateY(100%);
  }
  .cta-sticky.is-visible { transform: translateY(0); }

  .cta-sticky .cta-sticky-btn {
    width: 100%;
    padding: 13px 16px;
    font-size: 16px;
    border-radius: 8px;
  }

  /* "nach oben"-Button nur im sichtbaren (aktiven) Zustand ueber die Leiste heben;
     versteckt bleibt er auf bottom:15px, damit translateY(100px) ihn ganz ausblendet */
  .ui-to-top.active { bottom: 78px !important; }
}

/* ---- Desktop / Tablet: dezente Pille unten rechts, ueber dem ToTop ---- */
@media (min-width: 768px) {
  .cta-sticky {
    right: 40px;
    bottom: 104px;            /* ueber dem .ui-to-top (50px @ bottom:40px) */
    transform: translateY(16px);
  }
  .cta-sticky.is-visible { transform: translateY(0); }

  .cta-sticky .cta-sticky-btn {
    padding: 12px 22px;
    font-size: 15px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(236, 147, 69, .35);
  }
}

/* =========================================================
   SPRUNG-NAV  –  ZENTRALER AN/AUS-SCHALTER (gilt fuer ALLE Seiten)
   ---------------------------------------------------------
   Standard: AN (Leiste sichtbar).
   Zum AUSSCHALTEN auf ALLEN Seiten: beim folgenden Regelblock die
   Kommentar-Markierung ober- und unterhalb entfernen, sodass die
   beiden Regeln aktiv werden.
   ========================================================= */
/*
.jump-nav { display: none !important; }
#sec-anwendungen,
#sec-material,
#machine-selection,
#technical-data,
#sec-faq { scroll-margin-top: 0 !important; }
*/


/* =========================================================
   Sprung-Navigation (Chips) – Handy/Tablet, klebt unter dem Header.
   --jnav-top wird per JS auf die aktuelle Header-Hoehe gesetzt.
   ========================================================= */
.jump-nav { display: none; }

@media (max-width: 991px) {

  .jump-nav {
    display: block;
    position: fixed;
    top: var(--jnav-top, 56px);
    left: 0;
    right: 0;
    z-index: 18;

    background: #ffffff;
    border-bottom: 1px solid var(--line, #e6e9ec);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  }

  .jump-nav.is-shown {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .jump-nav-inner {
    display: flex;
    justify-content: space-between;   /* auf Bildschirmbreite verteilen */
    gap: 5px;

    overflow-x: auto;                 /* Fallback: scrollen auf sehr schmalen Geraeten */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;

    padding: 8px 12px;
  }
  .jump-nav-inner::-webkit-scrollbar { display: none; }

  .jump-chip {
    flex: 0 0 auto;

    padding: 5px 9px;
    border-radius: 4px;

    background: var(--soft, #f5f6f7);
    border: 1px solid var(--line, #e6e9ec);
    color: var(--ink, #1f2933);

    font-size: 12px;
    font-weight: 500;
    line-height: 1;

    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  .jump-chip:hover,
  .jump-chip:focus { text-decoration: none; color: var(--ink, #1f2933); }

  .jump-chip.is-active {
    background: var(--orange, #ec9345);
    border-color: var(--orange, #ec9345);
    color: #ffffff;
  }
}

/* Tablet: Chips zentriert + kompakter Abstand (statt voll verteilt) */
@media (min-width: 768px) and (max-width: 991px) {
  .jump-nav-inner {
    justify-content: center;
    gap: 10px;
  }
}

/* Ziel-Sections: unter Header + Sprung-Leiste freihalten */
@media (max-width: 991px) {
  #sec-anwendungen,
  #sec-material,
  #machine-selection,
  #technical-data,
  #sec-faq {
    scroll-margin-top: calc(var(--jnav-top, 56px) + 54px);
  }
}

/* ---------------------------------------------------------
   Kategorie-Kacheln ("Weitere Produkte"): Slider nur am Handy (<=767px)
   Eine Karte pro Ansicht + Punkte/Dots darunter.
   Desktop/Tablet bleiben das Raster. Kacheln kommen aus dem CMS.
   Dots-Leiste wird per script2.js erzeugt (kein JS/HTML im Content).
   --------------------------------------------------------- */
.category-machines .category-dots { display: none; }

@media (max-width: 767px) {

  .category-machines .category-machine-grid {
    display: flex !important;
    grid-template-columns: none !important;   /* altes Raster aufheben */
    flex-wrap: nowrap !important;

    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;

    scroll-snap-type: x mandatory;

    gap: 0;
    margin: 0;
    padding: 0;

    scrollbar-width: none;                /* Firefox: Scrollbar aus */
  }

  .category-machines .category-machine-grid::-webkit-scrollbar {
    display: none;                        /* iOS / Chrome: Scrollbar aus */
  }

  .category-machines .category-machine-card {
    flex: 0 0 100% !important;            /* eine Karte pro Ansicht, kein Anschnitt */
    width: 100% !important;
    min-width: 100% !important;

    scroll-snap-align: start;
  }

  /* Punkte / Dots unter dem Slider */
  .category-machines .category-dots {
    display: flex;
    justify-content: center;
    gap: 8px;

    margin-top: 14px;
  }

  .category-machines .category-dot {
    width: 8px;
    height: 8px;

    padding: 0;
    border: 0;
    border-radius: 50%;

    background: rgba(31, 41, 51, .22);    /* inaktiv */

    cursor: pointer;
    transition: background .2s ease, transform .2s ease;

    -webkit-tap-highlight-color: transparent;
  }

  .category-machines .category-dot.is-active {
    background: var(--orange, #ec9345);
    transform: scale(1.25);
  }

}


/* =========================================================
   Overview-Buttons am Handy sichtbar.
   Das Theme blendet Buttons innerhalb von .product-feature und
   in der section-alt (Wissen-CTA) auf kleinen Screens aus -
   hier wieder erzwingen.
   ========================================================= */
@media (max-width: 991px) {
  .product-feature .product-feature-text .button,
  .section-alt .text-center .button {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}


/* =========================================================
   Anwendungs-Kacheln (Overview): Slider nur am Handy (<=767px).
   Eine Kachel pro Ansicht + Punkte/Dots darunter.
   Kacheln kommen aus dem CMS (<!showapplication!>).
   Dots werden per script2.js erzeugt (kein JS/HTML im Content).
   ========================================================= */
.application-tile-dots { display: none; }

@media (max-width: 767px) {

  .application-tile-row {
    display: flex !important;
    flex-wrap: nowrap !important;

    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;

    scroll-snap-type: x mandatory;

    gap: 0;
    margin: 0;
    padding: 0;

    scrollbar-width: none;
  }

  .application-tile-row::-webkit-scrollbar {
    display: none;
  }

  .application-tile-row > * {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;

    scroll-snap-align: start;
  }

  .application-tile-dots {
    display: flex;
    justify-content: center;
    gap: 8px;

    margin-top: 14px;
  }

  .application-tile-dots .application-tile-dot {
    width: 8px;
    height: 8px;

    padding: 0;
    border: 0;
    border-radius: 50%;

    background: rgba(31, 41, 51, .22);

    cursor: pointer;
    transition: background .2s ease, transform .2s ease;

    -webkit-tap-highlight-color: transparent;
  }

  .application-tile-dots .application-tile-dot.is-active {
    background: var(--orange, #ec9345);
    transform: scale(1.25);
  }

}


/* =========================================================
   Intro-Text: "Weiterlesen"-Aufklapper nur am Handy (<=767px).
   Text bleibt vollstaendig im DOM (SEO), wird nur eingeklappt
   angezeigt. Wrapper .intro-more + Button werden per script2.js
   erzeugt (kein JS/HTML im Content).
   ========================================================= */
.intro-more-toggle { display: none; }

@media (max-width: 767px) {

  .intro-more.is-collapsed {
    max-height: 170px;
    overflow: hidden;
    position: relative;
  }

  .intro-more.is-collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
  }

  /* Textlink-Stil wie .prod-mtoggle (oranger Text + Pfeil), keine Box */
  .intro-more-toggle {
    display: inline-block;
    width: auto;

    margin: 12px 0 0;
    padding: 6px 0;

    background: none;
    border: 0;
    border-radius: 0;

    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--orange, #ec9345);

    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .intro-more-toggle:hover,
  .intro-more-toggle:focus {
    color: var(--orange, #ec9345);
    text-decoration: none;
  }

  /* Pfeil-Indikator wie .prod-mtoggle */
  .intro-more-toggle::after { content: " \25BE"; color: var(--orange, #ec9345); }
  .intro-more-toggle[aria-expanded="true"]::after { content: " \25B4"; }

}
