/* ============================================
   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 (.popup_silver_93a2) is a descendant of
   .cool-35b1 (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.slider_lower_b46a)
   and the redesigned template (header.logo-left-c98c). Keep both selectors. */
header.slider_lower_b46a,
header.logo-left-c98c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".form-bronze-8200" 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.tooltip_02f9 so it can't cause
   horizontal overflow anyway. */
.hover_bright_dd1f,
.item-4acc,
.list_c323,
.logo-54b0,
.border_iron_878f,
.hot-7da1,
.clean_4e4e,
.carousel-f9ff,
.description-bottom-a310,
.frame-c553,
.yellow-994c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .narrow_27eb {
    padding: 8px 0;
  }
  
  .simple_996e img {
    height: 28px;
    width: auto;
  }
  
  .list_1546 {
    display: none !important;
  }
  
  .hidden_4d24 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hidden_4d24 svg {
    width: 14px;
    height: 14px;
  }
  
  .red_fcc1 {
    padding: 6px;
  }
  
  .rough-e24c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .list_c323,
  .item-4acc,
  .logo-54b0,
  .border_iron_878f,
  .rough-6b83,
  .breadcrumb-white-7243,
  .north_caad,
  .sidebar-first-07c6,
  .fixed_f086,
  .carousel-light-c0fd,
  .action_54fc,
  .avatar_yellow_2bc7 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .sidebar-ea96,
  .shadow-stale-91e2 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .focused_2698,
  .preview_last_0956,
  .red_9a1a,
  .feature_46c8,
  .badge_7654,
  .clean_4324,
  .heading-silver-1c74 {
    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-b5d1,
  .thick_4085,
  .heading-black-b7de,
  .accent-e5d5,
  .badge-01b7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .alert-cold-cef5,
  .background_new_2000,
  .search-5421,
  .outline-0f1b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .shade-black-c7b7,
  .over_7945 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .active-0fe7,
  .article_in_e700,
  .card_left_999e,
  .plasma_f867 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .content-fead,
  .button_906e,
  .tertiary_2949,
  .highlight_solid_5f21,
  .thick_63ac,
  .brown-7814 {
    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-b5d1,
  .thick_4085,
  .accent-e5d5 {
    max-width: none !important;
  }
  
  .form-bronze-8200 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .alert-cold-cef5 {
    font-size: 1.5rem !important;
  }
  
  .background_new_2000 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .link-6a7d,
  .column-2f29 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .search-5421 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .icon_a606 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .down_1ce4 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .thick-b5d1,
  .accent-e5d5 {
    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 */
.hidden_light_46ea {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: db6e */
.shadow-element-p8 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.3;
}
