/* =============================================================================
   SN SPORTS ARENA — MASTER RESPONSIVE PATCH SYSTEM (v2026.300)
   Universal Cross-Device Optimization from Smallest Mobile (320px) to 4K (2560px+)
   Guarantees: Zero Horizontal Overflow, No Cramped Text, Smooth Momentum Scrolls,
   Clean Stacking Grids, Accessible Touch Targets, and No Overlapping Floating UI.
   ============================================================================= */

/* ─── 1. GLOBAL VIEWPORT & OVERFLOW NORMALIZATION (320px to 4K) ─── */
html {
  overflow-x: clip !important;
  width: 100% !important;
  max-width: 100% !important;
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  scroll-behavior: smooth;
}

body {
  overflow-x: clip !important;
  width: 100% !important;
  max-width: 100% !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

*, *::before, *::after {
  box-sizing: border-box !important;
  min-width: 0;
}

img, video, iframe, canvas, svg {
  max-width: 100% !important;
  height: auto;
}

/* Background atmospheric orbs must never spill */
.bg-orb, .bg-orb-1, .bg-orb-2, .bg-orb-3, .bg-orb-4, footer::before {
  max-width: 100vw !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* ─── 2. CONTAINER BOUNDS & ULTRA-WIDE BALANCING (>= 1440px to 2560px+) ─── */
@media (min-width: 1440px) {
  .wrap,
  .container,
  .site-container,
  .arena-page-wrap,
  .nav-inner {
    max-width: 1380px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 92% !important;
  }
}

/* ─── 3. MOBILE NAVIGATION & HAMBURGER CONTRAST SYSTEM ─── */
#mobNavHamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  margin-left: auto;
  transition: all 0.22s ease;
  z-index: 10001;
}

#mobNavHamburger .ham-line {
  display: block;
  width: 20px;
  height: 2.2px;
  background: #FFFFFF !important;
  border-radius: 99px;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, width 0.2s ease;
}

/* When navbar is scrolled over white body content */
.nav.scrolled #mobNavHamburger {
  background: rgba(15, 46, 21, 0.08) !important;
  border-color: rgba(15, 46, 21, 0.18) !important;
}

.nav.scrolled #mobNavHamburger .ham-line {
  background: #0F2E15 !important;
}

@media (max-width: 900px) {
  #mobNavHamburger {
    display: flex !important;
  }
  .nav-pill-container,
  .nav-actions {
    display: none !important;
  }
  .nav-inner {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 16px !important;
  }
  .nav-brand img {
    height: clamp(34px, 5.5vw, 42px) !important;
    width: auto !important;
  }
}

/* ─── 4. UNIVERSAL FILTER & CATEGORY SCROLL TRACKS (MOBILE SWIPE) ─── */
@media (max-width: 768px) {
  .arena-filter-tabs,
  #arenaFilterTabs,
  .tourn-filter-tabs,
  .shop-filter-tabs,
  .branch-tabs-scroll,
  .branch-pill-strip,
  .media-filter-pills,
  .category-filter-bar,
  .slots-filter-track,
  .map-location-pills,
  #mapLocationPills {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 6px 4px 10px !important;
    gap: 8px !important;
  }

  .arena-filter-tabs::-webkit-scrollbar,
  #arenaFilterTabs::-webkit-scrollbar,
  .tourn-filter-tabs::-webkit-scrollbar,
  .shop-filter-tabs::-webkit-scrollbar,
  .branch-tabs-scroll::-webkit-scrollbar,
  .branch-pill-strip::-webkit-scrollbar,
  .map-location-pills::-webkit-scrollbar,
  #mapLocationPills::-webkit-scrollbar {
    display: none !important;
  }

  .arena-filter-btn,
  .tourn-filter-btn,
  .shop-filter-btn,
  .branch-tab-pill,
  .filter-pill,
  .map-pill-btn,
  .map-pill-btn-outline {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    padding: 8px 14px !important;
  }
}

/* ─── 5. PAGE-SPECIFIC ENHANCEMENTS ─── */

