/* Mobile Darstellung der Startseite – Desktop bleibt unverändert */
@media screen and (max-width: 700px) {
  html, body { min-width:0 !important; width:100% !important; min-height:100% !important; }
  body { margin:0 !important; overflow-x:hidden !important; overflow-y:auto !important; background-color:#000099 !important; background-image:none !important; }

  #deckel_oben_links, #deckel_unten_links, #deckel_oben_rechts, #deckel_unten_rechts { display:none !important; }

  #Foto_01, #Foto_02, #Foto_03, #Foto_04, #Foto_05, #Foto_06, #Foto_07,
  #Foto_08, #Foto_09, #Foto_10, #Foto_11, #Foto_12, #Foto_13 { top:150px !important; }

  #contentScroller {
    top:255px !important; bottom:auto !important; left:0 !important; right:auto !important;
    width:100vw !important; max-width:none !important; height:auto !important;
    overflow:visible !important; box-sizing:border-box !important;
  }

  #contentScroller > table, #contentScroller > table > tbody, #contentScroller > table > tbody > tr {
    display:block !important; width:100% !important; max-width:none !important; box-sizing:border-box !important;
  }

  #contentScroller > table > tbody > tr > td:first-child,
  #contentScroller > table > tbody > tr > td:last-child { display:none !important; }

  #contentScroller > table > tbody > tr > td:nth-child(2) {
    display:block !important; width:100% !important; max-width:none !important;
    padding:12px 18px 36px !important; box-sizing:border-box !important;
  }

  #contentScroller h1 {
    font-size:30px !important; line-height:1.15 !important; text-align:center !important;
    margin:8px 0 20px !important;
  }

  #contentScroller p {
    width:auto !important; max-width:none !important; font-size:16px !important;
    line-height:1.55 !important; text-align:left !important; margin:0 0 24px !important;
  }

  .schnitzer-counter {
    width:210px !important; max-width:70vw !important; margin:0 auto 20px !important;
    font-size:11px !important;
  }
  .counter-title { padding:6px 8px 5px !important; font-size:12px !important; }
  .counter-stripes { height:4px !important; }
  .counter-row { margin:0 8px !important; padding:4px 2px !important; }


/* Handy: moderner Ersatz für den alten blauen Spacer.
   Alles außerhalb der sichtbaren Bildschirmbreite wird abgeschnitten. */
html,
body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* Die alte laufende Bilderleiste darf weiterlaufen,
   aber sie darf die Seite nicht mehr breiter machen. */
body {
  position: relative !important;
  clip-path: inset(0 0 0 0);
}

#contentScroller {
  overflow-x: hidden !important;
}

}


/* Handy-Navigation: alte Desktop-Buttonleiste ausblenden,
   stattdessen kompakte, gut antippbare Textnavigation. */
#mobile-nav {
  display: none;
}

@media screen and (max-width: 700px) {
  #buttonleiste {
    display: none !important;
  }

  #mobile-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    position: relative;
    z-index: 100;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    background: #000099;
  }

  #mobile-nav a {
    display: block;
    padding: 9px 4px;
    border: 1px solid rgba(255,255,255,.55);
    color: #fff;
    background: #000099;
    font: bold 15px Arial, Helvetica, sans-serif;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
  }

  /* Die Bilderleiste beginnt unter der mobilen Navigation. */
  #Foto_01, #Foto_02, #Foto_03, #Foto_04, #Foto_05, #Foto_06, #Foto_07,
  #Foto_08, #Foto_09, #Foto_10, #Foto_11, #Foto_12, #Foto_13 {
    top: 205px !important;
  }

  #contentScroller {
    top: 310px !important;
  }
}


/* Handy: Rodenstock-Farbschema nach der historischen Fahrzeuglackierung.
   Weiß bleibt die Grundfarbe; Gelb, Rot und Blau bilden den Farbstreifen. */
