/* FIT24 - Responsive (Tablet & Mobile) */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .hero-content { padding: 0 30px; }
  .section-title { font-size: clamp(2.5rem, 6vw, 4rem); }
  .about { grid-template-columns: 1fr; gap: 50px; }
  /* About badge: small corner stamp when About stacks (full-width image) */
  .about-visual .about-badge {
    bottom: 12px;
    right: 8px;
    max-width: 92px;
    padding: 5px 7px 6px;
    clip-path: polygon(4px 0%, 100% 0%, 100% 100%, 0 100%, 0 4px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.24);
    box-sizing: border-box;
  }
  .about-visual .about-badge-num { font-size: 1.05rem; }
  .about-visual .about-badge-text {
    font-size: 7px;
    letter-spacing: 0.4px;
    line-height: 1.1;
  }
  .classes-grid { grid-template-columns: repeat(2, 1fr); }
  .classes-grid.classes-grid--four { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .classes-section--photo .classes-grid--four { padding: 0 20px 56px; }
  .pricing-header { padding: 60px 40px 0; }
  .pricing-body { padding: 0 40px 60px; }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .hero-title { font-size: clamp(4rem, 10vw, 8rem); }
}

/* Tablet (max-width: 768px) */
@media (max-width: 768px) {
  body { cursor: default; scroll-padding-top: 10px !important; }
  html { scroll-padding-top: 10px !important; }
  a, button, input, select { cursor: pointer; }

  /* Mobile navbar: semi-transparent dark background + blur for contrast */
  .navbar-fit24 {
    padding-left: 1rem; padding-right: 1rem;
    background: rgba(5, 5, 5, 0.88) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .navbar-fit24.scrolled {
    background: rgba(5, 5, 5, 0.96) !important;
  }
  .navbar-fit24 .container-fluid { padding-left: 0; padding-right: 0; }
  .navbar-fit24 .navbar-brand { margin-right: 0.5rem; }
  .navbar-fit24 .navbar-brand img { height: 50px !important; }
  /* Hamburger: white border and icon, rounded button */
  .navbar-fit24 .navbar-toggler {
    padding: 0.5rem 0.75rem; margin-left: auto;
    border: 2px solid white;
    background: rgba(0, 0, 0, 0.25);
  }
  .navbar-fit24 .navbar-toggler:hover {
    border-color: white;
    background: rgba(0, 0, 0, 0.4);
  }
  .navbar-fit24 .navbar-toggler-icon {
    filter: brightness(0) invert(1);
  }
  /* Full-width dropdown panel when menu is open – dark background, no overlap with hero */
  .navbar-fit24 .navbar-collapse {
    padding-top: 0; padding-bottom: 0;
    margin-left: -1rem; margin-right: -1rem;
    margin-top: 0.75rem;
    background: transparent;
  }
  .navbar-fit24 .navbar-collapse.show {
    background: rgba(5, 5, 5, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.25rem 1rem 1.75rem;
    margin-left: -1rem;
    margin-right: -1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
  .navbar-fit24 .navbar-collapse .navbar-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .navbar-fit24 .navbar-collapse .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .navbar-fit24 .navbar-collapse .nav-item:last-of-type { border-bottom: none; }
  /* Vertical spacing for touch-friendly links */
  .navbar-fit24 .nav-link {
    padding: 0.85rem 1rem !important;
    font-size: 0.9rem;
    letter-spacing: 2px;
  }

  .hero {
    min-height: 100svh; min-height: 100dvh;
    padding-top: 120px; padding-bottom: 56px;
    flex-direction: column; align-items: center; justify-content: flex-start;
  }
  /* Tablet: neon FIT24 neatly visible */
  .hero-bg { background-position: 15% 50%; background-size: cover; }
  .hero-content {
    padding: 0 1.5rem; margin-top: 0; max-width: 100%;
    text-align: center; display: flex; flex-direction: column; align-items: center;
  }
  .hero-title {
    font-size: clamp(2.5rem, 11vw, 5rem);
    line-height: 0.95; text-align: center; margin-bottom: 1.25rem;
    letter-spacing: 1px;
  }
  .hero-sub {
    font-size: clamp(0.95rem, 2.5vw, 1rem); max-width: 100%; text-align: center;
    margin-left: auto; margin-right: auto; margin-bottom: 1.75rem;
    line-height: 1.6;
  }
  .hero-actions {
    display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem;
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost { max-width: 280px; }
  .hero-stats {
    position: relative; bottom: auto; right: auto; margin-top: 2.5rem; padding: 0 0.5rem;
    display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: stretch;
    gap: 0.5rem; animation: none; opacity: 1;
    width: 100%; max-width: 100%; margin-left: auto; margin-right: auto;
  }
  .stat { text-align: center; flex: 1 1 0; min-width: 0; }
  .stat-num { font-size: clamp(1.35rem, 4.5vw, 2rem); }
  .stat-num span { font-size: clamp(0.9rem, 3.2vw, 1.25rem); }
  .stat-label { margin-top: 0.25rem; letter-spacing: 1px; font-size: 0.62rem; line-height: 1.25; }
  .scroll-hint { display: none; }
  .ticker { font-size: 8rem; }

  section { padding: 64px 20px; }
  .trainers-section { padding-top: 100px; padding-bottom: 64px; }
  .section-title { font-size: clamp(2rem, 8vw, 3rem); margin-bottom: 40px; }
  .marquee-track span { font-size: 0.9rem; padding: 0 20px; }

  .about { gap: 40px; }
  .about-visual { aspect-ratio: 4/3; }
  .about-visual-inner--facility {
    background-position: 50% 30%;
  }
  /* Micro corner badge — minimal footprint on photo */
  .about-visual .about-badge {
    right: 6px;
    bottom: 6px;
    max-width: min(64px, 18vw);
    padding: 3px 5px 4px;
    clip-path: polygon(2px 0%, 100% 0%, 100% 100%, 0 100%, 0 2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    box-sizing: border-box;
    transform: scale(0.96);
    transform-origin: bottom right;
  }
  .about-visual .about-badge-num {
    font-size: 0.78rem;
    line-height: 1;
  }
  .about-visual .about-badge-text {
    font-size: 6px;
    letter-spacing: 0.25px;
    line-height: 1.1;
    margin-top: 1px;
  }
  .features-grid { grid-template-columns: 1fr; }

  .classes-grid { grid-template-columns: 1fr; }
  .classes-grid.classes-grid--four { grid-template-columns: 1fr; gap: 18px; }
  .classes-section--photo .classes-grid--four { padding: 0 16px 56px; }
  .classes-section--photo .classes-section__head { padding-left: 20px !important; padding-right: 20px !important; }
  .classes-scroll-anchor,
  .arena-scroll-anchor,
  .trainers-scroll-anchor {
    scroll-margin-top: 76px;
  }
  .class-card { aspect-ratio: 16/9; }
  .classes-grid--four .class-card { aspect-ratio: 4/5; min-height: 300px; }
  .class-card-content { padding: 20px; }
  .class-card-icon { font-size: 1.8rem; margin-bottom: 8px; }
  .class-name { font-size: 1.5rem; }
  .class-desc { font-size: 0.8rem; max-width: 100%; }

  .pricing-header { padding: 48px 20px 0; }
  .pricing-body { padding: 0 20px 56px; }
  .pricing-grid { grid-template-columns: 1fr; gap: 20px; max-width: 420px; margin-left: auto; margin-right: auto; }
  .plan-card { padding: 28px 24px; min-height: 0; }
  .plan-card .plan-label { margin-bottom: 12px; }
  .plan-card .plan-period { margin-bottom: 20px; }
  .plan-card .plan-features { margin-bottom: 24px; }
  .plan-card .plan-features li { padding: 10px 0; font-size: 0.85rem; }
  .recommended-plan { transform: none; box-shadow: 0 8px 32px rgba(253, 224, 71, 0.25); }
  .plan-card:hover { transform: none; }
  .plan-price { font-size: 4rem; }

  .testi-section { padding: 80px 24px; }
  /* Carousel arrows: padding >= inset + button width; allow for hover scale (12 + 56×1.08 ≈ 72) */
  .testi-carousel-wrapper { padding: 0 74px; }
  .testi-card { flex: 0 0 calc(50% - 12px); min-width: calc(50% - 12px); padding: 28px 24px; }

  .cta-section { padding: 64px 20px; }
  .cta-actions { flex-direction: column; align-items: center; }
  .cta-actions .btn-white { max-width: 280px; width: 100%; text-align: center; }
  .hero-actions .btn-primary { width: auto; min-width: 160px; text-align: center; }
  .hero-actions .btn-ghost { width: auto; }
  .btn-white, .btn-primary { text-align: center; }

  #contact { padding: 64px 20px !important; }
  #contact > div:last-child {
    display: grid !important; grid-template-columns: 1fr !important; gap: 20px !important;
    max-width: 100% !important; margin: 0 !important;
  }
  #contact > div:last-child > a { display: block !important; width: 100% !important; }
  #contact > div:last-child > div,
  #contact > div:last-child > a > div { height: auto !important; padding: 32px 24px !important; }

  /* Symmetric horizontal padding — FAB is fixed; extra padding-right made lines look left-aligned */
  footer {
    padding: 48px 20px 24px;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
  }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; margin-bottom: 40px; }
  .footer-brand p { max-width: 100%; }
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding-top: 24px;
    padding-bottom: max(80px, calc(env(safe-area-inset-bottom, 0px) + 72px));
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .footer-bottom span {
    display: block;
    width: 100%;
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
  .footer-col ul li { margin-bottom: 18px; }

  .chat-window {
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    bottom: 88px !important;
    max-height: calc(100svh - 120px) !important;
    border-radius: 16px !important;
  }
  .chat-window__inner { padding: 20px !important; }
  .chat-toggle { bottom: 20px !important; right: 20px !important; width: 52px !important; height: 52px !important; }
  .chat-toggle i { font-size: 26px !important; }

  .arena-section { padding: 64px 15px !important; }
  .arena-header { padding: 0 20px; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
  .arena-carousel-wrapper { padding: 0 20px; }
  .arena-nav-btn--side { display: none; }
  .arena-nav-bottom { display: flex; justify-content: center; gap: 16px; padding: 20px 0 0; margin-top: 8px; }
  .arena-nav-btn--bottom { position: static; transform: none; width: auto; min-width: 120px; height: 48px; padding: 0 24px; font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 0.85rem; letter-spacing: 1px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .arena-nav-btn--bottom i { margin: 0 6px; font-size: 0.8rem; }
  .arena-item { flex: 0 0 260px; width: 260px; min-width: 260px; }
  .gallery-lightbox__close { top: 16px; right: 16px; width: 48px; height: 48px; font-size: 1.2rem; }
  .gallery-lightbox__nav { width: 48px; height: 48px; font-size: 1rem; }
  .gallery-lightbox__nav--prev { left: 12px; }
  .gallery-lightbox__nav--next { right: 12px; }

  .schedule-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .day-btn { padding: 8px 14px; font-size: 0.65rem; }
  .schedule-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .schedule-table th, .schedule-table td { padding: 12px 16px; white-space: nowrap; }

  .modal-content { padding: 28px 20px; }
  .modal-title { font-size: 2rem; }
}

/* Small mobile (max-width: 480px) */
@media (max-width: 480px) {
  /* Navbar: same semi-transparent + blur; compact logo and toggle */
  .navbar-fit24 { padding-left: 1rem; padding-right: 1rem; }
  .navbar-fit24 .navbar-brand img { height: 44px !important; }
  .navbar-fit24 .navbar-toggler { padding: 0.45rem 0.6rem; }
  .navbar-fit24 .navbar-collapse.show { padding: 1rem 1rem 1.5rem; }
  .navbar-fit24 .nav-link { padding: 0.8rem 1rem !important; }
  .trainers-section { padding-top: 96px; padding-bottom: 48px; }

  .hero {
    padding-top: 100px; padding-bottom: 52px;
    min-height: 100svh; min-height: 100dvh;
    justify-content: flex-start;
  }
  /* Mobile: neon FIT24 neatly visible */
  .hero-bg { background-position: 14% 50%; background-size: cover; }
  .hero-content { padding: 0 1.25rem; }
  .hero-title {
    font-size: clamp(2.25rem, 13vw, 3.75rem);
    line-height: 0.95; margin-bottom: 1rem;
    letter-spacing: 0.5px;
  }
  .hero-sub {
    font-size: clamp(0.875rem, 2.5vw, 0.95rem);
    margin-bottom: 1.5rem; line-height: 1.6;
  }
  .hero-actions {
    flex-direction: column; align-items: center; gap: 0.75rem;
    width: 100%; max-width: 280px; margin-left: auto; margin-right: auto;
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost {
    width: 100%; max-width: 260px; padding: 1rem 1.5rem; font-size: 0.75rem;
    text-align: center; display: block;
  }
  .hero-stats {
    flex-direction: row; flex-wrap: nowrap; justify-content: space-between; align-items: stretch;
    gap: 0.35rem; margin-top: 2rem; padding: 0 0.35rem;
    max-width: 100%; width: 100%;
  }
  .stat { text-align: center; min-width: 0; flex: 1 1 0; }
  .stat-num { font-size: clamp(1.2rem, 5.5vw, 1.65rem); }
  .stat-num span { font-size: clamp(0.78rem, 3.8vw, 1.05rem); }
  .stat-label { font-size: 0.52rem; margin-top: 0.2rem; letter-spacing: 0.8px; line-height: 1.2; }

  .section-title { font-size: clamp(2rem, 11vw, 2.8rem); }
  .pricing-header { padding: 40px 16px 0; }
  .pricing-body { padding: 0 16px 48px; }
  .pricing-grid { max-width: 100%; gap: 16px; }
  .plan-card { padding: 24px 20px; }
  .plan-card .plan-label { margin-bottom: 10px; }
  .plan-card .plan-period { margin-bottom: 16px; }
  .plan-card .plan-features { margin-bottom: 20px; }
  .plan-card .plan-features li { padding: 8px 0; font-size: 0.82rem; }
  .plan-price { font-size: 3.5rem; }
  .marquee-track span { font-size: 0.85rem; padding: 0 16px; }
  .about-visual .about-badge {
    right: 5px;
    bottom: 5px;
    max-width: min(56px, 16vw);
    padding: 2px 4px 3px;
    clip-path: polygon(2px 0%, 100% 0%, 100% 100%, 0 100%, 0 2px);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.22);
    transform: scale(0.92);
    transform-origin: bottom right;
  }
  .about-visual .about-badge-num { font-size: 0.7rem; }
  .about-visual .about-badge-text {
    font-size: 6px;
    letter-spacing: 0.2px;
    margin-top: 0;
    line-height: 1.05;
  }
  .arena-carousel-wrapper { padding: 0 16px; }
  .arena-nav-btn--bottom { min-width: 100px; height: 44px; padding: 0 20px; font-size: 0.8rem; }
  .arena-item { flex: 0 0 240px; width: 240px; min-width: 240px; }
  .gallery-lightbox__content { max-width: 96vw; max-height: 88vh; padding: 56px 12px 12px; }
  .gallery-lightbox__close { top: 12px; right: 12px; width: 44px; height: 44px; font-size: 1.1rem; }
  .gallery-lightbox__nav { width: 44px; height: 44px; font-size: 0.95rem; }
  .gallery-lightbox__nav--prev { left: 8px; }
  .gallery-lightbox__nav--next { right: 8px; }
  .testi-section { padding: 64px 16px; }
  /* 8px inset + 44px btn = 52; max(60px, safe+52) keeps arrows inside padded gutter vs overflow:hidden */
  .testi-carousel-wrapper {
    padding-left: max(60px, calc(env(safe-area-inset-left, 0px) + 52px));
    padding-right: max(60px, calc(env(safe-area-inset-right, 0px) + 52px));
  }
  /* 100% of track width — avoids 100vw ignoring section padding and overflowing under arrows */
  .testi-card { flex: 0 0 100%; min-width: 100%; max-width: 100%; width: 100%; padding: 24px 20px; box-sizing: border-box; }
  .testi-carousel-btn { width: 44px; height: 44px; font-size: 0.95rem; }
  .testi-carousel-btn--prev { left: 8px; }
  .testi-carousel-btn--next { right: 8px; }
}

/* Touch: no hover scale on testimonial arrows (prevents clipped/grown hit area) */
@media (max-width: 480px) and (hover: none) {
  .testi-carousel-btn:hover { transform: translateY(-50%); }
}

@media (max-width: 1024px) {
  .trainers-container { padding: 0 24px !important; }
  .trainer-img { aspect-ratio: 5/6; }
}
@media (max-width: 768px) {
  .trainers-container {
    padding-left: max(16px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(16px, env(safe-area-inset-right, 0px)) !important;
  }
  .trainers-section__head {
    padding-bottom: 24px;
  }
  .trainers-wrapper {
    margin-top: 4px;
    border-radius: 0;
  }
  .trainer-img {
    aspect-ratio: 4/5;
  }
  .trainer-info {
    padding: 15px 16px 17px;
  }
  .trainer-name {
    font-size: clamp(1.08rem, 4vw, 1.32rem);
  }
  .trainer-name::after {
    margin: 8px 0 9px;
    width: 28px;
  }
  .trainer-tagline {
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    line-height: 1.4;
    word-break: break-word;
    hyphens: auto;
  }
  /* Dot indicators: ~44px tap targets, visual pill stays centered */
  .trainers-dots {
    margin-top: 22px;
    margin-bottom: max(4px, env(safe-area-inset-bottom, 0px));
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 4px 0 8px;
  }
  .trainers-dot {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    background: transparent !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    vertical-align: middle;
    -webkit-tap-highlight-color: transparent;
  }
  .trainers-dot::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    transition: width 0.3s ease, border-radius 0.3s ease, background 0.3s ease;
  }
  .trainers-dot.active {
    width: 44px;
    background: transparent !important;
  }
  .trainers-dot.active::after {
    width: 28px;
    height: 8px;
    border-radius: 4px;
    background: #fde047;
  }
  .trainers-dot:focus-visible {
    outline: 2px solid rgba(253, 224, 71, 0.7);
    outline-offset: 2px;
  }
}
@media (max-width: 480px) {
  .trainers-container {
    padding-left: max(14px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(14px, env(safe-area-inset-right, 0px)) !important;
  }
  .trainer-img {
    aspect-ratio: 3/4;
  }
  .trainer-info {
    padding: 14px 15px 16px;
  }
  .trainer-tagline {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }
}
