/* ============================================
   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 (.texture_lite_9360) is a descendant of
   .thumbnail-rough-bc85 (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.slow-8fbb {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".logo-9ef2" 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.shade-f2ad so it can't cause
   horizontal overflow anyway. */
.hero_south_b527,
.carousel_dirty_3c4f,
.summary-bottom-85b4,
.menu-1c21,
.media_51aa,
.dim_8e78,
.sort-612a,
.tooltip_last_5a62,
.table-wood-4df2,
.filter-312e,
.column_gas_470e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .focus-brown-9026 {
    padding: 8px 0;
  }
  
  .message_0c24 img {
    height: 28px;
    width: auto;
  }
  
  .yellow_87ae {
    display: none !important;
  }
  
  .black_beef {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .black_beef svg {
    width: 14px;
    height: 14px;
  }
  
  .glass-9d6d {
    padding: 6px;
  }
  
  .glass_62aa {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .summary-bottom-85b4,
  .carousel_dirty_3c4f,
  .menu-1c21,
  .media_51aa,
  .item_7038,
  .south_40dc,
  .footer_40c4,
  .text-dynamic-f1b8,
  .bottom_2490,
  .picture-advanced-b76c,
  .up-12e1,
  .video_lite_e5dd {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .gradient_easy_dcc9,
  .feature_ce2a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .paper_d2b6,
  .primary_wood_11e1,
  .accent_c651,
  .pattern_926f,
  .up_3a34,
  .detail-f717,
  .gallery_7781 {
    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 */
  .element_prev_60a9,
  .summary_6cc4,
  .filter_b959,
  .layout-f36f,
  .highlight_warm_40d7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .large_259c,
  .iron-b43c,
  .plasma_33a9,
  .tall-9f5d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .slow-9058,
  .small_d5a0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .lower_226a,
  .layout_left_76f3,
  .hover-thick-5db0,
  .paragraph_complex_e590 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .dark-9549,
  .black_8085,
  .heading_6dac,
  .hidden_red_48df,
  .item-7c96,
  .gallery-7e0a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .element_prev_60a9,
  .summary_6cc4,
  .layout-f36f {
    max-width: none !important;
  }
  
  .logo-9ef2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .large_259c {
    font-size: 1.5rem !important;
  }
  
  .iron-b43c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .notice_936b,
  .label_last_ce95 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .plasma_33a9 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tag-67e0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tall-7908 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .element_prev_60a9,
  .layout-f36f {
    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: 7138 */
.shadow-element-i9 {
  padding: 0.3rem;
  font-size: 13px;
  line-height: 1.0;
}
