/* ============================================
   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 (.wrapper-fc8d) is a descendant of
   .popup-708c (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.pattern_top_7a4f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".lite_6bb5" 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.pink_b094 so it can't cause
   horizontal overflow anyway. */
.north_e141,
.module_west_3d6f,
.badge-wide-cf12,
.hot_f367,
.header-north-7453,
.advanced-a59f,
.element-04c8,
.thumbnail-00b7,
.article_f29b,
.link-center-bd70,
.badge_8eec {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .background_576d {
    padding: 8px 0;
  }
  
  .blue-2cf6 img {
    height: 28px;
    width: auto;
  }
  
  .hidden_west_b3b2 {
    display: none !important;
  }
  
  .mask-gas-32f3 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .mask-gas-32f3 svg {
    width: 14px;
    height: 14px;
  }
  
  .gallery_stone_80e1 {
    padding: 6px;
  }
  
  .form-d9a0 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .badge-wide-cf12,
  .module_west_3d6f,
  .hot_f367,
  .header-north-7453,
  .media_f2fa,
  .notice_out_50dd,
  .short_d207,
  .menu-lite-00be,
  .hovered-25e4,
  .under-1945,
  .notification-0cc8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .gallery_white_32fb,
  .bronze_b8d2 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .south_b2e7,
  .shadow-70b4,
  .nav_6f80,
  .right_be61,
  .container-5a65,
  .hard_7f20,
  .lower_6d94 {
    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 */
  .light_0754,
  .list-3ba5,
  .info-d1ef,
  .feature-static-be33,
  .picture-next-53bb {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .text-170e,
  .icon-3a4c,
  .border_fresh_4873,
  .accent-large-7357 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .static-9fdb,
  .image-cd7f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .narrow_732a,
  .layout_bd52,
  .title-254d,
  .secondary_d035 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .modal-9e22,
  .top-8d36,
  .last-f53d,
  .white_e660,
  .red_a11a,
  .component_large_13a1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .light_0754,
  .list-3ba5,
  .feature-static-be33 {
    max-width: none !important;
  }
  
  .lite_6bb5 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .text-170e {
    font-size: 1.5rem !important;
  }
  
  .icon-3a4c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .wide_454f,
  .left_ac78 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .border_fresh_4873 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .sort-0be3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tabs-8e0f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .light_0754,
  .feature-static-be33 {
    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: a405 */
.promo-block-m7 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.2;
}
