/* ============================================================
   Sports Gym Witten — Mobile CSS
   Loaded AFTER styles.css — overrides allowed.
   Contains: responsive fixes, bottom nav, PWA standalone.
   ============================================================ */

/* ──────────────────────────────────────────────────────────────
   GLOBAL (no media query)
   GPU hint for marquee — avoids paint on every tick
   ────────────────────────────────────────────────────────────── */
.marquee__track {
  will-change: transform;
  transform: translateZ(0);
}

/* ──────────────────────────────────────────────────────────────
   OVERFLOW GUARD
   ────────────────────────────────────────────────────────────── */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ──────────────────────────────────────────────────────────────
   max-width: 768px  (tablet / large phone)
   ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Global density */
  :root {
    --section-py: 5rem;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  /* Hero */
  .hero__stats > div {
    padding: 1rem;
  }

  /* Benefits */
  .benefits__stripe {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .benefits__word {
    font-size: clamp(2.5rem, 7vw, 5rem);
  }

  .benefits__script {
    font-size: clamp(1.75rem, 4vw, 3.5rem);
  }

  /* Support */
  .support__grid {
    gap: 2rem;
  }

  /* Community */
  .community__cards {
    grid-template-columns: 1fr;
  }

  /* Kids — stack all 3 cards (Kickboxen Kids / Jugend / Probetraining) */
  .kids__groups {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Membership plans — one price box per row (4 stacked) */
  .allin__grid {
    grid-template-columns: 1fr;
  }

  /* ChatBot FAB — float above bottom nav */
  .chatbot-fab {
    bottom: calc(64px + env(safe-area-inset-bottom) + 16px);
  }

  /* ChatBot window — open above bottom nav */
  .chatbot {
    bottom: calc(64px + env(safe-area-inset-bottom) + 80px);
  }

  /* Footer — extra bottom padding so last content isn't hidden */
  .footer {
    padding-bottom: calc(64px + env(safe-area-inset-bottom) + 1rem);
  }

  /* Body — scrollable area clears the bottom nav */
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
}

/* ──────────────────────────────────────────────────────────────
   max-width: 540px
   ────────────────────────────────────────────────────────────── */
@media (max-width: 540px) {

  .menu__foot {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-top: 1rem;
  }
}

/* ──────────────────────────────────────────────────────────────
   max-width: 480px  (small phones)
   ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {

  /* Display / Bebas headline */
  .display {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 0.9;
    letter-spacing: -0.01em;
  }

  /* CTA buttons */
  .btn {
    padding: 0.9rem 1rem;
    font-size: 12px;
    letter-spacing: 0.08em;
    min-height: 44px;
  }

  /* Marquee ticker */
  .marquee__track {
    font-size: clamp(1.5rem, 4vw, 3rem);
  }

  /* Kursplan mobile handling lives in the dedicated <=880px block at the
     end of this file (day-grouped .kursplan__mobile replaces the row-major
     desktop table, which is hidden). */

  /* Probetraining modal */
  .pt-modal {
    padding: 2rem 1.25rem 1.5rem;
  }

  .pt-close {
    width: 42px;
    height: 42px;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 1.2rem;
  }

  /* Full-screen overlay menu */
  .menu__item-label {
    font-size: clamp(1.8rem, 8vw, 7.5rem);
  }

  /* Burger — tap target */
  .burger {
    padding: 0.7rem 0.85rem;
    min-height: 44px;
  }

  /* Footer social — tap targets */
  .footer__social a {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Öffnungszeiten: full width so times don't wrap (mobile only) */
  .footer__col--hours {
    grid-column: 1 / -1;
  }
  .footer__col--hours ul li {
    white-space: nowrap;
  }
}


/* ============================================================
   BOTTOM NAVIGATION
   z-index 180: above nav (100) and chatbot (150), below
   fullscreen menu (200), probetraining modal (2000) and
   preloader (9999) — so opening the menu/modal covers the bar.
   Hidden on desktop via display:none default.
   ============================================================ */

.mobile-nav {
  display: none;
}

@media (max-width: 768px) {

  .mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 180;
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Individual item (button/div) */
  .mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    position: relative; /* anchor for .is-active::after indicator dot */
    height: 64px;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: rgba(245, 244, 240, 0.45);
    font-family: var(--f-body, sans-serif);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 160ms ease;
  }

  .mobile-nav__item:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
  }

  .mobile-nav__item svg {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  /* Hover / active states */
  .mobile-nav__item:hover,
  .mobile-nav__item.is-active {
    color: var(--ink);
  }

  /* Active state indicator dot */
  .mobile-nav__item.is-active {
    color: var(--red);
  }

  .mobile-nav__item.is-active::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--red);
  }

  /* ── Center CTA: Probetraining ─────────────────────────────── */
  /* Supports both .mobile-nav__cta (legacy) and .mobile-nav__item--cta (current) */
  .mobile-nav__cta,
  .mobile-nav__item--cta {
    flex: 1.2;
    position: relative;
    top: -10px;
    color: rgba(245, 244, 240, 0.7);
  }

  /* No active-dot on CTA */
  .mobile-nav__item--cta::after {
    display: none;
  }

  /* White circle with red fist icon inside */
  .mobile-nav__cta-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(225, 29, 46, 0.5);
    transition: background 160ms ease, transform 120ms ease,
                box-shadow 160ms ease;
    flex-shrink: 0;
    margin-bottom: 2px;
  }

  /* The fist SVG fill is var(--red) — set on the SVG element in JSX */
  .mobile-nav__cta-circle svg {
    width: 28px;
    height: 28px;
  }

  /* Label repositioned to compensate vertical offset */
  .mobile-nav__cta .mobile-nav__label,
  .mobile-nav__item--cta .mobile-nav__label {
    position: relative;
    top: 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--red);
  }

  .mobile-nav__cta:hover .mobile-nav__cta-circle,
  .mobile-nav__cta:active .mobile-nav__cta-circle,
  .mobile-nav__item--cta:hover .mobile-nav__cta-circle,
  .mobile-nav__item--cta:active .mobile-nav__cta-circle {
    background: var(--red-bright);
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(225, 29, 46, 0.65);
  }
}


