/* ============================================
   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 (.banner_tall_1e9d) is a descendant of
   .gold-3ac0 (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.backdrop-7216 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".simple-352b" 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.row-15ab so it can't cause
   horizontal overflow anyway. */
.huge_c68c,
.silver_5ead,
.down_1104,
.module-5810,
.purple-aa1e,
.feature-5906,
.left-77f2,
.picture-paper-9afc,
.center_a0a2,
.over-55a6,
.summary-f6a7 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .filter-6720 {
    padding: 8px 0;
  }
  
  .message_short_b896 img {
    height: 28px;
    width: auto;
  }
  
  .green-af17 {
    display: none !important;
  }
  
  .active_b0f4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .active_b0f4 svg {
    width: 14px;
    height: 14px;
  }
  
  .huge-2490 {
    padding: 6px;
  }
  
  .west-9bfd {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .down_1104,
  .silver_5ead,
  .module-5810,
  .purple-aa1e,
  .secondary-hard-2a35,
  .row_d2b6,
  .shade_fast_00b0,
  .badge_top_30e3,
  .feature-f51b,
  .summary-down-cc67,
  .footer_inner_c724,
  .nav-static-e7de {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .gallery-lower-6d3e,
  .highlight-right-50ad {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tooltip_light_f83d,
  .frame-59ba,
  .gas_5797,
  .logo_focused_15ef,
  .secondary_prev_b160,
  .table_bffd,
  .down-cd2b {
    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 */
  .accordion_hard_abe9,
  .hover-813a,
  .grid_west_2933,
  .hover-ce2b,
  .article-69cc {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .grid_soft_145d,
  .texture_first_1493,
  .wide_7de0,
  .banner-old-2fc0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .disabled_43d6,
  .gas_8325 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .box_basic_dbd7,
  .panel-hovered-de94,
  .accordion-e9f3,
  .list_34fd {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .full_0e3f,
  .hot-5478,
  .dark_bac6,
  .breadcrumb-edc3,
  .dark-8bfd,
  .focused_2d8a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .accordion_hard_abe9,
  .hover-813a,
  .hover-ce2b {
    max-width: none !important;
  }
  
  .simple-352b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .grid_soft_145d {
    font-size: 1.5rem !important;
  }
  
  .texture_first_1493 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .wrapper_west_ebe3,
  .input-ab83 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .wide_7de0 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pagination-3b3d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .pro-a4ee {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .accordion_hard_abe9,
  .hover-ce2b {
    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: b6f7 */
.phantom-card-w9 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.2;
}
