/* ============================================
   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 (.cool-6012) is a descendant of
   .dynamic-97dc (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.disabled_advanced_7e8b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".secondary_e12e" 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.outline_a6d1 so it can't cause
   horizontal overflow anyway. */
.video-3af4,
.alert_767e,
.solid_7e79,
.cold_f859,
.nav_orange_07dc,
.focus-inner-b7c8,
.border_tiny_cb92,
.row_warm_4b28,
.hard-3142,
.hero-yellow-77d9,
.old-9097 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .fixed-c72c {
    padding: 8px 0;
  }
  
  .carousel_soft_b967 img {
    height: 28px;
    width: auto;
  }
  
  .chip-1ae8 {
    display: none !important;
  }
  
  .bottom_6c82 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .bottom_6c82 svg {
    width: 14px;
    height: 14px;
  }
  
  .new_0558 {
    padding: 6px;
  }
  
  .grid-01b6 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .solid_7e79,
  .alert_767e,
  .cold_f859,
  .nav_orange_07dc,
  .overlay_99bb,
  .middle_5ed1,
  .blue-0b08,
  .tertiary_57b0,
  .content_dirty_16ec,
  .article_wood_1d94,
  .gas_061e,
  .block_action_cee0 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .black_226b,
  .secondary-58c2 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .black-7f72,
  .title_6011,
  .button-4280,
  .cold_ebdf,
  .upper_cbcd,
  .surface_29ac,
  .in-a597 {
    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 */
  .block-cold-21b3,
  .shadow_9546,
  .plasma_4084,
  .orange-361c,
  .caption_363b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .form_south_fab8,
  .widget_4cf9,
  .thumbnail-b194,
  .message-4a04 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .accent-dirty-c049,
  .detail-29ae {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hard-6b8e,
  .silver-139f,
  .item_221c,
  .pagination-upper-6c57 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .static_bfc8,
  .link_33e0,
  .alert_b994,
  .header_33d2,
  .widget_dirty_30e0,
  .label-plasma-a2b8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .block-cold-21b3,
  .shadow_9546,
  .orange-361c {
    max-width: none !important;
  }
  
  .secondary_e12e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .form_south_fab8 {
    font-size: 1.5rem !important;
  }
  
  .widget_4cf9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .layout_3e1b,
  .shade-smooth-4385 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .thumbnail-b194 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .secondary-gold-c2b9 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .texture-f8ad {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .block-cold-21b3,
  .orange-361c {
    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: 4358 */
.phantom-card-m0 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.3;
}