/* ============================================================
   PWA STANDALONE MODE
   Installed on home screen: hide dev tooling, account for
   iOS status bar safe-area at the top.
   ============================================================ */
@media (display-mode: standalone) {

  /* Tweaks panel is dev tooling — not relevant in production app */
  .twk-panel {
    display: none !important;
  }

  /* Add top safe-area for iOS notch / dynamic island */
  .nav {
    padding-top: env(safe-area-inset-top);
  }

  /* Ensure bottom safe-area is always respected */
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .mobile-nav {
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============================================================
   KURSPLAN — mobile day-grouped layout (<=880px)
   Desktop .kursplan__table is row-major (1 header row + 3 slot
   rows) and collapses unusably to "all days, then all slots" on
   one column. Hide it; show the day-major .kursplan__mobile block
   instead: each day header followed by that day's courses.
   880px matches the existing styles.css kursplan collapse breakpoint.
   ============================================================ */
.kursplan__mobile { display: none; }

@media (max-width: 880px) {
  .kursplan__table { display: none; }

  .kursplan__mobile {
    display: block;
    border: 1px solid var(--rule);
    background: var(--bg);
    overflow: hidden;
  }

  .kursplan__mgroup { border-bottom: 1px solid var(--rule); }
  .kursplan__mgroup:last-child { border-bottom: 0; }

  /* Day header full-width */
  .kursplan__mobile .kursplan__day {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  /* Slots stack under their day header, full-width, no side borders */
  .kursplan__mobile .kursplan__slot {
    width: 100%;
    border-right: 0;
    border-top: 0;
    border-bottom: 1px solid var(--rule);
    min-height: auto;
    padding: 1rem 1.25rem;
  }
  .kursplan__mgroup .kursplan__slot:last-child { border-bottom: 0; }

  /* Touch: always show the "+" add affordance (no hover on mobile) */
  .kursplan__mobile .kursplan__slot .add {
    opacity: 1;
    color: var(--red);
  }
}
