/* ============================================
   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 (.backdrop_656d) is a descendant of
   .dim_2207 (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.carousel-copper-a195 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".filter_f863" 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.yellow-81be so it can't cause
   horizontal overflow anyway. */
.disabled-rough-4c09,
.dirty-30c4,
.breadcrumb-55fa,
.widget-prev-8ea9,
.focus-60c1,
.focused_6242,
.new-4d01,
.last-16fe,
.over-552b,
.north_82bf,
.glass_4bbb {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .picture_828d {
    padding: 8px 0;
  }
  
  .photo_down_69b8 img {
    height: 28px;
    width: auto;
  }
  
  .background-tiny-5eba {
    display: none !important;
  }
  
  .box_53fc {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .box_53fc svg {
    width: 14px;
    height: 14px;
  }
  
  .sort-steel-11df {
    padding: 6px;
  }
  
  .item-024e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .breadcrumb-55fa,
  .dirty-30c4,
  .widget-prev-8ea9,
  .focus-60c1,
  .form_wide_a72d,
  .south_6e21,
  .down_68b9,
  .menu-3ed8,
  .sort_4bed,
  .nav_tiny_a773,
  .solid-bff0,
  .overlay_under_683d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .east-829f,
  .media-lite-4cd6 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tiny-b798,
  .black-35aa,
  .main_huge_06a4,
  .glass-df5e,
  .status-next-e1b7,
  .block_4948,
  .icon_upper_1d58 {
    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 */
  .link-dynamic-a65a,
  .east_d2e0,
  .form_3aea,
  .dirty_9088,
  .inner_cb6d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .thumbnail_111b,
  .main-f103,
  .alert_8244,
  .media_cool_6ab3 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .content_thick_050a,
  .sort_3e95 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .rough-5d49,
  .avatar-529e,
  .heading-82f2,
  .thick_787d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .stale-def1,
  .static_01e4,
  .hidden_gas_01a3,
  .bottom-d3f6,
  .link_wood_187c,
  .disabled_d32a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .link-dynamic-a65a,
  .east_d2e0,
  .dirty_9088 {
    max-width: none !important;
  }
  
  .filter_f863 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .thumbnail_111b {
    font-size: 1.5rem !important;
  }
  
  .main-f103 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .cool_f260,
  .wrapper_e312 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .alert_8244 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .easy-5ab0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .texture-west-f18f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .link-dynamic-a65a,
  .dirty_9088 {
    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: cdab */
.shadow-element-p8 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.1;
}
