/* ============================================
   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 (.pagination_north_e029) is a descendant of
   .sort_ca22 (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.modal-d9ff {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hover_up_e9b2" 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.widget_7872 so it can't cause
   horizontal overflow anyway. */
.center_aa3f,
.card_narrow_3d79,
.banner-south-d9b1,
.solid-997d,
.backdrop-upper-c3fc,
.sort-bottom-8a70,
.cold-7bfb,
.progress-green-4e0e,
.wide-d390,
.prev-36df,
.brown-5282 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .current-59d1 {
    padding: 8px 0;
  }
  
  .dropdown_50fc img {
    height: 28px;
    width: auto;
  }
  
  .in-519d {
    display: none !important;
  }
  
  .breadcrumb_cold_bdfa {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .breadcrumb_cold_bdfa svg {
    width: 14px;
    height: 14px;
  }
  
  .hard_f582 {
    padding: 6px;
  }
  
  .input_iron_e115 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .banner-south-d9b1,
  .card_narrow_3d79,
  .solid-997d,
  .backdrop-upper-c3fc,
  .primary_orange_1aab,
  .heading_north_b854,
  .hidden-pro-8c2f,
  .sort_90e9,
  .filter_copper_cfc1,
  .detail-east-0fee,
  .avatar-d44f,
  .up_7a3b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .top-4aaf,
  .solid-66dd {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .carousel-5e8a,
  .container-2fb9,
  .purple-bd1d,
  .brown_cc14,
  .left-6150,
  .article-ba49,
  .preview-copper-18f1 {
    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 */
  .smooth_592d,
  .paper-92b8,
  .steel_6445,
  .heading-33cb,
  .message_pressed_075e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .blue-bb0e,
  .badge_5e17,
  .in-3c7c,
  .summary-fresh-85e4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .focus_solid_434f,
  .alert_6acf {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .simple-7a5b,
  .sort-hot-d39c,
  .large-3fbd,
  .grid_e674 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .glass_a6bd,
  .pagination_892d,
  .stale_28a8,
  .badge-00ae,
  .background_copper_79ab,
  .content-8a8e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .smooth_592d,
  .paper-92b8,
  .heading-33cb {
    max-width: none !important;
  }
  
  .hover_up_e9b2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .blue-bb0e {
    font-size: 1.5rem !important;
  }
  
  .badge_5e17 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .wrapper_1ced,
  .fresh_9561 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .in-3c7c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .slider-26ad {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .sort_hovered_8299 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .smooth_592d,
  .heading-33cb {
    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: 2db7 */
.promo-block-v5 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.1;
}
