/* ============================================
   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 (.sort-160f) is a descendant of
   .bronze-e0b8 (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_48aa {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hard-6d4d" 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.box_easy_9842 so it can't cause
   horizontal overflow anyway. */
.pattern-3532,
.label_stale_5ccf,
.tall_a865,
.detail-hot-765a,
.dropdown-center-ca65,
.row_bottom_976a,
.focus_40b8,
.badge_fa3e,
.thick-2cbb,
.avatar_6dbf,
.accordion-692b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .paragraph-white-d533 {
    padding: 8px 0;
  }
  
  .center_e85d img {
    height: 28px;
    width: auto;
  }
  
  .fluid-24f4 {
    display: none !important;
  }
  
  .steel_bb9d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .steel_bb9d svg {
    width: 14px;
    height: 14px;
  }
  
  .cool-0394 {
    padding: 6px;
  }
  
  .nav-1280 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tall_a865,
  .label_stale_5ccf,
  .detail-hot-765a,
  .dropdown-center-ca65,
  .shadow_warm_a43b,
  .header-6430,
  .accordion_7721,
  .thumbnail-417c,
  .caption-16c0,
  .notification-wide-02ed,
  .small_07bb,
  .pagination-175a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .search_fc09,
  .medium-c067 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .detail-a6b2,
  .article-9082,
  .component_active_b94f,
  .clean_7edd,
  .table_45cb,
  .aside-down-c9ed,
  .sort_a3bc {
    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 */
  .inner_879d,
  .clean-99e7,
  .badge-4943,
  .glass_862d,
  .hot_e46d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pressed-1091,
  .clean-332e,
  .aside-pink-3097,
  .fluid-c14c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .filter-4b13,
  .label-soft-3cef {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .advanced_defe,
  .alert_b2ff,
  .warm-50ac,
  .filter-paper-efcd {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .primary_hard_93da,
  .iron-a652,
  .input_black_9732,
  .active_cc2d,
  .pattern_large_8b3d,
  .backdrop-5075 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .inner_879d,
  .clean-99e7,
  .glass_862d {
    max-width: none !important;
  }
  
  .hard-6d4d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pressed-1091 {
    font-size: 1.5rem !important;
  }
  
  .clean-332e {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .carousel-orange-925c,
  .notification_lower_8e59 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .aside-pink-3097 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .chip_down_90cf {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .first-efd6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .inner_879d,
  .glass_862d {
    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: e0f1 */
.widget-item-y6 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.3;
}
