/* ============================================
   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 (.component_huge_7aec) is a descendant of
   .progress_0bd5 (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.block-wood-c3ff {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".mask_a497" 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.notification_c30a so it can't cause
   horizontal overflow anyway. */
.tertiary-bottom-20c5,
.pagination-9a54,
.element-0eb9,
.item_simple_15ad,
.sidebar_a295,
.element-huge-c0fe,
.complex-8df9,
.gas-1748,
.heading-slow-c098,
.blue_3d04,
.mask_200e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .info_6bd9 {
    padding: 8px 0;
  }
  
  .dropdown-0862 img {
    height: 28px;
    width: auto;
  }
  
  .badge-pink-542b {
    display: none !important;
  }
  
  .tabs_9076 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tabs_9076 svg {
    width: 14px;
    height: 14px;
  }
  
  .filter-17db {
    padding: 6px;
  }
  
  .gallery-229b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .element-0eb9,
  .pagination-9a54,
  .item_simple_15ad,
  .sidebar_a295,
  .hot-6017,
  .sort-a2b9,
  .black-ea52,
  .black_02a5,
  .down-1eab,
  .gold-5839,
  .overlay_c437,
  .fast_48ef {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .shade-yellow-4e28,
  .red-8c85 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .light_b0b5,
  .button_old_1e44,
  .dynamic_1bbe,
  .box-top-dc80,
  .item_stone_67a7,
  .copper-406e,
  .thick-305a {
    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 */
  .bright_2f66,
  .hero-mini-b858,
  .table-narrow-24ea,
  .frame-glass-a43f,
  .module-last-f550 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .copper_5e64,
  .gallery-glass-9e3b,
  .widget-f76a,
  .warm-7fdd {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .wood-b102,
  .dark_3eea {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tertiary_79b3,
  .next_40fc,
  .accordion-center-ae19,
  .bronze_3e5c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .accent-right-7ffb,
  .down_02ff,
  .mini_6754,
  .link-b981,
  .thick_74a0,
  .info_orange_f504 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .bright_2f66,
  .hero-mini-b858,
  .frame-glass-a43f {
    max-width: none !important;
  }
  
  .mask_a497 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .copper_5e64 {
    font-size: 1.5rem !important;
  }
  
  .gallery-glass-9e3b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .mask-warm-6768,
  .full_0dc7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .widget-f76a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .image_dark_5426 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .panel-a1a5 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .bright_2f66,
  .frame-glass-a43f {
    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: a133 */
.widget-item-r8 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}
