/* ==========================================================================
   MOBILE VIEW & MOBILE MENU PERFECTION (CLEAN, POLISHED, UN-SCATTERED)
   ========================================================================== */

/* 1. Global Viewport & Zero Horizontal Overflow */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* 2. Mobile Floating Header Bar */
@media (max-width: 1279px) {
  header.fixed {
    top: 0.5rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  header.fixed > div {
    height: 64px !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    border-radius: 1rem !important;
  }
  .main-content-wrapper {
    padding-top: 84px !important;
  }
}

/* SOLID HIGH-VISIBILITY WHITE HAMBURGER BUTTON */
#mobile-menu-btn {
  display: flex !important;
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #ffffff !important;
  border-radius: 0.75rem !important;
  min-width: 44px !important;
  min-height: 44px !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 50 !important;
}

#mobile-menu-btn svg,
#mobile-menu-btn svg line {
  stroke: #000000 !important;
  stroke-width: 2.75px !important;
}

#mobile-menu-btn:hover {
  background-color: #F74B1C !important;
  border-color: #F74B1C !important;
}

#mobile-menu-btn:hover svg,
#mobile-menu-btn:hover svg line {
  stroke: #ffffff !important;
}

/* 3. Mobile Navigation Drawer & Backdrop */
#mobile-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 998 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#mobile-backdrop.open {
  opacity: 1 !important;
  pointer-events: auto !important;
}

#mobile-menu-drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 88% !important;
  max-width: 360px !important;
  background: #111111 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: -15px 0 35px rgba(0, 0, 0, 0.85) !important;
  z-index: 999 !important;
  padding: 1.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%) !important;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

#mobile-menu-drawer.open {
  transform: translateX(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Drawer Header */
.drawer-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-bottom: 1rem !important;
  margin-bottom: 1rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Drawer Accordion Navigation Items */
.mobile-nav-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding-bottom: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

.mobile-nav-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  padding: 0.65rem 0.25rem !important;
  color: #ffffff !important;
  font-family: 'Britanica Extra Bold', sans-serif !important;
  font-size: 15px !important;
  cursor: pointer !important;
  user-select: none;
  transition: color 0.2s ease;
}

.mobile-nav-toggle:hover,
.mobile-nav-toggle:active {
  color: #F74B1C !important;
}

.mobile-toggle-icon {
  width: 18px !important;
  height: 18px !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  color: rgba(255, 255, 255, 0.6) !important;
}

.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  padding-left: 0.75rem !important;
}

.mobile-submenu a {
  display: block !important;
  padding: 0.45rem 0.5rem !important;
  color: rgba(255, 255, 255, 0.75) !important;
  font-family: 'Britanica Regular', sans-serif !important;
  font-size: 14px !important;
  border-radius: 0.375rem !important;
  transition: all 0.15s ease !important;
}

.mobile-submenu a:hover,
.mobile-submenu a:active {
  color: #ffffff !important;
  background: rgba(247, 75, 28, 0.15) !important;
  padding-left: 0.75rem !important;
}

/* 4. MOBILE HERO SECTION OPTIMIZATION (CLEAN, FOCUSED, BALANCED) */
@media (max-width: 767px) {
  /* Hero Container */
  main > div:first-child {
    padding-top: 1.5rem !important;
    padding-bottom: 2.5rem !important;
    min-height: auto !important;
    height: auto !important;
  }

  /* Hero Grid & Spacing */
  main > div:first-child .grid {
    padding-top: 0.5rem !important;
    margin-top: 0 !important;
    gap: 1rem !important;
  }

  /* Hero Headline */
  main > div:first-child h1 {
    font-size: clamp(1.75rem, 7.5vw, 2.25rem) !important;
    line-height: 1.22 !important;
    letter-spacing: -0.015em !important;
    margin-bottom: 0.875rem !important;
    text-align: center !important;
  }

  /* Hero Paragraph / Description */
  main > div:first-child h1 + div,
  main > div:first-child h1 + p,
  main > div:first-child .font-britanicaRegular {
    font-size: 0.9375rem !important;
    line-height: 1.65 !important;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important;
    padding-top: 0.5rem !important;
  }

  /* Hero CTA Button Container */
  main > div:first-child .flex.flex-wrap,
  main > div:first-child .flex.justify-center,
  main > div:first-child div:has(> button),
  main > div:first-child div:has(> a.btn-sweep) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding-top: 1.25rem !important;
    gap: 0.75rem !important;
  }

  /* Hero Action Buttons */
  main > div:first-child button,
  main > div:first-child a.rounded-full,
  main > div:first-child .btn-sweep {
    width: 100% !important;
    max-width: 320px !important;
    padding: 0.85rem 1.5rem !important;
    font-size: 0.9375rem !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  /* Hero Mockup Images */
  main > div:first-child img[src*="mobilehero"],
  main > div:first-child img[alt*="mockup"],
  main > div:first-child img[alt*="hero"] {
    max-width: 240px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 1.5rem !important;
    display: block !important;
  }

  /* Hide distracting absolute decorative frames on mobile hero */
  main > div:first-child > img.absolute {
    display: none !important;
  }
}

/* 5. Mobile Layout & Grid Stabilization for Content Sections */
@media (max-width: 767px) {
  /* Container Padding on Mobile */
  .container,
  [class*="container"] {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  /* Force multi-column card grids to single column on mobile */
  .grid-cols-12 > [class*="col-span-12"],
  .grid-cols-12 > [class*="col-span-6"],
  .grid-cols-12 > [class*="col-span-4"],
  .grid-cols-12 > [class*="col-span-3"],
  .grid-cols-12 > [class*="col-span-8"] {
    grid-column: span 12 / span 12 !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Harmonious Section Padding on Mobile */
  section, 
  main > div > div.relative,
  main > div > section {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Cards on Mobile */
  article,
  div[class*="rounded-xl"],
  div[class*="rounded-2xl"],
  div[class*="rounded-3xl"] {
    padding: 1.5rem 1.25rem !important;
    margin-bottom: 1rem !important;
  }

  /* Mobile Headings */
  h1 {
    font-size: clamp(1.75rem, 7vw, 2.25rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
  }

  h2 {
    font-size: clamp(1.5rem, 6vw, 1.875rem) !important;
    line-height: 1.25 !important;
    margin-bottom: 0.875rem !important;
  }

  h3 {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
  }

  p {
    font-size: 0.9375rem !important;
    line-height: 1.7 !important;
  }

  /* Align Section Headers Centered on Mobile */
  .text-center-mobile,
  div:has(> .rounded-full) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  /* Badges Centered */
  .rounded-full,
  span[class*="rounded-full"],
  div[class*="rounded-full"] {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Images responsive */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Floating CTA buttons on mobile */
  .btn-sweep {
    width: 100% !important;
    justify-content: center !important;
  }
}
