/* tcm-tabbar.css — gemeinsame Bottom-Navigation für die TC Mahlow PWA
 *
 * WICHTIG: Diese Leiste ist NUR in der installierten PWA sichtbar
 * (@media (display-mode: standalone)). Im normalen Browser-Tab, im
 * WordPress-iFrame auf tc-mahlow.de usw. bleibt die Seite unverändert.
 *
 * Eingebunden identisch in: buchung, survey, work.
 * Aktiver Tab wird per JS anhand von location.hostname erkannt,
 * kein Server-State nötig.
 */

.tcm-tabbar {
  display: none; /* Default: unsichtbar außerhalb der installierten PWA */
}

@media (display-mode: standalone) {
  .tcm-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: #ffffff;
    border-top: 1px solid #dce8e0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  }

  /* Platz am Seitenende schaffen, damit Inhalte nicht hinter der Leiste verschwinden */
  body.tcm-has-tabbar {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0));
  }

  .tcm-tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px 6px;
    text-decoration: none;
    color: #6b8070;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    min-width: 0; /* erlaubt dem Flex-Item, kleiner als sein Inhalt zu werden, sonst greift die Overflow-Messung am Label nicht */
  }

  .tcm-tabbar-label {
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
  }

  .tcm-tabbar-icon {
    font-size: 1.35rem;
    line-height: 1;
  }

  .tcm-tabbar-item.is-active {
    color: #077407;
  }

  .tcm-tabbar-item.is-active .tcm-tabbar-icon {
    transform: translateY(-1px);
  }

  /* Kompakt-Modus: wird per JS gesetzt, wenn die Labels zusammen mit den
     Icons nicht mehr in eine Zeile passen (z. B. sehr schmales Display
     oder hochgestellte Browser-Schriftgröße). Zeigt dann nur die Icons,
     größer und vertikal zentriert, ohne Textzeile darunter. */
  .tcm-tabbar.is-compact .tcm-tabbar-item {
    flex-direction: row;
    padding: 10px 4px;
  }

  .tcm-tabbar.is-compact .tcm-tabbar-label {
    display: none;
  }

  .tcm-tabbar.is-compact .tcm-tabbar-icon {
    font-size: 1.55rem;
  }

  /* News-Badge: kleiner Punkt oben rechts am Icon, zeigt ungesehene/
     aktive News an. Per JS ein-/ausgeblendet (hidden-Attribut), reine
     visuelle Ergänzung ohne Modal oder Redirect. */
  .tcm-tabbar-icon {
    position: relative;
    display: inline-block;
  }

  .tcm-tabbar-news-dot {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c0392b;
    border: 1.5px solid #ffffff;
  }

  .tcm-tabbar-news-dot[hidden] {
    display: none;
  }
}
