/* ==========================================================================
   Responsive Stylesheet - Shri Mani Mahesh Gurukulam
   Full Mobile & Tablet Optimization
   ========================================================================== */

/* Global Mobile Overflow Guard */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
}

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

/* ==========================================================================
   Tablet Devices (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 2.6rem;
  }
  body.lang-hi .hero-title {
    font-size: 2.8rem;
  }
  .hero-badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .routine-timeline {
    grid-template-columns: repeat(2, 1fr);
  }
  .seva-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  .about-heritage-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .vision-mission-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .panchakosha-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .four-pillars-grid,
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Header & Nav Tablet Breakpoint (max-width: 1080px)
   ========================================================================== */
@media (max-width: 1080px) {
  .mobile-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 60px;
    left: -100%;
    width: 82%;
    max-width: 320px;
    height: calc(100vh - 60px);
    background: #FFFFFF;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 1.25rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border-right: 2px solid var(--color-gold);
    overflow-y: auto;
    z-index: 999;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: 0.75rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--color-border);
  }

  .header-cta-group .btn-seva,
  .header-cta-group .btn-primary {
    display: none;
  }
}

/* ==========================================================================
   Mobile Devices (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Container & Spacing */
  .container {
    padding: 0 1rem;
    width: 100%;
  }

  .section {
    padding: 2.5rem 0;
  }

  /* Top Bar */
  .top-bar {
    padding: 0.3rem 0;
  }

  .top-bar .container {
    justify-content: center;
  }

  .top-actions {
    justify-content: center;
    width: 100%;
  }

  /* Header & Branding */
  .main-header {
    padding: 0.5rem 0;
  }

  .brand-logo-img {
    width: 42px;
    height: 42px;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-tagline {
    font-size: 0.65rem;
  }

  /* Page Hero */
  .page-hero {
    padding: 2.5rem 1rem;
    text-align: center;
    width: 100%;
  }

  .page-hero h1 {
    font-size: 1.8rem;
  }

  /* Shloka Banner */
  .shloka-banner {
    font-size: 1.05rem;
    padding: 0.75rem 1rem;
    word-break: break-word;
  }

  /* Grids Stack to 1 Column */
  .about-heritage-grid,
  .vision-mission-grid,
  .panchakosha-grid,
  .four-pillars-grid,
  .steps-grid,
  .pillars-grid,
  .routine-timeline,
  .seva-cards-grid,
  .hero-badges-grid,
  .gallery-grid,
  .testimonials-grid,
  .contact-wrapper,
  .footer-grid,
  .form-row,
  .bank-upi-preview-card,
  .admission-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Hero Section */
  .hero-title {
    font-size: 1.85rem;
    line-height: 1.25;
  }
  body.lang-hi .hero-title {
    font-size: 2rem;
    line-height: 1.3;
  }
  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.6;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta-group .btn {
    width: 100%;
    text-align: center;
  }

  /* Founder Sandesh Card */
  .sandesh-card {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
  }

  .sandesh-quote::before {
    display: none;
  }

  /* Gallery Filters */
  .gallery-filter {
    gap: 0.5rem;
    justify-content: center;
  }

  .filter-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
  }

  /* Table Responsive */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
  }

  .table-responsive table {
    min-width: 600px;
  }

  /* Sticky Actions & Floating CTAs */
  .sticky-seva-float {
    display: none;
  }

  .mobile-call-bar {
    display: flex;
  }

  body {
    padding-bottom: 60px;
  }

  .sticky-whatsapp-btn {
    bottom: 4.5rem;
    right: 1.25rem;
    width: 50px;
    height: 50px;
    font-size: 1.6rem;
  }
}

/* ==========================================================================
   Small Mobile Devices (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.65rem;
  }
  body.lang-hi .hero-title {
    font-size: 1.75rem;
  }
  .section-title {
    font-size: 1.6rem;
  }
  .page-hero h1 {
    font-size: 1.6rem;
  }
  .shloka-banner {
    font-size: 0.95rem;
  }
}
