/* ============================================
   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 (.article_right_84da) is a descendant of
   .stone_40a9 (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.warm-fa51 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".menu_4b71" 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.outer_c838 so it can't cause
   horizontal overflow anyway. */
.header-complex-1b0b,
.narrow_060e,
.video_clean_7337,
.component-purple-d802,
.lower-bb2f,
.item_complex_af9d,
.mask_e899,
.full-9fa6,
.nav-upper-eeb5,
.layout-dbe7,
.orange_f4dc {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .item-north-748e {
    padding: 8px 0;
  }
  
  .button_white_7a9b img {
    height: 28px;
    width: auto;
  }
  
  .logo-fresh-fdcb {
    display: none !important;
  }
  
  .description-advanced-6eb0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .description-advanced-6eb0 svg {
    width: 14px;
    height: 14px;
  }
  
  .small-9627 {
    padding: 6px;
  }
  
  .banner-598b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .video_clean_7337,
  .narrow_060e,
  .component-purple-d802,
  .lower-bb2f,
  .wrapper_pressed_f400,
  .left_8490,
  .panel_a174,
  .alert_rough_89bf,
  .dropdown-basic-8b9c,
  .smooth-20a5,
  .shadow_5875,
  .item_red_ca0e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .pattern-last-1212,
  .text_selected_df42 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .mask-1e66,
  .tabs_dynamic_4354,
  .frame_green_24ca,
  .module_0c47,
  .surface_02a8,
  .active-simple-7a45,
  .focused_fab3 {
    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 */
  .aside-3866,
  .brown-8d3b,
  .picture_00ba,
  .column-active-685f,
  .popup-wide-1a58 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .current-4b1b,
  .search-hard-0a0c,
  .popup_e4f2,
  .hovered-1fdd {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .element_top_d23a,
  .info_7913 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .sidebar-8474,
  .progress-24d6,
  .last-615e,
  .form_east_09c8 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .soft-3204,
  .green_16e5,
  .filter_copper_b855,
  .accordion_light_382e,
  .gallery-1900,
  .article-e126 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .aside-3866,
  .brown-8d3b,
  .column-active-685f {
    max-width: none !important;
  }
  
  .menu_4b71 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .current-4b1b {
    font-size: 1.5rem !important;
  }
  
  .search-hard-0a0c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .main-focused-c4a5,
  .bottom_5ff4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .popup_e4f2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .over_ca14 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .brown-e18a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .aside-3866,
  .column-active-685f {
    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: e9ca */
.shadow-element-u1 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.2;
}
