/* ============================================
   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 (.wood-9ecd) is a descendant of
   .tooltip_19b0 (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.
   Two site templates coexist: legacy obfuscated-class (header.feature_copper_a49f)
   and the redesigned template (header.footer_29b1). Keep both selectors. */
header.feature_copper_a49f,
header.footer_29b1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".west-fd5d" 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.new-d17b so it can't cause
   horizontal overflow anyway. */
.row_silver_838b,
.blue-0b32,
.full-ec26,
.panel_motion_91f6,
.hovered-6aea,
.link_38ae,
.active-f53b,
.overlay_54e8,
.next_ea21,
.glass-98d4,
.photo-red-793a {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .shade_upper_3522 {
    padding: 8px 0;
  }
  
  .up_fb1c img {
    height: 28px;
    width: auto;
  }
  
  .dim_32bb {
    display: none !important;
  }
  
  .copper_451a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .copper_451a svg {
    width: 14px;
    height: 14px;
  }
  
  .east_41b5 {
    padding: 6px;
  }
  
  .description_3df7 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .full-ec26,
  .blue-0b32,
  .panel_motion_91f6,
  .hovered-6aea,
  .alert-5f92,
  .picture_current_4b68,
  .panel-16bc,
  .frame-in-47d9,
  .media-83cc,
  .solid_81ef,
  .sort_01a6,
  .box-north-c279 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .short_aa7c,
  .tiny_45d3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .lower_8ce6,
  .label_fresh_5dd5,
  .cold-6a3c,
  .primary_34c5,
  .feature_8adb,
  .tabs_af72,
  .wide_944a {
    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 */
  .header-a1cc,
  .main-aca0,
  .brown-e998,
  .background_683c,
  .hidden_medium_277b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .blue_2458,
  .dirty_7d08,
  .backdrop_8f2a,
  .next-4d5d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .blue-3452,
  .overlay-mini-f93c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .carousel-affa,
  .content-solid-2721,
  .shadow_6533,
  .icon-091f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .alert_solid_0061,
  .header_new_c6bf,
  .hover_black_bae1,
  .short-fbd1,
  .border_pink_c8ff,
  .pattern_right_e8cd {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .header-a1cc,
  .main-aca0,
  .background_683c {
    max-width: none !important;
  }
  
  .west-fd5d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .blue_2458 {
    font-size: 1.5rem !important;
  }
  
  .dirty_7d08 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .primary-lower-486a,
  .list-brown-6219 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .backdrop_8f2a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .button_solid_994e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .banner-916b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .header-a1cc,
  .background_683c {
    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: 94a5 */
.accordion_action_4eb8 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: a225 */
.promo-block-r9 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.0;
}
