/* ============================================
   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 (.link_ea2a) is a descendant of
   .description-4ec4 (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.
   Two site templates coexist: legacy obfuscated-class (header.red_96ab)
   and the redesigned template (header.menu_5558). Keep both selectors. */
header.red_96ab,
header.menu_5558 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".down-4284" 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.gradient_182d so it can't cause
   horizontal overflow anyway. */
.main_a944,
.gas_1efb,
.motion-905d,
.message-f05b,
.pro-8878,
.pro_a236,
.white-7321,
.accordion_light_6658,
.shade_left_2ead,
.tertiary_3f51,
.action-1ce8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .info-fe00 {
    padding: 8px 0;
  }
  
  .simple_faa6 img {
    height: 28px;
    width: auto;
  }
  
  .liquid-ac92 {
    display: none !important;
  }
  
  .mini_65b4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .mini_65b4 svg {
    width: 14px;
    height: 14px;
  }
  
  .row-slow-70a8 {
    padding: 6px;
  }
  
  .sidebar-mini-2434 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .motion-905d,
  .gas_1efb,
  .message-f05b,
  .pro-8878,
  .container-a2d0,
  .form_left_7f5f,
  .pagination_cold_0dff,
  .backdrop_6dbe,
  .complex_ce5a,
  .search-8d61,
  .selected-1fbf,
  .mask_9fa7 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .heading_warm_6f70,
  .photo-orange-8474 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .grid_motion_2863,
  .in_74f4,
  .secondary_cd32,
  .banner_2300,
  .progress_ecd9,
  .pagination_fast_92e6,
  .hidden-0629 {
    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 */
  .modal-25db,
  .warm_c3f9,
  .icon-f9d1,
  .search_bf83,
  .paper_a8c7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .sidebar-thick-f1df,
  .blue_fa7f,
  .border-light-0ce0,
  .white-37b6 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .image-dark-ef94,
  .liquid-35cc {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .description_wide_fca4,
  .hover_d259,
  .thumbnail-complex-a8a0,
  .column_steel_bbc1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .component-07ad,
  .hover_1210,
  .accordion-out-0012,
  .pro-1412,
  .title_soft_8ab6,
  .text_liquid_412e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .modal-25db,
  .warm_c3f9,
  .search_bf83 {
    max-width: none !important;
  }
  
  .down-4284 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .sidebar-thick-f1df {
    font-size: 1.5rem !important;
  }
  
  .blue_fa7f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .old_cb09,
  .preview-next-7585 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .border-light-0ce0 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .form_4b14 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .active_fixed_f533 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .modal-25db,
  .search_bf83 {
    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: 94a5 */
.slow_0d75 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: e92e */
.widget-item-p2 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.3;
}
