/* ============================================
   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 (.secondary_709a) is a descendant of
   .image_thick_4dda (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.header_hard_d69c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".input-76b3" 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.logo_3105 so it can't cause
   horizontal overflow anyway. */
.grid-babb,
.cool-7224,
.tabs_4c28,
.notice_8761,
.red_ef0f,
.hidden-clean-b656,
.mini_3c66,
.easy_fb5a,
.mini-b825,
.plasma-48e9,
.under-02c9 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .banner_ba74 {
    padding: 8px 0;
  }
  
  .caption_8a95 img {
    height: 28px;
    width: auto;
  }
  
  .basic_ee2f {
    display: none !important;
  }
  
  .texture_5ffb {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .texture_5ffb svg {
    width: 14px;
    height: 14px;
  }
  
  .new_c59b {
    padding: 6px;
  }
  
  .menu_wood_12be {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tabs_4c28,
  .cool-7224,
  .notice_8761,
  .red_ef0f,
  .tall_693d,
  .notice_under_ba25,
  .picture_complex_e316,
  .thumbnail-8f2d,
  .primary_c3d2,
  .background-6bf2,
  .steel_78e6,
  .clean_529a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .layout_wood_578c,
  .lower-eb11 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .huge-f85a,
  .heading_268d,
  .next-1b4d,
  .background-aacc,
  .shade-red-ca3d,
  .tiny_44cd,
  .fixed_6f51 {
    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 */
  .thick-88c2,
  .item_full_6ab7,
  .input-5ed1,
  .fast-8234,
  .form-rough-3b78 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .footer_3dc8,
  .outer_d649,
  .dropdown_1fdd,
  .outline-dabc {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .primary_outer_4621,
  .focus-hot-4798 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .block_8d7b,
  .main-tiny-d8b4,
  .panel-5ab9,
  .hover_734c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .menu-191d,
  .notice_983d,
  .badge_cc4b,
  .white-b01f,
  .carousel_out_01e2,
  .dropdown-yellow-bf3f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .thick-88c2,
  .item_full_6ab7,
  .fast-8234 {
    max-width: none !important;
  }
  
  .input-76b3 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .footer_3dc8 {
    font-size: 1.5rem !important;
  }
  
  .outer_d649 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tabs_paper_2a26,
  .overlay_c981 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .dropdown_1fdd {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .layout-easy-77c2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .down_963f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .thick-88c2,
  .fast-8234 {
    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: 1585 */
.ghost-box-f7 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.3;
}
