/* ============================================================
   RoutenKnoten v0.5.111 – styles-desktop.css
   Desktop-/breite Ansicht: 800px und breiter, dreispaltiges Flex-Layout.

   REGEL: Alles was auf dem Desktop anders aussehen soll,
   steht HIER. Keine Abhängigkeit zu Mobil oder Tablet.
   Änderungen hier wirken sich NUR auf den Desktop aus.
   ============================================================ */

@media (min-width: 800px) {

  /* ----------------------------------------------------------
     LAYOUT: Ansichten-Höhe
     Kein Bottom-Nav auf dem Desktop → volle Viewport-Höhe.
  ---------------------------------------------------------- */

  .view {
    height: 100vh;
  }

  .view-map,
  #map {
    height: 100vh;
  }

  .view-map.active {
    display: block !important;
    height: 100vh !important;
  }


  /* ----------------------------------------------------------
     BODY & HTML: Desktop-Rahmen sauber aufsetzen
  ---------------------------------------------------------- */

  html,
  body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: linear-gradient(180deg, #e6f7fb 0%, #d7eff5 45%, #a9d89d 100%);
    overflow-x: hidden;
  }


  /* ----------------------------------------------------------
     BOTTOM NAVIGATION: Auf dem Desktop ausblenden
  ---------------------------------------------------------- */

  .bottom-nav {
    display: none !important;
  }


  /* ----------------------------------------------------------
     STARTSEITE
     Desktop: große ruhige Fläche, drei Button-Spalten,
     saubere Bildkarte ohne Scrollleisten.
  ---------------------------------------------------------- */

  /* Startseite ist nur sichtbar wenn .active gesetzt – verhindert
     dass sie die Karte überlagert wenn body.rk-map-active gesetzt ist. */
  .sm-start:not(.active) {
    display: none !important;
  }

  .sm-start.active {
    display: grid !important;
  }

  .sm-start {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    height: 100vh;
    margin: 0;
    padding: clamp(16px, 2.2vw, 32px);
    text-align: left;
    overflow-x: hidden;
    overflow-clip-margin: 36px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }

  /* Header-Karte: mit Außenabstand, Schatten kann frei auslaufen */
  .sm-start-card {
    width: 100%;
    max-width: none;
    padding: 28px 36px;
    margin: 8px 0 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    border-radius: 24px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
  }

  .sm-start-card h1 {
    font-size: clamp(32px, 3vw, 58px);
    margin: 0;
    line-height: 1.05;
  }

  .sm-start-card p {
    font-size: clamp(17px, 1.35vw, 26px);
    white-space: nowrap;
  }

  .sm-search-wrap {
    width: 100%;
    max-width: none;
    margin: 0 0 8px;
  }

  .sm-search input {
    font-size: 17px;
    padding: 15px 18px;
  }

  .sm-search button {
    min-width: 88px;
    font-size: 16px;
  }

  /* Desktop-Buttons: Flex, dreispaltig.
     Alle inneren Ecken bei 8px, Außenkanten der Reihe pillenförmig. */
  .sm-actions {
    width: 100%;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-content: flex-start;
    gap: 12px 8px;
    margin: 0;
  }

  .sm-action {
    flex: 0 0 calc((100% - 16px) / 3) !important;
    min-width: 0;
    font-size: clamp(15px, 1.15vw, 24px);
    padding: 15px clamp(16px, 2vw, 36px);
    min-height: 56px;
    text-align: left;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .10);
  }

  /* Linke Außenkante der Reihen */
  .sm-action:nth-child(1),
  .sm-action:nth-child(4),
  .sm-actions:not(:has(#installAppBtn:not(.hidden))) #appInfoBtn {
    border-top-left-radius: 50px !important;
    border-bottom-left-radius: 50px !important;
  }

  /* Rechte Außenkante der Reihen */
  .sm-action:nth-child(3),
  .sm-action:nth-child(6),
  .sm-actions:not(:has(#installAppBtn:not(.hidden))) #updateAppBtn {
    border-top-right-radius: 50px !important;
    border-bottom-right-radius: 50px !important;
  }

  /* Mittlere Buttons: alle vier Ecken bei 8px */
  .sm-action:nth-child(2),
  .sm-action:nth-child(5) {
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
  }

  .sm-action-red {
    border-color: rgba(220, 38, 38, .55);
  }

  /* Normalfall: Installieren ausgeblendet.
     Informationen und Update als Zweierreihe halbe Breite. */
  .sm-actions:not(:has(#installAppBtn:not(.hidden))) #appInfoBtn,
  .sm-actions:not(:has(#installAppBtn:not(.hidden))) #updateAppBtn {
    flex: 0 0 calc((100% - 8px) / 2) !important;
  }

  .sm-actions:not(:has(#installAppBtn:not(.hidden))) #appInfoBtn {
    border-top-left-radius: 50px !important;
    border-bottom-left-radius: 50px !important;
  }

  .sm-actions:not(:has(#installAppBtn:not(.hidden))) #updateAppBtn {
    border-top-right-radius: 50px !important;
    border-bottom-right-radius: 50px !important;
  }

  /* Wenn Installieren sichtbar ist, bleibt es die 7. Kachel */
  #installAppBtn:not(.hidden) {
    flex: 0 0 calc((100% - 16px) / 3) !important;
    border-top-left-radius: 50px !important;
    border-bottom-left-radius: 50px !important;
  }

  /* Fußbereich */
  .sm-login {
    width: 100%;
    min-height: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
    gap: 18px;
    overflow: visible;
  }

  .sm-login small {
    display: none !important;
  }

  /* Vorschaubild: Karte unten */
  .img-preview {
    order: 2;
    width: min(760px, 100%);
    max-height: min(260px, 30vh);
    margin: 10px auto 0;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .70);
    box-shadow: 0 14px 32px rgba(15, 23, 42, .18);
  }

  .img-preview img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: min(260px, 30vh);
    object-fit: cover;
    object-position: center;
  }


  /* ----------------------------------------------------------
     KARTE: Mobile-Toolbar ausblenden, Desktop-Toolbar anzeigen
  ---------------------------------------------------------- */

  .mobile-map-controls,
  .mobile-map-menu {
    display: none !important;
  }

  .desktop-map-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: var(--z-controls);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    max-width: 1120px;
    margin: 10px auto 0;
    padding: 8px;
    border-radius: 26px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    box-shadow: var(--panel-shadow);
  }

  .desktop-map-controls .chip {
    min-height: 38px;
  }


  /* ----------------------------------------------------------
     MODUS-UMSCHALTER (Rad / Wandern)
  ---------------------------------------------------------- */

  .mode-toggle-wrap {
    margin: -2px auto 4px;
  }

  .desktop-map-controls .mode-toggle-chip {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }


  /* ----------------------------------------------------------
     KARTE: Positions-Badge
  ---------------------------------------------------------- */

  .route-info-badge {
    top: 76px;
  }


  /* ----------------------------------------------------------
     SHEET / DIALOG
     Zweispaltiges Layout für Infotexte und Spende.
     Schwebendes Panel in der Bildschirmmitte.
  ---------------------------------------------------------- */

  .sheet {
    left: 50%;
    right: auto;
    bottom: 32px;
    transform: translateX(-50%);
    width: min(980px, calc(100vw - 48px));
    border-radius: 28px;
    padding: 28px;
  }

  .app-info-sheet {
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    padding-bottom: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .app-info-sheet::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .app-info-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  }

  .info-hero {
    grid-template-columns: 1fr auto;
  }

  /* Icon auf dem Desktop ausgeblendet */
  .info-hero-icon {
    display: none;
  }

  .donation-card img {
    width: min(100%, 300px);
    max-height: 300px;
  }

  /* Lizenz-Zeile: Abstand links auf Desktop */
  .license-note {
    margin-left: 0;
  }

  /* CC-Badge auf Desktop direkt in derselben Zeile halten */
  .cc-badge-link {
    display: inline-flex;
    margin-left: 10px;
    vertical-align: middle;
    white-space: nowrap;
  }

  .cc-badge {
    margin-top: 0;
    vertical-align: middle;
  }

  .sheet-grid {
    justify-content: flex-end;
    margin-top: 8px;
    transform: translateY(-1rem);
  }

  .sheet-grid button {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 190px;
    max-width: 280px;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
    border: 1px solid #d1d5db !important;
    background: #f1f5f9 !important;
    color: #1f2937 !important;
    font-weight: 700 !important;
  }


  /* ----------------------------------------------------------
     TOAST
     Oben zentriert (kommt aus styles.css), hier keine Änderung.
  ---------------------------------------------------------- */


  /* ----------------------------------------------------------
     NAVIGATIONS-STATUS
  ---------------------------------------------------------- */

  #navigationStatus {
    left: 24px;
    right: 24px;
    bottom: 16px;
  }

}
