/* ======================================================================
   Responsive Styles — Mobile Sidebar Navigation & Layout Adjustments
   ====================================================================== */

/* --- Prevent body scroll when menu is open --- */
body.nav-open {
  overflow: hidden;
}

/* --- Hamburger Toggle Button --- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 200;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: rgba(245, 245, 247, 0.904);
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--charcoal);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}

/* Animate hamburger to X when open — white color */
body.nav-open .hamburger-line {
  background: #ffffff;
}

body.nav-open .hamburger-line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

body.nav-open .hamburger-line:nth-child(2) {
  opacity: 0;
}

body.nav-open .hamburger-line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* When menu is open, fix toggle to top-right above sidebar */
body.nav-open .menu-toggle {
  position: fixed;
  top: 14px;
  right: 16px;
}

/* --- Overlay Backdrop (lives OUTSIDE header to avoid stacking context) --- */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 95;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.nav-open .nav-overlay {
  pointer-events: auto;
  opacity: 1;
}

/* --- Mobile / Tablet Breakpoint (≤ 960px) --- */
@media (max-width: 960px) {
  .menu-toggle {
    display: flex;
  }

  .header-inner {
    flex-wrap: nowrap;
  }

  .brand {
    min-width: auto;
    flex: 1;
  }

  /* Off-canvas sidebar */
  .nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 260px;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, #0f1520 0%, #0b0f14 100%);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 80px 24px 32px;
    z-index: 100;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
  }

  body.nav-open .nav {
    right: 0;
  }

  .nav a {
    width: 100%;
    color: rgba(255, 255, 255, 0.88);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: background 0.2s;
  }

  .nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
  }

  .nav a.active {
    background: rgba(242, 138, 0, 0.15);
    color: #ffb85c;
  }

  .nav .cta {
    margin-top: 16px;
    width: 100%;
    text-align: center;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--orange), var(--orange2));
    color: #111827;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(242, 138, 0, 0.3);
  }
}

/* --- Typography Scaling (Small Screens) --- */
@media (max-width: 520px) {
  h2 {
    font-size: 22px;
  }

  h3 {
    font-size: 18px;
  }

  .page-hero h1 {
    font-size: 28px;
  }

  .hero-card {
    padding: 20px;
  }
}

/* --- Spacing and Grid (Extra Small Screens) --- */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .section {
    padding: 20px 0;
  }

  .card {
    padding: 16px;
  }

  .btn {
    width: 100%;
  }

  .footer-grid {
    gap: 24px;
  }

  .footer .links {
    justify-content: flex-start;
  }
}

/* --- Table Responsiveness --- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}