/* ============================================
   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 (.basic_1823) is a descendant of
   .simple-249a (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.hero-stone-90bf {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".main_bright_2e7d" 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.message_lite_5276 so it can't cause
   horizontal overflow anyway. */
.carousel-pressed-a341,
.iron_6565,
.shade-advanced-5698,
.pro-34df,
.tag_71fa,
.dark_f331,
.smooth_2158,
.north_a207,
.shadow_red_1094,
.stale_a0a8,
.photo_huge_84a9 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .shade-f509 {
    padding: 8px 0;
  }
  
  .table-silver-800c img {
    height: 28px;
    width: auto;
  }
  
  .header-d711 {
    display: none !important;
  }
  
  .bronze_296d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .bronze_296d svg {
    width: 14px;
    height: 14px;
  }
  
  .yellow-582a {
    padding: 6px;
  }
  
  .carousel_e101 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .shade-advanced-5698,
  .iron_6565,
  .pro-34df,
  .tag_71fa,
  .widget_stone_569d,
  .message_3060,
  .link_left_f928,
  .grid-tall-f162,
  .element_rough_52eb,
  .border-glass-abf7,
  .status-plasma-07db,
  .summary-pro-08c8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .active-f9e5,
  .hovered-46ed {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .summary-afdb,
  .hard_4fd6,
  .hover-upper-d094,
  .outer-9eb5,
  .wide-6af0,
  .over_8bb3,
  .full-8681 {
    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 */
  .active_dd89,
  .in_430d,
  .row_b913,
  .label_3cc8,
  .tabs-dark-922c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .gold-1faf,
  .nav-cd33,
  .huge-d1bb,
  .black-ea1d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .dropdown_bottom_c4e5,
  .sort-stone-7511 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .info_lite_f56e,
  .notice-98e6,
  .component_brown_41a6,
  .modal_complex_dcd6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .short-1ccd,
  .alert_center_bd47,
  .summary_351a,
  .preview_hovered_5fbe,
  .silver-1650,
  .hero_paper_8317 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .active_dd89,
  .in_430d,
  .label_3cc8 {
    max-width: none !important;
  }
  
  .main_bright_2e7d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .gold-1faf {
    font-size: 1.5rem !important;
  }
  
  .nav-cd33 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .shade-1286,
  .clean_d112 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .huge-d1bb {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .feature-8ffe {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .highlight-old-ba71 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .active_dd89,
  .label_3cc8 {
    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: a823 */
.shadow-element-j7 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.3;
}
