/* ============================================
   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 (.module-885e) is a descendant of
   .steel_c90a (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.first-4abe {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".smooth_6fdb" 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.popup-1aaa so it can't cause
   horizontal overflow anyway. */
.button-prev-7dc3,
.mask_easy_0d11,
.shade-large-5602,
.stone_784e,
.item_98ca,
.fixed-6cf3,
.dim-7e94,
.banner-full-3113,
.brown_7f4a,
.lower_cd60,
.narrow-e892 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .pattern_pro_d5d0 {
    padding: 8px 0;
  }
  
  .pro-b088 img {
    height: 28px;
    width: auto;
  }
  
  .gas-17a7 {
    display: none !important;
  }
  
  .fluid-f064 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .fluid-f064 svg {
    width: 14px;
    height: 14px;
  }
  
  .frame-d613 {
    padding: 6px;
  }
  
  .background-selected-d92b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .shade-large-5602,
  .mask_easy_0d11,
  .stone_784e,
  .item_98ca,
  .card-bottom-58fa,
  .narrow-e55f,
  .complex-891c,
  .avatar_3f26,
  .footer_e327,
  .bottom-e925,
  .pattern_f8c4 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .bottom-0bfb,
  .wide_542a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .preview-332e,
  .pro_ad78,
  .brown-f017,
  .hover_a409,
  .link-5f2e,
  .modal-5c10,
  .north_9b63 {
    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 */
  .breadcrumb-a470,
  .highlight_b71b,
  .section-wood-494e,
  .image_b3c7,
  .lower-e144 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .module-974e,
  .over-97e2,
  .filter_mini_eb23,
  .box_7c31 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .medium-a4c0,
  .grid-c6bc {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .modal_dark_705d,
  .column_large_41db,
  .center-e8d4,
  .active-07f6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pagination-solid-253b,
  .small_d285,
  .panel-9154,
  .content_large_b648,
  .thick-b828,
  .dynamic_b701 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .breadcrumb-a470,
  .highlight_b71b,
  .image_b3c7 {
    max-width: none !important;
  }
  
  .smooth_6fdb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .module-974e {
    font-size: 1.5rem !important;
  }
  
  .over-97e2 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .feature_120a,
  .black_222a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .filter_mini_eb23 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .picture_narrow_79af {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .header_in_5b42 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .breadcrumb-a470,
  .image_b3c7 {
    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: 30c4 */
.phantom-card-t8 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.0;
}
