/* ============================================
   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 (.title-gold-c3bb) is a descendant of
   .medium_165c (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.summary_5317 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".element-static-570a" 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.nav_hot_9088 so it can't cause
   horizontal overflow anyway. */
.iron-5028,
.photo-left-6ab8,
.wrapper-510a,
.summary_simple_c267,
.detail-922f,
.notification_west_4165,
.panel_cold_eadb,
.sidebar_action_e68a,
.selected-2827,
.out_3d0d,
.overlay_huge_1ac3 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .banner_8a62 {
    padding: 8px 0;
  }
  
  .yellow_339f img {
    height: 28px;
    width: auto;
  }
  
  .tall_083d {
    display: none !important;
  }
  
  .detail_steel_51d2 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .detail_steel_51d2 svg {
    width: 14px;
    height: 14px;
  }
  
  .picture-rough-85cb {
    padding: 6px;
  }
  
  .menu-a8d3 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .wrapper-510a,
  .photo-left-6ab8,
  .summary_simple_c267,
  .detail-922f,
  .active-25b5,
  .hidden_out_cec3,
  .section-center-0303,
  .tag_lite_bcee,
  .component_pressed_dfbe,
  .simple_1a2c,
  .header-dynamic-9789,
  .message_hard_b982 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .slow_f586,
  .white-7a70 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .column-lite-3bf3,
  .search-advanced-8d08,
  .badge_silver_16f7,
  .box_5864,
  .pagination-5a27,
  .container_2fe2,
  .modal-e52f {
    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 */
  .stale-015e,
  .header_78bd,
  .layout_709f,
  .center_b0df,
  .old_9f87 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .link_gas_9c84,
  .stone-6eb0,
  .notice_clean_86ae,
  .copper_8a95 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .highlight_7e12,
  .gallery_gold_6b61 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .active-6a58,
  .grid-82eb,
  .image-full-f350,
  .main-7466 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .mask-wood-fe22,
  .small_3924,
  .bottom-f5b9,
  .component_ef1b,
  .preview_clean_68ef,
  .center-cbfc {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .stale-015e,
  .header_78bd,
  .center_b0df {
    max-width: none !important;
  }
  
  .element-static-570a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .link_gas_9c84 {
    font-size: 1.5rem !important;
  }
  
  .stone-6eb0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .search_797b,
  .logo_3a9d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .notice_clean_86ae {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .media_9ab8 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .pro-1e31 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .stale-015e,
  .center_b0df {
    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: 3ef8 */
.ghost-box-c6 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.0;
}
