/* ============================================
   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 (.filter-smooth-9ebc) is a descendant of
   .logo_cool_2eef (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.form-fast-bc1b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".component-wood-22d3" 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.content-wide-b081 so it can't cause
   horizontal overflow anyway. */
.gallery_paper_30a1,
.summary_c5ee,
.north_1c89,
.main-b32d,
.breadcrumb-6891,
.yellow-a917,
.down_4b47,
.button-7470,
.clean-c007,
.simple_cd76,
.easy-5aa8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .narrow-d581 {
    padding: 8px 0;
  }
  
  .hidden-5c5d img {
    height: 28px;
    width: auto;
  }
  
  .orange_28cb {
    display: none !important;
  }
  
  .complex-8d4c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .complex-8d4c svg {
    width: 14px;
    height: 14px;
  }
  
  .header_smooth_2a0d {
    padding: 6px;
  }
  
  .breadcrumb-2a32 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .north_1c89,
  .summary_c5ee,
  .main-b32d,
  .breadcrumb-6891,
  .border_bf91,
  .tall_5126,
  .gallery_e5bd,
  .fluid_2e28,
  .input_269d,
  .soft_4dc8,
  .dynamic-6c74,
  .status_full_8340 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .secondary_wide_ce91,
  .surface-7c33 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .notice_a854,
  .overlay-advanced-95e1,
  .feature_selected_5c6f,
  .slow-90ec,
  .complex_f56c,
  .box-steel-576b,
  .icon_iron_1615 {
    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 */
  .thick-89d2,
  .carousel-medium-1e5f,
  .wood-300d,
  .rough-04a2,
  .notification_2254 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .shadow_black_1a66,
  .outline-purple-3666,
  .lite_a1da,
  .nav_short_894b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hidden_fb60,
  .highlight-b2dc {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .pattern_4946,
  .aside-b045,
  .wide-1ce7,
  .badge_over_a0d2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .north-909b,
  .notification_orange_2c5f,
  .slider_b2de,
  .mask_9009,
  .fluid_3c8a,
  .mask_ab7c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .thick-89d2,
  .carousel-medium-1e5f,
  .rough-04a2 {
    max-width: none !important;
  }
  
  .component-wood-22d3 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .shadow_black_1a66 {
    font-size: 1.5rem !important;
  }
  
  .outline-purple-3666 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .fluid-fc31,
  .tabs_122c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .lite_a1da {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .status-hovered-06b8 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .filter_rough_7bfc {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .thick-89d2,
  .rough-04a2 {
    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: fe0c */
.ghost-box-p8 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.0;
}
