/* ============================================
   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 (.hard-0318) is a descendant of
   .detail-2141 (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.progress_gas_4617 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".widget_ed67" 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.disabled_hard_f390 so it can't cause
   horizontal overflow anyway. */
.paragraph_f291,
.east-6f12,
.smooth_8262,
.banner_36ad,
.shade-3405,
.card-gas-89d3,
.badge_south_6363,
.secondary_inner_8dc9,
.popup_hard_dabe,
.sort_d2d1,
.text_d48b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .widget-c4c0 {
    padding: 8px 0;
  }
  
  .breadcrumb-a2db img {
    height: 28px;
    width: auto;
  }
  
  .search-f1cb {
    display: none !important;
  }
  
  .module_yellow_b4f6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .module_yellow_b4f6 svg {
    width: 14px;
    height: 14px;
  }
  
  .short_243b {
    padding: 6px;
  }
  
  .button_100d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .smooth_8262,
  .east-6f12,
  .banner_36ad,
  .shade-3405,
  .overlay_center_96ee,
  .title-action-d877,
  .button-dc22,
  .footer_red_db81,
  .widget_tiny_e2e2,
  .grid_upper_3a8e,
  .pattern-5a48 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .bright_f73a,
  .summary-focused-bc91 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .background-pro-6e4e,
  .hidden-center-84a8,
  .accent_advanced_b154,
  .mask_tiny_208b,
  .text-complex-dda3,
  .pink-9d3b,
  .bronze_23ed {
    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 */
  .hero_00eb,
  .menu-52ec,
  .tabs-21cd,
  .lite-231f,
  .progress-old-a390 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .simple-3788,
  .element_solid_78e2,
  .tag_8858,
  .slow_d132 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .stone_e3c2,
  .header_a1e7 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .active_4f42,
  .dropdown-new-9a46,
  .bright_7402,
  .search-glass-4506 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .column_fast_9881,
  .narrow-3d62,
  .soft-8fbc,
  .image_909c,
  .left-d2ca,
  .stone-58b6 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .hero_00eb,
  .menu-52ec,
  .lite-231f {
    max-width: none !important;
  }
  
  .widget_ed67 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .simple-3788 {
    font-size: 1.5rem !important;
  }
  
  .element_solid_78e2 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .item-b2af,
  .upper-2a9d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tag_8858 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .glass-1d13 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .preview_first_8907 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero_00eb,
  .lite-231f {
    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: a2e0 */
.phantom-card-g2 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.3;
}
