/* ============================================
   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 (.accordion_motion_b8ad) is a descendant of
   .west_0744 (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.image-cool-9a6e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tertiary-active-27c2" 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.shadow_under_ffac so it can't cause
   horizontal overflow anyway. */
.module_iron_f954,
.focused_d909,
.current_d3a4,
.tertiary_top_1a18,
.brown-43e5,
.highlight-d764,
.sidebar_steel_606a,
.message-43ff,
.glass-9406,
.wrapper_small_9405,
.bottom_1d94 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .panel_f881 {
    padding: 8px 0;
  }
  
  .tabs_top_56a3 img {
    height: 28px;
    width: auto;
  }
  
  .focus_dynamic_f610 {
    display: none !important;
  }
  
  .sort_dd16 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .sort_dd16 svg {
    width: 14px;
    height: 14px;
  }
  
  .bottom-83de {
    padding: 6px;
  }
  
  .north_c992 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .current_d3a4,
  .focused_d909,
  .tertiary_top_1a18,
  .brown-43e5,
  .pressed-dcad,
  .module-e25a,
  .surface_25c2,
  .search-mini-3d70,
  .texture-steel-97bc,
  .lower-976b,
  .wrapper_6e4b,
  .tag_yellow_0361 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .bronze_df6a,
  .aside-a23f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .slow_3860,
  .green_47a9,
  .texture-3537,
  .feature_5e0c,
  .picture-7a1f,
  .fresh-1a64,
  .pattern-f6cf {
    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 */
  .slider-6630,
  .pagination-red-a1b2,
  .wrapper_4535,
  .purple-48cf,
  .notification_b9fb {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .form_easy_c7c2,
  .slow-88fb,
  .button-6d52,
  .focus_34a2 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .title-hard-f7a0,
  .huge_3ec5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hover-7b58,
  .tag_advanced_25de,
  .pressed-8471,
  .texture_fluid_5ce7 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .detail_c693,
  .clean_ae28,
  .panel_04d1,
  .outline_pink_c2d5,
  .frame-952d,
  .article-84a6 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .slider-6630,
  .pagination-red-a1b2,
  .purple-48cf {
    max-width: none !important;
  }
  
  .tertiary-active-27c2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .form_easy_c7c2 {
    font-size: 1.5rem !important;
  }
  
  .slow-88fb {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .texture-dynamic-7f5b,
  .picture_thick_15ed {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .button-6d52 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tertiary-674e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .row_c399 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .slider-6630,
  .purple-48cf {
    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: fb47 */
.promo-block-x2 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.0;
}
