/* ============================================================
   MOBILE RESPONSIVE — The Club Tennis
   Strategy: CSS classes override inline styles via !important
   Breakpoints: 768px (tablet/mobile), 480px (tight phone)
   ============================================================ */

/* Global safety net — prevent any rogue wide element from
   forcing the whole page to scroll horizontally on mobile.
   We don't want this on desktop (rules out sticky scroll bugs). */

/* --- NAV: hamburger (hidden on desktop) --- */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #F5F5F5;
  line-height: 1;
  font-size: 24px;
}

/* --- NAV: desktop links wrapper (flex on desktop, hidden on mobile) --- */
.nav-desktop-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* --- SLIDE-IN DRAWER --- */
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 86vw;
  background: #111111;
  border-left: 1px solid #2A2A2A;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

.nav-drawer.open {
  transform: translateX(0);
}

/* --- BACKDROP --- */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1050;
}

.nav-backdrop.open {
  display: block;
}

/* ============================================================
   @media MOBILE OVERRIDES (≤768px)
   ============================================================ */
@media (max-width: 768px) {

  /* Note: only body gets overflow-x:hidden. Setting it on html too breaks
     iOS Safari vertical scroll (known webkit bug). */
  body {
    overflow-x: hidden !important;
  }

  /* ---- NAVIGATION ---- */
  .nav-hamburger { display: block; }
  .nav-desktop-links { display: none !important; }

  /* Reduce the nav side padding so the hamburger sits flush */
  nav { padding: 0 20px !important; }

  /* ---- FOOTER ---- */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* User wants no nav links at the bottom — strip Quick Links + Programs columns */
  .footer-links-col { display: none !important; }

  .footer-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
    padding: 20px 0 !important;
  }

  .footer-newsletter {
    width: 100% !important;
  }
  .footer-newsletter input {
    flex: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    font-size: 16px !important;
  }

  footer {
    padding: 48px 20px 0 !important;
  }

  /* ---- HERO (HomePage) ---- */
  .hero-section {
    display: block !important;
    height: 100vh !important;
    padding: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }

  .hero-image-bg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    max-height: none !important;
    background: #1A1A1A !important;
  }

  .hero-image-bg img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
  }

  .hero-content {
    position: relative !important;
    z-index: 2 !important;
    padding: 96px 20px 40px !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    background: linear-gradient(
      to top,
      rgba(10, 10, 10, 0.97) 0%,
      rgba(10, 10, 10, 0.75) 45%,
      rgba(10, 10, 10, 0.2) 100%
    ) !important;
  }

  .hero-heading {
    font-size: 42px !important;
    letter-spacing: -1.5px !important;
    margin-bottom: 16px !important;
  }

  .hero-sub {
    font-size: 16px !important;
    margin-bottom: 24px !important;
    max-width: 100% !important;
  }

  .hero-buttons {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .hero-buttons button {
    width: 100% !important;
  }

  .stats-bar {
    grid-template-columns: repeat(3, 1fr) !important;
    margin-top: 28px !important;
    padding-top: 20px !important;
    gap: 0 !important;
  }

  .stats-bar > div {
    padding-right: 6px !important;
  }

  /* ---- SECTION PADDING ---- */
  .section-padded,
  .pricing-section,
  .pricing-header,
  .coach-section,
  .prog-section,
  .newsletter-section,
  .contact-section,
  .contact-header {
    padding: 56px 20px !important;
  }

  /* ---- SECTION TITLES ---- */
  .section-title {
    font-size: 32px !important;
    letter-spacing: -1px !important;
    margin-bottom: 28px !important;
  }

  /* ---- PAGE HEADINGS ---- */
  .page-heading {
    font-size: 44px !important;
    letter-spacing: -2px !important;
  }

  /* Generic h1 tightening on mobile (page intros) */
  section > h1 {
    font-size: 44px !important;
    letter-spacing: -2px !important;
    line-height: 1.05 !important;
  }
  section > h2 {
    font-size: 30px !important;
    letter-spacing: -1px !important;
  }

  /* ---- 3-COL → 1-COL ---- */
  .grid-3col {
    grid-template-columns: 1fr !important;
    background: transparent !important;
    gap: 12px !important;
  }

  /* ---- 4-COL → 2-COL ---- */
  .grid-4col {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  /* ---- 2-COL → 1-COL ---- */
  .grid-2col {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* ---- SCHEDULE: vertical day list (no horizontal scroll) ---- */
  .schedule-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    overflow-x: visible !important;
    gap: 8px !important;
    padding-bottom: 0 !important;
  }

  .schedule-grid > div {
    min-width: 0 !important;
    flex-shrink: 1 !important;
    display: grid !important;
    grid-template-columns: 64px 1fr auto !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px 18px !important;
  }

  /* Children of schedule cards: kill bottom margins, align inline */
  .schedule-grid > div > div {
    margin-bottom: 0 !important;
  }

  /* ---- SPAIN BANNER (homepage) ---- */
  .spain-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .spain-image {
    display: none !important;
  }

  .spain-heading {
    font-size: 38px !important;
    letter-spacing: -1.5px !important;
  }

  /* ---- SPAIN CAMP PAGE ---- */
  .spain-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .spain-hero-image {
    order: 1 !important;
    margin-top: 0 !important;
  }
  .spain-hero-text h1 {
    font-size: 44px !important;
    letter-spacing: -2px !important;
  }
  .spain-details-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 1px !important;
  }
  .spain-details-grid > div {
    padding: 24px 18px !important;
  }
  .spain-itinerary {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .spain-form-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .spain-form-grid input {
    font-size: 16px !important;
  }

  /* ---- NEWSLETTER ---- */
  .newsletter-form {
    flex-direction: column !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .newsletter-form input {
    width: 100% !important;
    border-right: 1px solid #2A2A2A !important;
    border-bottom: none !important;
    font-size: 16px !important;
  }
  .newsletter-form button {
    width: 100% !important;
  }

  /* ---- PRICING CARDS ---- */
  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }
  .pricing-grid > div {
    padding: 28px 24px !important;
  }
  .pricing-price {
    font-size: 42px !important;
  }
  .pricing-header h1 {
    font-size: 48px !important;
    letter-spacing: -2px !important;
  }

  /* ---- SUCCESS PAGE ---- */
  .success-stats > div {
    padding: 28px 12px !important;
  }
  .success-stats > div > div:first-child {
    font-size: 38px !important;
  }
  .gallery-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .gallery-item {
    grid-column: span 1 !important;
    aspect-ratio: 1 / 1 !important;
  }
  .college-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .college-grid > div {
    font-size: 13px !important;
    padding: 12px 10px !important;
  }

  .testimonials-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .testimonials-grid > div {
    padding: 24px 22px !important;
  }
  .testimonials-grid > div p {
    font-size: 14px !important;
  }

  /* ---- COACHES ---- */
  .coach-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }
  .coach-photo {
    width: 100% !important;
    max-width: 100% !important;
    order: -1 !important;
  }
  .coach-photo > div {
    aspect-ratio: 3/4 !important;
    max-width: 100% !important;
    max-height: 480px !important;
  }
  .coach-photo > div img {
    object-position: center 20% !important;
  }
  .coach-name {
    font-size: 34px !important;
    letter-spacing: -1.5px !important;
  }
  /* All stats in one horizontal row on mobile */
  .coach-stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0 !important;
  }
  .coach-stats > div {
    padding: 14px 10px !important;
    margin-right: 0 !important;
    border-right: 1px solid #2A2A2A !important;
    border-bottom: none !important;
  }
  .coach-stats > div:last-child {
    border-right: none !important;
  }
  /* Shrink stat number and label to fit one row */
  .coach-stats > div > div:first-child {
    font-size: 20px !important;
    letter-spacing: -0.5px !important;
    margin-bottom: 4px !important;
  }
  .coach-stats > div > div:last-child {
    font-size: 8px !important;
    letter-spacing: 1px !important;
  }

  /* ---- PROGRAMS ---- */
  .prog-card-details {
    grid-template-columns: 1fr 1fr !important;
  }
  .session-details-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .checklist-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .blast-callout {
    flex-direction: column !important;
    gap: 14px !important;
    padding: 24px 20px !important;
    align-items: flex-start !important;
  }
  .blast-callout-right {
    text-align: left !important;
  }
  .tournament-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  /* ---- CONTACT PAGE ---- */
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  .contact-form-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .contact-form-grid input,
  .contact-form-grid textarea {
    font-size: 16px !important;
  }
  .contact-form-grid button {
    width: 100% !important;
  }

  /* ---- DASHBOARD ---- */
  .dash-topbar {
    padding: 0 16px !important;
    height: 56px !important;
  }
  .dash-topbar > div:last-child > span {
    display: none !important;
  }
  .dash-body {
    padding: 24px 16px !important;
    /* Ensure the dashboard body itself can scroll vertically */
    overflow: visible !important;
  }
  /* Table card wrappers: allow inner table scroll */
  .dash-card {
    overflow: visible !important;
  }
  .dash-bo-header {
    flex-wrap: wrap !important;
    padding: 16px 18px !important;
    gap: 14px !important;
  }
  .dash-bo-header > div:last-child {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .dash-quick-actions {
    flex-direction: column !important;
  }
  .dash-quick-actions button {
    width: 100% !important;
    justify-content: center !important;
  }
  .dash-cards-4 {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  .dash-cards-4 > div {
    padding: 18px 16px !important;
  }
  .dash-split-2 {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  /* Tables: each table scrolls horizontally within its card */
  .dash-table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .dash-table td, .dash-table th {
    padding: 10px 14px !important;
    white-space: nowrap !important;
  }
  /* Let table card containers clip to their border-radius but allow
     the inner scrollable table to overflow horizontally */
  .dash-table::-webkit-scrollbar {
    height: 3px !important;
  }
  .dash-table::-webkit-scrollbar-thumb {
    background: #2A2A2A !important;
  }

  /* ---- CTA BUTTON GROUPS ---- */
  .cta-buttons {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .cta-buttons button {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ---- GENERIC: any inline form input gets bumped to 16px to prevent iOS auto-zoom ---- */
  input, textarea, select {
    font-size: 16px !important;
  }
}

/* ============================================================
   @media TIGHT-PHONE OVERRIDES (≤480px)
   ============================================================ */
@media (max-width: 480px) {

  .hero-heading {
    font-size: 36px !important;
  }

  .stats-bar {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .stats-bar > div {
    padding-right: 0 !important;
    border-bottom: 1px solid #2A2A2A;
    padding-bottom: 14px;
  }
  .stats-bar > div:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .success-stats {
    grid-template-columns: 1fr !important;
  }
  .success-stats > div {
    border-right: none !important;
    border-bottom: 1px solid #2A2A2A !important;
  }
  .success-stats > div:last-child {
    border-bottom: none !important;
  }

  .spain-details-grid {
    grid-template-columns: 1fr !important;
  }

  .pricing-header h1 {
    font-size: 40px !important;
  }
  section > h1 {
    font-size: 38px !important;
  }
  section > h2 {
    font-size: 28px !important;
  }

  .schedule-grid > div {
    grid-template-columns: 56px 1fr !important;
  }
  .schedule-grid > div > div:last-child {
    grid-column: 2 / -1 !important;
  }
}
