/* ============================================
   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 (.label_7ec5) is a descendant of
   .primary-pro-d228 (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.active-c447 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".yellow-2905" 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.gas_3176 so it can't cause
   horizontal overflow anyway. */
.component-9fca,
.description_1e3e,
.grid-0500,
.wood-de46,
.wrapper-a780,
.popup_b12f,
.fixed-82ea,
.dirty-0db9,
.description_6371,
.component-adb0,
.modal-wide-4e1b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .preview-prev-e8c2 {
    padding: 8px 0;
  }
  
  .large_3743 img {
    height: 28px;
    width: auto;
  }
  
  .menu-brown-062c {
    display: none !important;
  }
  
  .icon-da82 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .icon-da82 svg {
    width: 14px;
    height: 14px;
  }
  
  .element_tall_b64e {
    padding: 6px;
  }
  
  .steel_edac {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .grid-0500,
  .description_1e3e,
  .wood-de46,
  .wrapper-a780,
  .in_92c6,
  .tabs-aec2,
  .hard_067b,
  .background-6705,
  .tag_outer_daca,
  .south_c550,
  .steel-b8c7,
  .link-7b8d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .media-hovered-6cc8,
  .footer_blue_a7b1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .pattern-cold-a07d,
  .chip_9bcf,
  .badge-417f,
  .steel-e042,
  .module-fixed-ca20,
  .main_87b4,
  .nav_f84b {
    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 */
  .summary_7a1d,
  .menu_steel_b168,
  .frame_dae0,
  .badge-57ba,
  .new_e836 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .outer-a9ec,
  .full_9be9,
  .secondary-steel-fa84,
  .advanced_3ad7 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .clean_a1fe,
  .small-b311 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .title-dfbd,
  .shadow-4702,
  .thumbnail-91e9,
  .column_dirty_9b0e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .background-plasma-032a,
  .info_mini_f9f1,
  .frame_large_6caf,
  .pressed-6a23,
  .overlay-6a78,
  .purple-dc9e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .summary_7a1d,
  .menu_steel_b168,
  .badge-57ba {
    max-width: none !important;
  }
  
  .yellow-2905 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .outer-a9ec {
    font-size: 1.5rem !important;
  }
  
  .full_9be9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .logo-8d5c,
  .left-1f55 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .secondary-steel-fa84 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .prev-433a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .info-ac4d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .summary_7a1d,
  .badge-57ba {
    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: d956 */
.promo-block-b9 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.3;
}
