/* ============================================
   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 (.paragraph_warm_9b35) is a descendant of
   .search-south-4e74 (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.surface_f8cc {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".sidebar-gas-4353" 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.video-c550 so it can't cause
   horizontal overflow anyway. */
.photo_000a,
.accent-2827,
.full_a6fe,
.modal_0ac2,
.dynamic-7cf3,
.modal_blue_285f,
.video-6458,
.fixed_e2e8,
.center-f398,
.description-e8fa,
.grid_bronze_9eb1 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .preview-orange-49b1 {
    padding: 8px 0;
  }
  
  .white_2d33 img {
    height: 28px;
    width: auto;
  }
  
  .light_fb23 {
    display: none !important;
  }
  
  .dark_7bb7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .dark_7bb7 svg {
    width: 14px;
    height: 14px;
  }
  
  .filter_5655 {
    padding: 6px;
  }
  
  .block-1c27 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .full_a6fe,
  .accent-2827,
  .modal_0ac2,
  .dynamic-7cf3,
  .mini_aa80,
  .complex_4f23,
  .slider_6301,
  .active_8c11,
  .avatar-25d3,
  .overlay-static-aa29,
  .row_5063 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .header-49b0,
  .huge_376d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hover-b407,
  .highlight-e65f,
  .light_ebb1,
  .icon-silver-546b,
  .advanced-b358,
  .wood-90fd,
  .lite-863b {
    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 */
  .last_08fa,
  .west-4079,
  .alert_d402,
  .chip-tiny-25d3,
  .pagination_e9db {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .heading-pink-2c92,
  .search-active-1aec,
  .picture-last-5359,
  .pagination-current-0c66 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hard_5f42,
  .breadcrumb_2e28 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .section_pink_6864,
  .notice-9ef5,
  .search_b601,
  .gas_d6d2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .input-east-2dfa,
  .form_current_cefb,
  .accordion-white-505d,
  .small_5f76,
  .layout-aeba,
  .over_06e7 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .last_08fa,
  .west-4079,
  .chip-tiny-25d3 {
    max-width: none !important;
  }
  
  .sidebar-gas-4353 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .heading-pink-2c92 {
    font-size: 1.5rem !important;
  }
  
  .search-active-1aec {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .menu-focused-5270,
  .header_over_731e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .picture-last-5359 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .sidebar_simple_4b0b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .active_e867 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .last_08fa,
  .chip-tiny-25d3 {
    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: 430e */
.ghost-box-y4 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.3;
}
