/* ============================================
   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 (.highlight_44e3) is a descendant of
   .carousel-fast-d2f1 (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.south-3eec {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".alert-9847" 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.widget-cb17 so it can't cause
   horizontal overflow anyway. */
.mini_62dc,
.active_25b6,
.input-iron-b7b9,
.footer_narrow_f0ae,
.photo_steel_acfc,
.gradient-ba1e,
.simple-afbe,
.breadcrumb_5b2c,
.tertiary-f453,
.module-684b,
.button_yellow_b313 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .secondary_purple_d253 {
    padding: 8px 0;
  }
  
  .header_79c7 img {
    height: 28px;
    width: auto;
  }
  
  .content_abf3 {
    display: none !important;
  }
  
  .current_ea22 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .current_ea22 svg {
    width: 14px;
    height: 14px;
  }
  
  .element_252f {
    padding: 6px;
  }
  
  .card-active-3c0b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .input-iron-b7b9,
  .active_25b6,
  .footer_narrow_f0ae,
  .photo_steel_acfc,
  .glass-1068,
  .easy-ea19,
  .texture-prev-7cfc,
  .hot_6ea3,
  .gallery_advanced_5798,
  .cold_201c,
  .column_24cd {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .notice-slow-e1d9,
  .sidebar-short-8930 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .detail-active-6e2f,
  .notice-east-a358,
  .silver-08d8,
  .label-purple-262a,
  .footer-d3eb,
  .aside-def5,
  .image-stone-3b91 {
    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 */
  .component-bronze-a24d,
  .popup_66e6,
  .video-active-563e,
  .narrow_6b4a,
  .blue_df24 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .video_west_0e48,
  .texture-glass-0b09,
  .over_0685,
  .down_1668 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .picture-smooth-fece,
  .chip_current_7f5e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .block_small_bbc2,
  .border_focused_2e66,
  .paragraph_c975,
  .card-9a8f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .widget-medium-67a1,
  .shade_purple_f8a3,
  .element_east_7bfe,
  .sort_10c7,
  .backdrop-paper-c8df,
  .border_3d06 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .component-bronze-a24d,
  .popup_66e6,
  .narrow_6b4a {
    max-width: none !important;
  }
  
  .alert-9847 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .video_west_0e48 {
    font-size: 1.5rem !important;
  }
  
  .texture-glass-0b09 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .gas-dcbd,
  .notification-dynamic-1dbf {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .over_0685 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .bottom-86eb {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .popup-warm-4a7f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .component-bronze-a24d,
  .narrow_6b4a {
    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: 88b8 */
.ghost-box-n2 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.2;
}
