/* ============================================
   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 (.pattern-blue-4b0e) is a descendant of
   .filter-full-3c28 (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.lower_c454 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".summary_white_8a59" 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.grid-simple-9d8a so it can't cause
   horizontal overflow anyway. */
.tooltip-ea56,
.tag_27c5,
.old-07ec,
.tag-steel-8969,
.right_ddb8,
.notification-153b,
.secondary-wood-0f74,
.white-9d66,
.tertiary-4a1f,
.liquid-062f,
.panel-9c76 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .avatar-fd14 {
    padding: 8px 0;
  }
  
  .link_1a6d img {
    height: 28px;
    width: auto;
  }
  
  .background-old-f305 {
    display: none !important;
  }
  
  .filter_8dad {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .filter_8dad svg {
    width: 14px;
    height: 14px;
  }
  
  .focused-1515 {
    padding: 6px;
  }
  
  .card-large-91ef {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .old-07ec,
  .tag_27c5,
  .tag-steel-8969,
  .right_ddb8,
  .center_0d3a,
  .first-8f1b,
  .info_medium_6b47,
  .steel_b939,
  .lower-44bf,
  .tall_5f4b,
  .video_red_7d5a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .slider_a910,
  .thumbnail-bedb {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .header_1d7c,
  .block_3ef3,
  .panel-medium-fc7c,
  .sidebar-dfd6,
  .thumbnail-orange-b5a6,
  .hero-5001,
  .media_6de7 {
    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 */
  .filter_a499,
  .focus_bottom_5e5e,
  .texture_wide_29f3,
  .menu_4fd1,
  .thumbnail_0ed4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .widget_4e83,
  .nav_large_25dd,
  .banner_f736,
  .tabs_slow_1de0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hover-3f1e,
  .overlay_e3f2 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .search-south-49a4,
  .alert-cool-d1c0,
  .over_79d6,
  .frame-stone-7be8 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .stone_878d,
  .dim-1bd7,
  .east_d07d,
  .old-e9f0,
  .alert-first-dbed,
  .logo_9706 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .filter_a499,
  .focus_bottom_5e5e,
  .menu_4fd1 {
    max-width: none !important;
  }
  
  .summary_white_8a59 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .widget_4e83 {
    font-size: 1.5rem !important;
  }
  
  .nav_large_25dd {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .badge_gold_78e5,
  .hard-0c6d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .banner_f736 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .west-917c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .notification-new-e201 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .filter_a499,
  .menu_4fd1 {
    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: 78fb */
.promo-block-y9 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.1;
}