@media screen and (max-width: 700px) {
  #mobile-nav {
    background: #ffffff !important;
    border-bottom: 0 !important;
    position: relative !important;
    padding-bottom: 15px !important;
  }

  #mobile-nav::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 10px;
    background:
      linear-gradient(
        to bottom,
        #f2c500 0,
        #f2c500 3px,
        #ffffff 3px,
        #ffffff 4px,
        #d71920 4px,
        #d71920 7px,
        #ffffff 7px,
        #ffffff 8px,
        #003f7d 8px,
        #003f7d 10px
      );
  }

  #mobile-nav a {
    background: #ffffff !important;
    color: #111111 !important;
    border: 1px solid #003f7d !important;
    border-radius: 3px;
  }

  #mobile-nav a:active {
    background: #f2c500 !important;
  }

  /* Durch den Farbstreifen wird die Navigation etwas höher:
     Bilder und Text entsprechend nach unten setzen. */
  #Foto_01, #Foto_02, #Foto_03, #Foto_04, #Foto_05, #Foto_06, #Foto_07,
  #Foto_08, #Foto_09, #Foto_10, #Foto_11, #Foto_12, #Foto_13 {
    top: 215px !important;
  }

  #contentScroller {
    top: 320px !important;
  }
}


/* Handy: mehr Rodenstock-Farbe in den acht Navigationsfeldern.
   1–4 weiß, 5–6 gelb, 7–8 rot. */
@media screen and (max-width: 700px) {
  #mobile-nav a:nth-child(-n+4) {
    background: #ffffff !important;
    color: #111111 !important;
  }

  #mobile-nav a:nth-child(5),
  #mobile-nav a:nth-child(6) {
    background: #f2c500 !important;
    color: #111111 !important;
  }

  #mobile-nav a:nth-child(7),
  #mobile-nav a:nth-child(8) {
    background: #d71920 !important;
    color: #ffffff !important;
  }
}


/* Kompakter Handy-Kopf: historische Siegerkranz-/Flaggen-Grafik,
   direkt gefolgt von der Navigation. */
#mobile-brand {
  display: none;
}

@media screen and (max-width: 700px) {
  #mobile-brand {
    display: block !important;
    position: relative;
    width: 100%;
    height: 82px;
    overflow: hidden;
    box-sizing: border-box;
    background:
      url("../Bilder/mobile-header-rodenstock.jpg") center top / cover no-repeat;
    border-bottom: 2px solid #ffffff;
  }

  #mobile-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(to bottom,
        rgba(255,255,255,.10) 0%,
        rgba(255,255,255,.02) 55%,
        rgba(255,255,255,.18) 100%);
    pointer-events: none;
  }

  .mobile-brand-title {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    top: 7px;
    padding: 0 8px;
    color: #ffffff;
    font: italic 900 24px/1 Arial, Helvetica, sans-serif;
    letter-spacing: 1px;
    text-align: center;
    text-shadow:
      -1px -1px 0 #123,
       1px -1px 0 #123,
      -1px  1px 0 #123,
       1px  1px 0 #123,
       0 2px 3px rgba(0,0,0,.55);
    box-sizing: border-box;
  }

  /* Menü dichter an den Kopf rücken und etwas flacher machen. */
  #mobile-nav {
    margin: 0 !important;
    padding: 6px 8px 10px !important;
    gap: 5px !important;
    background: #ffffff !important;
  }

  #mobile-nav a {
    min-height: 0 !important;
    padding: 7px 4px !important;
    font-size: 14px !important;
    line-height: 1.15 !important;
  }

  /* Rodenstock-Farbfolge zeilenweise: Weiß, Gelb, Rot, Blau. */
  #mobile-nav a:nth-child(1),
  #mobile-nav a:nth-child(2) {
    background: #ffffff !important;
    color: #111111 !important;
  }

  #mobile-nav a:nth-child(3),
  #mobile-nav a:nth-child(4) {
    background: #f2c500 !important;
    color: #111111 !important;
  }

  #mobile-nav a:nth-child(5),
  #mobile-nav a:nth-child(6) {
    background: #d71920 !important;
    color: #ffffff !important;
  }

  #mobile-nav a:nth-child(7),
  #mobile-nav a:nth-child(8) {
    background: #003f7d !important;
    color: #ffffff !important;
  }

  /* Der separate Mini-Farbstreifen wird nicht mehr benötigt,
     weil das Menü selbst jetzt die komplette Lackierung trägt. */
  #mobile-nav::after {
    display: none !important;
  }

  /* Wegen des kompakten Kopfes Bilder und Inhalt passend platzieren. */
  #Foto_01, #Foto_02, #Foto_03, #Foto_04, #Foto_05, #Foto_06, #Foto_07,
  #Foto_08, #Foto_09, #Foto_10, #Foto_11, #Foto_12, #Foto_13 {
    top: 252px !important;
  }

  #contentScroller {
    top: 357px !important;
  }
}


