/* ============================================
   CRITICAL MOBILE FIXES
   Additional layer to ensure perfect mobile display
   ============================================ */

/* Prevent horizontal scroll at all costs */
html {
  width: 100%;
  scroll-behavior: smooth;
  /* NO position:relative - it breaks sticky! */
  /* NO overflow-x here either - mixed with body's overflow-x: hidden
     it makes <html> its own scroll container and breaks sticky too! */
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  /* NO position:relative - it breaks sticky! */
}

/* Ensure all major containers respect viewport */
/* NOTE: "nav" is intentionally excluded here. Giving a <nav> element
   overflow-x: hidden makes its overflow-y auto-compute to "auto" (per the
   CSS overflow spec), turning it into a clipping/scroll container. Since
   the header's dropdown submenu (.cool-f2c7) is a descendant of
   .down-1b68 (a <nav>), it was getting clipped and forced into a tiny
   internal scrollbar instead of opening naturally below the nav link. */
main,
section,
article,
footer {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header must NOT have max-width restriction for sticky to work */
header.layout_short_2894 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".link-44c6" is intentionally excluded here for the same reason as
   "nav" above — the header's <div class="container"> wraps the nav and
   must not clip the dropdown submenu with an auto-computed overflow-y.
   It's already width-capped via max-width in style.wood-ad23 so it can't cause
   horizontal overflow anyway. */
.disabled-11a8,
.glass-18c0,
.text_0877,
.preview_da1a,
.mask-1652,
.full-2543,
.lower_a015,
.list_blue_7327,
.heading-c6d4,
.fixed-9c63,
.lower-81dc {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .icon-ade9 {
    padding: 8px 0;
  }
  
  .secondary_916c img {
    height: 28px;
    width: auto;
  }
  
  .button-8137 {
    display: none !important;
  }
  
  .component-dynamic-473a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .component-dynamic-473a svg {
    width: 14px;
    height: 14px;
  }
  
  .inner_6af2 {
    padding: 6px;
  }
  
  .mini-fc9e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .text_0877,
  .glass-18c0,
  .preview_da1a,
  .mask-1652,
  .notification-b61c,
  .section-stale-0428,
  .row-2aac,
  .gallery-1344,
  .north-a07d,
  .top_7158,
  .paragraph-894a,
  .hover_48d4 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .center_f31b,
  .accent_227f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .lower-e677,
  .gold-20a1,
  .image-slow-adae,
  .header_glass_d925,
  .accent-red-92db,
  .texture-33aa,
  .brown-9273 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  
  /* Ensure images are responsive */
  img,
  svg,
  picture {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Better padding for mobile */
  .module-small-a099,
  .brown_7614,
  .hidden_tiny_77cc,
  .dim_3223,
  .button_hovered_7f40 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .summary_1f02,
  .feature_small_e085,
  .progress_c177,
  .thumbnail-b842 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .old_8e79,
  .large-f0f0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .list-north-b96a,
  .dynamic-3113,
  .east_5662,
  .nav-bottom-5156 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .item-1a76,
  .badge_4420,
  .focus-clean-61f4,
  .out-0253,
  .easy-4173,
  .breadcrumb_8421 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .module-small-a099,
  .brown_7614,
  .dim_3223 {
    max-width: none !important;
  }
  
  .link-44c6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .summary_1f02 {
    font-size: 1.5rem !important;
  }
  
  .feature_small_e085 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .warm_22a9,
  .paragraph-hard-231d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .progress_c177 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .dropdown_3d2c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .red_e039 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .module-small-a099,
  .dim_3223 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* iPhone X and notch devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* css-noise: b2ff */
.ghost-box-w6 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.2;
}
