/* ============================================
   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 (.sort-4793) is a descendant of
   .gradient-58fd (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.old-4c5c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".summary_4c93" 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.element-stone-964c so it can't cause
   horizontal overflow anyway. */
.accent_last_504b,
.pressed_9e18,
.heading_stale_bd0a,
.article_bright_9c14,
.west-5e21,
.shadow_active_be14,
.pattern_bcba,
.sort-large-70c4,
.photo_over_5dfd,
.progress_tiny_d5fb,
.carousel-5af4 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .header-bfb1 {
    padding: 8px 0;
  }
  
  .silver_6bbb img {
    height: 28px;
    width: auto;
  }
  
  .component_a15b {
    display: none !important;
  }
  
  .tooltip-wood-d4d4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tooltip-wood-d4d4 svg {
    width: 14px;
    height: 14px;
  }
  
  .out-8771 {
    padding: 6px;
  }
  
  .primary-right-7137 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .heading_stale_bd0a,
  .pressed_9e18,
  .article_bright_9c14,
  .west-5e21,
  .photo_6ee1,
  .paragraph_d0f6,
  .modal_79c8,
  .hard_792b,
  .lite-9781,
  .component_9925,
  .component_9b15,
  .static-77c1 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .purple-4eb3,
  .sort_864b {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .text_bronze_eb6c,
  .box-3a4c,
  .breadcrumb_solid_18f7,
  .border_e8ab,
  .focused_2a4a,
  .hover-over-725f,
  .highlight-3b27 {
    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 */
  .west_1810,
  .basic-72bf,
  .inner-40cc,
  .upper-fbb1,
  .icon-mini-7223 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .component_full_1ac2,
  .element_5712,
  .dropdown-057d,
  .section_2171 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .next-fadb,
  .gallery_south_1f99 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .filter-liquid-02bc,
  .label-b6f7,
  .out-7441,
  .shade_lite_f5d3 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .short-4511,
  .hero_black_90d0,
  .active_298d,
  .border_light_14b6,
  .caption-silver-b59c,
  .media-81e8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .west_1810,
  .basic-72bf,
  .upper-fbb1 {
    max-width: none !important;
  }
  
  .summary_4c93 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .component_full_1ac2 {
    font-size: 1.5rem !important;
  }
  
  .element_5712 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .main_1d9f,
  .glass_0368 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .dropdown-057d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .title-a13c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .element_108c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .west_1810,
  .upper-fbb1 {
    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: b205 */
.promo-block-e3 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.3;
}