/* FIX: Auf dem Handy die beiden alten Desktop-Kopfebenen komplett ausblenden.
   Sie lagen mit hohem z-index über dem neuen mobilen Header. */
@media screen and (max-width: 700px) {
  #nockenleiste,
  #bmwleiste {
    display: none !important;
  }

  #mobile-brand {
    z-index: 40 !important;
  }
}


/* Originale Kennzeichen-Buttons der Homepage in der Handy-Navigation */
@media screen and (max-width: 700px) {
  #mobile-nav {
    padding: 5px 8px 8px !important;
    gap: 4px 6px !important;
  }

  #mobile-nav a {
    height: 38px !important;
    min-height: 0 !important;
    padding: 3px 5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  #mobile-nav a img {
    display: block !important;
    width: auto !important;
    height: 21px !important;
    max-width: 96% !important;
    object-fit: contain !important;
    border: 0 !important;
  }

  /* Rodenstock-Farbfolge: Weiß, Gelb, Rot, Blau */
  #mobile-nav a:nth-child(1),
  #mobile-nav a:nth-child(2) {
    background: #ffffff !important;
  }
  #mobile-nav a:nth-child(3),
  #mobile-nav a:nth-child(4) {
    background: #f2c500 !important;
  }
  #mobile-nav a:nth-child(5),
  #mobile-nav a:nth-child(6) {
    background: #d71920 !important;
  }
  #mobile-nav a:nth-child(7),
  #mobile-nav a:nth-child(8) {
    background: #003f7d !important;
  }
}


/* KORREKTUR: Die neue Headergrafik enthält die Überschrift bereits.
   Deshalb die zusätzliche HTML-Schrift ausblenden – keine Doppelung mehr. */
@media screen and (max-width: 700px) {
  #mobile-brand {
    height: 82px !important;
    background-image: url("../Bilder/mobile-header-rodenstock.jpg") !important;
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
  }

  .mobile-brand-title {
    display: none !important;
  }

  /* Startseiten-Titel bewusst als kompakter Zweizeiler. */
  #contentScroller h1 {
    font-size: 25px !important;
    line-height: 1.16 !important;
    margin: 8px 0 18px !important;
  }

  #contentScroller h1 .mobile-title-line {
    display: block !important;
    white-space: nowrap !important;
  }
}


/* FINALER kompakter Handy-Kopf mit originalem SCHNITZER-Vektorlogo */
@media screen and (max-width: 700px) {
  #mobile-brand {
    height: 66px !important;
    background-image: url("../Bilder/mobile-header-rodenstock.jpg") !important;
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
  }

  .mobile-brand-title {
    display: none !important;
  }

  /* Originale Kennzeichen-Buttons kompakter, damit mehr Website sichtbar bleibt */
  #mobile-nav {
    padding: 4px 8px 6px !important;
    gap: 4px 6px !important;
  }

  #mobile-nav a {
    height: 30px !important;
    min-height: 0 !important;
    padding: 2px 4px !important;
  }

  #mobile-nav a img {
    height: 18px !important;
    width: auto !important;
    max-width: 96% !important;
  }

  /* Laufende Bilder beginnen früher */
  #Foto_01, #Foto_02, #Foto_03, #Foto_04, #Foto_05, #Foto_06, #Foto_07,
  #Foto_08, #Foto_09, #Foto_10, #Foto_11, #Foto_12, #Foto_13 {
    top: 218px !important;
  }

  #contentScroller {
    top: 323px !important;
  }

  /* Willkommen bewusst kleiner und fest zweizeilig */
  #contentScroller h1 {
    font-size: 22px !important;
    line-height: 1.16 !important;
    margin: 7px 0 16px !important;
  }

  #contentScroller h1 .mobile-title-line {
    display: block !important;
    white-space: nowrap !important;
  }
}


