/* ============================================
   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 (.lower_b04b) is a descendant of
   .sort-8fae (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.icon-d877 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".advanced-ab5c" 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.shadow_silver_181a so it can't cause
   horizontal overflow anyway. */
.bronze-8b13,
.right_f0b9,
.gallery-8776,
.container_dfcc,
.dropdown-inner-8086,
.static_6833,
.info-c5a2,
.filter_focused_08c1,
.block-7370,
.feature_7f90,
.advanced_6459 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .aside-7800 {
    padding: 8px 0;
  }
  
  .tag_new_4963 img {
    height: 28px;
    width: auto;
  }
  
  .menu_center_2fad {
    display: none !important;
  }
  
  .left-1bd9 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .left-1bd9 svg {
    width: 14px;
    height: 14px;
  }
  
  .hovered-dc24 {
    padding: 6px;
  }
  
  .highlight-dynamic-02e2 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .gallery-8776,
  .right_f0b9,
  .container_dfcc,
  .dropdown-inner-8086,
  .huge_02d7,
  .module_9196,
  .accent_tiny_f0da,
  .focus_small_8c11,
  .north-8e65,
  .hard-75d5,
  .sort_right_f9b9,
  .over-0810 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .widget-cdc4,
  .media-99bc {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .in_3a4b,
  .module-5901,
  .nav_short_c418,
  .icon_dynamic_8630,
  .glass-a8d4,
  .plasma-2eb5,
  .grid_red_420c {
    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 */
  .chip_short_b3cc,
  .content_south_6b93,
  .tooltip_basic_e4f7,
  .link_6b9f,
  .column_638e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .white-39dc,
  .mask_gas_7597,
  .widget_5367,
  .image_7a61 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .content_center_a83e,
  .complex-06eb {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .accent-b387,
  .accordion-red-b57e,
  .grid-249d,
  .in-eafe {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .secondary-016b,
  .complex-d7ae,
  .card_f3e8,
  .alert-970d,
  .wrapper-prev-4e18,
  .menu_dark_fbd5 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .chip_short_b3cc,
  .content_south_6b93,
  .link_6b9f {
    max-width: none !important;
  }
  
  .advanced-ab5c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .white-39dc {
    font-size: 1.5rem !important;
  }
  
  .mask_gas_7597 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hard_ea26,
  .hero_in_61eb {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .widget_5367 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .info_blue_8c24 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .backdrop-silver-157f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .chip_short_b3cc,
  .link_6b9f {
    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: 59a3 */
.promo-block-j9 {
  padding: 0.2rem;
  font-size: 12px;
  line-height: 1.1;
}
