/* ============================================
   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_hovered_c3ae) is a descendant of
   .shadow_8ca4 (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.motion_4c14 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".focused_9b91" 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.accent-active-0f8e so it can't cause
   horizontal overflow anyway. */
.gradient_lite_7d9d,
.accent_black_a8d9,
.wide-91b9,
.bright_2b6d,
.section_f86d,
.aside_full_fbae,
.easy_8111,
.description_upper_2077,
.item-bb7a,
.info_0d82,
.icon-99ed {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .wrapper_fluid_1433 {
    padding: 8px 0;
  }
  
  .cool-1304 img {
    height: 28px;
    width: auto;
  }
  
  .steel_a246 {
    display: none !important;
  }
  
  .smooth_1536 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .smooth_1536 svg {
    width: 14px;
    height: 14px;
  }
  
  .nav_966b {
    padding: 6px;
  }
  
  .photo-stone-a95d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .wide-91b9,
  .accent_black_a8d9,
  .bright_2b6d,
  .section_f86d,
  .smooth-b88b,
  .smooth-7e8c,
  .item_a9c2,
  .mask_f9b6,
  .title-4914,
  .yellow-94cc,
  .black_e816,
  .title-smooth-b3d2 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .top_dd19,
  .description_gas_c7c4 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .info-51cb,
  .section_red_6a1f,
  .tag-blue-32e2,
  .widget_stale_00f9,
  .sort_bright_55b1,
  .title_current_1d7f,
  .motion-a6f7 {
    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 */
  .tertiary_green_93ff,
  .text-glass-3b30,
  .left_47a3,
  .selected_fd09,
  .search-6934 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .thumbnail_lite_fc0b,
  .heading-solid-78ce,
  .highlight-a880,
  .hidden_bdb4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hovered-323a,
  .sort_next_2e48 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .breadcrumb-fast-3886,
  .out-8456,
  .feature-gold-00b0,
  .video-liquid-e5ad {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .cool_862c,
  .filter-paper-61be,
  .disabled-static-4424,
  .box_gold_90c9,
  .layout_ea1b,
  .module-ccbb {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .tertiary_green_93ff,
  .text-glass-3b30,
  .selected_fd09 {
    max-width: none !important;
  }
  
  .focused_9b91 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .thumbnail_lite_fc0b {
    font-size: 1.5rem !important;
  }
  
  .heading-solid-78ce {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .up-3697,
  .active-700d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .highlight-a880 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .easy_0958 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .fast-e446 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .tertiary_green_93ff,
  .selected_fd09 {
    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: f2e4 */
.promo-block-x8 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}