/* FINAL: Mikes eigener Header – Grafik unverändert verwenden */
@media screen and (max-width: 700px) {
  #mobile-brand {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1200 / 375 !important;
    background-image: url("../Bilder/Mobile_Webseite.png") !important;
    background-size: 100% 100% !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
  }

  .mobile-brand-title {
    display: none !important;
  }
}


/* FIX: Bildlaufleiste vollständig unter dem Menü anzeigen */
@media screen and (max-width: 700px) {
  #Foto_01, #Foto_02, #Foto_03, #Foto_04, #Foto_05, #Foto_06, #Foto_07,
  #Foto_08, #Foto_09, #Foto_10, #Foto_11, #Foto_12, #Foto_13 {
    top: 280px !important;
  }

  #contentScroller {
    top: 385px !important;
  }
}


/* KOMPAKTER: Kennzeichen-Menü direkt an den blauen Streifen anschließen */
@media screen and (max-width: 700px) {
  #mobile-nav {
    margin-top: -18px !important;
    position: relative !important;
    z-index: 50 !important;
  }

  /* Laufende Bilder und Inhalt gewinnen denselben Platz zurück */
  #Foto_01, #Foto_02, #Foto_03, #Foto_04, #Foto_05, #Foto_06, #Foto_07,
  #Foto_08, #Foto_09, #Foto_10, #Foto_11, #Foto_12, #Foto_13 {
    top: 262px !important;
  }

  #contentScroller {
    top: 367px !important;
  }
}


/* Fester Nach-oben-Knopf auf der mobilen Startseite */
#mobile-top-button {
  display: none;
}

@media screen and (max-width: 700px) {
  html {
    scroll-behavior: smooth;
  }

  #mobile-top-button {
    display: flex !important;
    position: fixed !important;
    right: 12px !important;
    bottom: 14px !important;
    width: 42px !important;
    height: 42px !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    background: rgba(0, 51, 128, 0.88) !important;
    color: #ffffff !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 23px !important;
    line-height: 1 !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.35) !important;
  }
}


/* Rodenstock-Nach-oben-Pfeil: weiß / gelb / rot auf Blau */
@media screen and (max-width: 700px) {
  #mobile-top-button {
    flex-direction: column !important;
    gap: 0 !important;
    padding: 3px 0 4px !important;
    background: #003f7d !important;
    border: 2px solid #ffffff !important;
  }

  #mobile-top-button .top-arrow {
    display: block !important;
    height: 10px !important;
    line-height: 10px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    margin: -1px 0 !important;
    text-shadow: 0 1px 1px rgba(0,0,0,.45) !important;
  }

  #mobile-top-button .top-arrow-white  { color: #ffffff !important; }
  #mobile-top-button .top-arrow-yellow { color: #ffd200 !important; }
  #mobile-top-button .top-arrow-red    { color: #e31b23 !important; }
}


/* MOBILE v04 – kleiner Nach-oben-Pfeil, Gelb-Rot-Blau auf Weiß */
@media screen and (max-width: 700px) {
  #mobile-top-button {
    width: 36px !important;
    height: 36px !important;
    right: 10px !important;
    bottom: 12px !important;
    padding: 2px 0 3px !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 0 !important;
    background: #ffffff !important;
    border: 2px solid #003f7d !important;
    border-radius: 50% !important;
  }
  #mobile-top-button .top-chevron {
    display: block !important;
    height: 8px !important;
    line-height: 8px !important;
    margin: -1px 0 !important;
    font-size: 15px !important;
    font-weight: bold !important;
  }
  #mobile-top-button .top-chevron-yellow { color: #ffd200 !important; }
  #mobile-top-button .top-chevron-red    { color: #e31b23 !important; }
  #mobile-top-button .top-chevron-blue   { color: #0055a4 !important; }
}
