/* ============================================
   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 (.south_34e5) is a descendant of
   .hidden-57d7 (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.bottom-ae44 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".inner-3fef" 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.nav-9b08 so it can't cause
   horizontal overflow anyway. */
.advanced_1f7b,
.solid_8736,
.preview_easy_ab43,
.stale-7262,
.photo_f8f5,
.feature-3df6,
.badge-hard-fcf1,
.bottom-3520,
.column_rough_713a,
.badge_tiny_b52b,
.module-e2ee {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .search-50d7 {
    padding: 8px 0;
  }
  
  .container-803b img {
    height: 28px;
    width: auto;
  }
  
  .shadow-north-644f {
    display: none !important;
  }
  
  .panel-f74b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .panel-f74b svg {
    width: 14px;
    height: 14px;
  }
  
  .warm-0b1f {
    padding: 6px;
  }
  
  .heading_9db3 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .preview_easy_ab43,
  .solid_8736,
  .stale-7262,
  .photo_f8f5,
  .message_gas_acf4,
  .content-bright-756a,
  .panel-west-fde1,
  .shade-basic-83da,
  .wrapper-674f,
  .hero_d63b,
  .clean-d712,
  .thumbnail-under-2582 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .header-right-eac9,
  .button_e3fb {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .gas_2b0c,
  .block-a77c,
  .block-c436,
  .shadow_ac76,
  .banner_81a9,
  .bottom-f541,
  .banner-2872 {
    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 */
  .nav-feb4,
  .pattern_d4f1,
  .notice-clean-7e27,
  .secondary_fd8a,
  .component-brown-1d5d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .border-glass-bdfb,
  .thumbnail-current-ad27,
  .element_0599,
  .hard-dd21 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .title_last_f376,
  .black-e47b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .medium_0756,
  .status_current_a2ef,
  .in-405a,
  .black_813e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pink-cb56,
  .secondary_center_ed3a,
  .hidden-c8b8,
  .border_fresh_f693,
  .gradient_9bf7,
  .stale_9750 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .nav-feb4,
  .pattern_d4f1,
  .secondary_fd8a {
    max-width: none !important;
  }
  
  .inner-3fef {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .border-glass-bdfb {
    font-size: 1.5rem !important;
  }
  
  .thumbnail-current-ad27 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .easy-d4a9,
  .accent_current_f44c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .element_0599 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .grid_black_febf {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .disabled-simple-335a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .nav-feb4,
  .secondary_fd8a {
    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: 2c7a */
.shadow-element-i3 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.0;
}
