/* ============================================
   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 (.center_93b0) is a descendant of
   .gallery-85b7 (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.menu-882d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".wood-e599" 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.row-dim-d228 so it can't cause
   horizontal overflow anyway. */
.tall_553d,
.sidebar-c828,
.menu_fast_2ed2,
.header_638b,
.out-297f,
.section-a0f5,
.dynamic_70fe,
.hidden-3abc,
.article-2b0f,
.wrapper-wood-0130,
.small_d611 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .label_first_2d77 {
    padding: 8px 0;
  }
  
  .active_69de img {
    height: 28px;
    width: auto;
  }
  
  .new_5e4c {
    display: none !important;
  }
  
  .wrapper-152e {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .wrapper-152e svg {
    width: 14px;
    height: 14px;
  }
  
  .outline-wood-5370 {
    padding: 6px;
  }
  
  .border_1497 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .menu_fast_2ed2,
  .sidebar-c828,
  .header_638b,
  .out-297f,
  .text_under_a7fe,
  .outer-2494,
  .column_wood_f4ac,
  .paragraph-out-d9d1,
  .new_3c52,
  .popup_3c09,
  .title-e0a7,
  .warm-4d20 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .banner_complex_59f9,
  .basic-4d84 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .small_4ead,
  .content_pressed_2f0f,
  .modal_center_3eb5,
  .pattern_dynamic_d7dd,
  .tertiary_c1df,
  .component_3bb9,
  .tertiary-5b4c {
    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 */
  .focused_12c7,
  .filter_slow_2c5c,
  .nav_red_1488,
  .gradient_liquid_2e61,
  .cool_033a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .border_5baf,
  .video-29a0,
  .banner_6fd0,
  .menu-wood-a66f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .title_blue_0e82,
  .header_c667 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .selected-627f,
  .right-50af,
  .dropdown-2abc,
  .video_3e16 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pro_6c80,
  .hero_1855,
  .hidden-paper-e716,
  .media_selected_2b67,
  .carousel_63bf,
  .tabs-4605 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .focused_12c7,
  .filter_slow_2c5c,
  .gradient_liquid_2e61 {
    max-width: none !important;
  }
  
  .wood-e599 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .border_5baf {
    font-size: 1.5rem !important;
  }
  
  .video-29a0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .grid_top_33aa,
  .basic_fd0b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .banner_6fd0 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hero-d9b7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .media_f4e6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .focused_12c7,
  .gradient_liquid_2e61 {
    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: 4050 */
.ghost-box-k0 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.2;
}
