/* ============================================
   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 (.iron_6279) is a descendant of
   .down-97b4 (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.new_12be {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".background_c8e3" 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.large_0ccd so it can't cause
   horizontal overflow anyway. */
.component-a8cd,
.info_current_8c80,
.popup_hovered_1f62,
.stone_53ac,
.backdrop_ae30,
.clean-03f9,
.background_f781,
.active_4f93,
.label-b315,
.dropdown-fixed-34ca,
.focused-e942 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .secondary_dynamic_697e {
    padding: 8px 0;
  }
  
  .status_soft_5c95 img {
    height: 28px;
    width: auto;
  }
  
  .right-4454 {
    display: none !important;
  }
  
  .video-south-882b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .video-south-882b svg {
    width: 14px;
    height: 14px;
  }
  
  .module-5609 {
    padding: 6px;
  }
  
  .advanced-c4a4 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .popup_hovered_1f62,
  .info_current_8c80,
  .stone_53ac,
  .backdrop_ae30,
  .mask_6492,
  .search-iron-d62e,
  .column_new_db52,
  .clean-650d,
  .sort_6a38,
  .plasma-07a3,
  .gas_1260,
  .gallery-white-8524 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .hidden-short-e1fc,
  .nav-brown-4a0d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .white_11c6,
  .heading-a9cc,
  .input-cbbc,
  .breadcrumb_full_9d25,
  .red_898a,
  .alert-slow-2bfa,
  .media-tall-431f {
    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 */
  .shadow_easy_c7a7,
  .info_cool_1b75,
  .video-8d7f,
  .icon-dim-2a89,
  .glass-a7b9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .block-eb59,
  .gallery-b475,
  .stone_a22c,
  .gallery-cold-5c6a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .modal-thick-da01,
  .progress_upper_c6d9 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .wood_6b84,
  .wide-f696,
  .accordion-5a15,
  .bottom-5ba6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .form_medium_4095,
  .notice-liquid-9d99,
  .aside-8092,
  .photo_active_37ea,
  .row-hovered-d39c,
  .easy_d0d8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .shadow_easy_c7a7,
  .info_cool_1b75,
  .icon-dim-2a89 {
    max-width: none !important;
  }
  
  .background_c8e3 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .block-eb59 {
    font-size: 1.5rem !important;
  }
  
  .gallery-b475 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .surface-f471,
  .active_fluid_1b29 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .stone_a22c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .plasma_e51e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .logo-28cc {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .shadow_easy_c7a7,
  .icon-dim-2a89 {
    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: f28e */
.promo-block-m1 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.0;
}