/* [A] CONTACT.HTML: HELPLINE & CONCIERGE CARDS */
.contact-desk-card {
  background: linear-gradient(145deg, #FFFFFF 0%, #FAFCF9 60%, #F1F7F3 100%);
  border: 1px solid rgba(15, 46, 21, 0.09);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 6px 20px rgba(15, 46, 21, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-desk-card h3 {
  word-break: normal !important;
  white-space: normal !important;
  line-height: 1.3 !important;
}

.contact-desk-phone {
  white-space: nowrap !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  color: var(--brand-forest);
}

@media (max-width: 640px) {
  .contact-desk-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    padding: 18px 16px !important;
  }
  
  .contact-desk-card > div:first-child {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .contact-desk-card .btn {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    min-height: 42px !important;
  }

  .contact-main-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* [B] CENTRES.HTML: VENUE CARD ADDRESS & LEAFLET MAP */
.venue-address-row {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.venue-address-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

@media (max-width: 640px) {
  .venue-address-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .venue-bullet-sep {
    display: none !important;
  }

  .venue-address-actions {
    display: flex !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .venue-directions-btn,
  .venue-copy-btn {
    flex: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 14px !important;
    font-size: 12px !important;
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(52, 211, 153, 0.35) !important;
    border-radius: 8px !important;
    color: #34D399 !important;
    text-decoration: none !important;
    min-height: 38px !important;
  }

  /* Safe margins for Leaflet map zoom controls */
  .leaflet-top.leaflet-left {
    top: 8px !important;
    left: 8px !important;
  }
}

/* Centres.html Sport Facility Row & Modals Mobile Optimization */
@media (max-width: 540px) {
  .sport-facility-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 11px 12px !important;
  }

  .sport-facility-row > .sport-facility-left {
    width: 100% !important;
  }

  .sport-facility-row > div:last-child {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }

  .sport-facility-row > div:last-child > a,
  .sport-facility-row > div:last-child > button {
    flex: 1 1 0% !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
    font-size: 11.5px !important;
  }

  .coach-modal-dialog,
  .modal-dialog,
  .modal-box,
  .trial-modal-box {
    max-width: 95vw !important;
    padding: 20px 16px !important;
    border-radius: 16px !important;
  }
}

/* [C] SHOP.HTML: 1-COLUMN PRODUCT GRID & SAFE CART FLOAT */
@media (max-width: 580px) {
  .products-grid,
  .shop-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .product-card {
    padding: 18px 16px !important;
  }

  .product-img-wrap {
    height: 190px !important;
  }

  .product-title {
    font-size: 1.15rem !important;
    line-height: 1.3 !important;
  }

  .btn-add-cart {
    padding: 13px !important;
    font-size: 13.5px !important;
    min-height: 44px !important;
  }
}

/* Move floating View Cart button to bottom-left on mobile to prevent WhatsApp collision */
@media (max-width: 768px) {
  .cart-float-btn {
    bottom: 14px !important;
    left: 14px !important;
    right: auto !important;
    padding: 11px 18px !important;
    font-size: 12.5px !important;
    box-shadow: 0 8px 24px rgba(15, 46, 21, 0.4) !important;
  }

  .floating-whatsapp-btn,
  .wa-float {
    bottom: 14px !important;
    right: 14px !important;
    left: auto !important;
    width: 48px !important;
    height: 48px !important;
  }
}

/* [D] COMPETITIONS.HTML: TOURNAMENT CARDS */
@media (max-width: 768px) {
  .tourn-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .tourn-card {
    padding: 20px 16px !important;
  }

  .tourn-specs-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 12px 10px !important;
  }
}

/* [E] PAY-AND-PLAY.HTML: RATE TABLE & BOOKING BOX */
.table-responsive {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(16, 185, 129, 0.4) transparent !important;
  margin-bottom: 20px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(15, 46, 21, 0.08) !important;
}

.rate-table {
  width: 100% !important;
  min-width: 540px !important;
}

@media (max-width: 768px) {
  .booking-spread-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .booking-result-box {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center !important;
    gap: 16px !important;
    padding: 20px 16px !important;
  }

  .booking-result-box .btn-hudle {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

/* [F] PORTAL.HTML: ANNOUNCEMENT BAR & PERSONA SWITCHER */
.portal-top-announcement {
  background: #081A0D;
  color: #FFFFFF;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
  margin-top: 76px; /* Offset fixed header */
  position: relative;
  z-index: 99;
}

@media (max-width: 768px) {
  .portal-top-announcement {
    margin-top: 60px;
    padding: 8px 0;
    font-size: 11px;
  }

  .portal-switcher-bar > .wrap > div:last-child {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .portal-card-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* [G] ABOUT.HTML: TIMELINE & STORY GRID */
@media (max-width: 768px) {
  .about-story-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}

/* ─── 6. ULTRA-COMPACT SMARTPHONES (<= 360px down to 320px) ─── */
@media (max-width: 360px) {
  .wrap,
  .container,
  .site-container,
  .arena-page-wrap {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  h1, .hero-title, .page-banner-title, .page-title {
    font-size: 1.45rem !important;
    line-height: 1.25 !important;
  }

  h2, .section-title, .step-heading {
    font-size: 1.25rem !important;
    line-height: 1.28 !important;
  }

  p, .hero-desc, .section-subtitle, .page-banner-sub {
    font-size: 13px !important;
    line-height: 1.55 !important;
  }

  .nav-brand img {
    height: 30px !important;
  }

  #mobNavHamburger {
    width: 38px !important;
    height: 38px !important;
  }

  .cart-float-btn {
    padding: 8px 14px !important;
    font-size: 11.5px !important;
  }

  .floating-whatsapp-btn {
    width: 42px !important;
    height: 42px !important;
    font-size: 20px !important;
  }
}
