/* ============================================
   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 (.grid_first_7b71) is a descendant of
   .link_dim_4dba (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.article_warm_bc57 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".outline-d795" 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.heading_e80d so it can't cause
   horizontal overflow anyway. */
.item-left-20b8,
.column-f65b,
.container_1af2,
.title_f432,
.lower-486d,
.active_middle_592a,
.gradient-c20e,
.full_f52e,
.nav-simple-947a,
.first-9a9f,
.frame_bronze_03ee {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hot-1d45 {
    padding: 8px 0;
  }
  
  .filter-dynamic-433a img {
    height: 28px;
    width: auto;
  }
  
  .pattern-2354 {
    display: none !important;
  }
  
  .component-ab6a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .component-ab6a svg {
    width: 14px;
    height: 14px;
  }
  
  .component_41d8 {
    padding: 6px;
  }
  
  .table-0951 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .container_1af2,
  .column-f65b,
  .title_f432,
  .lower-486d,
  .out_1461,
  .hero-5012,
  .narrow_7172,
  .rough_736c,
  .panel_in_476a,
  .pro-8f42,
  .brown_cdfe {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .sort-95aa,
  .center_4a60 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .input-087a,
  .tag-6bbe,
  .table-gas-e9d9,
  .secondary-87df,
  .tall-637b,
  .preview_short_efdc,
  .disabled-693e {
    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 */
  .silver_89d1,
  .icon-a307,
  .header-8f17,
  .image-4590,
  .search_purple_d1f5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .shade-gold-fd18,
  .secondary-e888,
  .chip-out-4334,
  .narrow-4d27 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .yellow_a943,
  .brown-ac39 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .list-soft-39eb,
  .notification_e9f3,
  .list_dark_d3a7,
  .primary_62ea {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .filter_steel_f8c3,
  .warm-1da7,
  .info-old-d66e,
  .component-a5c5,
  .gallery_middle_e08f,
  .progress_new_ffbe {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .silver_89d1,
  .icon-a307,
  .image-4590 {
    max-width: none !important;
  }
  
  .outline-d795 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .shade-gold-fd18 {
    font-size: 1.5rem !important;
  }
  
  .secondary-e888 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .copper_b0f8,
  .bottom_e6e0 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .chip-out-4334 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .disabled_simple_06ce {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tertiary-mini-72c5 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .silver_89d1,
  .image-4590 {
    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: 2d4c */
.ghost-box-c8 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.3;
}
