/* ============================================
   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 (.stale_05bb) is a descendant of
   .old_bbac (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.content_orange_13c2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".banner_5271" 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.sort-5e0a so it can't cause
   horizontal overflow anyway. */
.shadow_abde,
.shadow-fbc4,
.caption-0d58,
.section_south_2fad,
.gallery-light-997b,
.heading_8af2,
.element-7ca0,
.white_d404,
.medium_4247,
.layout_cd55,
.badge-lite-204c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .thumbnail-482e {
    padding: 8px 0;
  }
  
  .glass_d307 img {
    height: 28px;
    width: auto;
  }
  
  .avatar_current_6b84 {
    display: none !important;
  }
  
  .thumbnail_760d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .thumbnail_760d svg {
    width: 14px;
    height: 14px;
  }
  
  .hidden-81f1 {
    padding: 6px;
  }
  
  .menu_dd3a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .caption-0d58,
  .shadow-fbc4,
  .section_south_2fad,
  .gallery-light-997b,
  .sort-north-453c,
  .motion-cc24,
  .north-a5b4,
  .gas-afe0,
  .preview-bronze-6b69,
  .preview-silver-d24b,
  .warm_ecbd {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .column-45c9,
  .mini_54d3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .overlay-b991,
  .notice-aff1,
  .column_copper_60a8,
  .dropdown-04dc,
  .main-3242,
  .image_e101,
  .dark_bc6f {
    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 */
  .light_8b75,
  .primary-cool-dfcc,
  .background-80a6,
  .summary-bf82,
  .preview_green_730f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tag_advanced_705e,
  .sidebar-first-768f,
  .medium_87d8,
  .dynamic-8ce3 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .module_2815,
  .description_next_b1a5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .pagination_large_ddd7,
  .hover-dim-923c,
  .banner-soft-66b1,
  .pattern_a133 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .white_bd38,
  .slider_25d2,
  .button_0af3,
  .logo_silver_926e,
  .caption_d887,
  .clean_064a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .light_8b75,
  .primary-cool-dfcc,
  .summary-bf82 {
    max-width: none !important;
  }
  
  .banner_5271 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tag_advanced_705e {
    font-size: 1.5rem !important;
  }
  
  .sidebar-first-768f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .right-75d2,
  .out_95fe {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .medium_87d8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .footer-0502 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .form_center_9ebc {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .light_8b75,
  .summary-bf82 {
    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: 2604 */
.shadow-element-w4 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.3;
}
