/* ============================================
   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 (.summary-south-607e) is a descendant of
   .tooltip_copper_3b6f (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.
   Two site templates coexist: legacy obfuscated-class (header.top-bdc8)
   and the redesigned template (header.element_a127). Keep both selectors. */
header.top-bdc8,
header.element_a127 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".layout-8228" 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.heading-7497 so it can't cause
   horizontal overflow anyway. */
.logo-soft-8575,
.medium-e81a,
.icon-4789,
.aside-fixed-d7b4,
.middle-2e2f,
.small_0fad,
.wood-fe27,
.main_266e,
.hover-cf95,
.widget-full-658a,
.accordion-4cd8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .logo_orange_a2b3 {
    padding: 8px 0;
  }
  
  .breadcrumb-full-cf57 img {
    height: 28px;
    width: auto;
  }
  
  .image-3983 {
    display: none !important;
  }
  
  .active_gold_fa56 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .active_gold_fa56 svg {
    width: 14px;
    height: 14px;
  }
  
  .east_c28b {
    padding: 6px;
  }
  
  .notice_7ffb {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .icon-4789,
  .medium-e81a,
  .aside-fixed-d7b4,
  .middle-2e2f,
  .table_tall_a7b6,
  .outer_0827,
  .detail_b459,
  .card_red_ce02,
  .video-fe82,
  .fast_967a,
  .footer-huge-b5f2,
  .overlay_f448 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .mask-brown-6043,
  .hero_under_64ce {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .brown-142c,
  .layout_620f,
  .frame_fdee,
  .dim-247f,
  .pattern_copper_e179,
  .fast-4889,
  .middle_29b5 {
    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 */
  .west_0e1f,
  .hard-c300,
  .accent-c06d,
  .row-under-ee14,
  .pattern-e598 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .carousel_pressed_cb71,
  .frame_5275,
  .wide_9302,
  .active_3f50 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .detail-88dd,
  .texture_9ed2 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hero_0657,
  .bronze-db40,
  .hard-775c,
  .banner-326b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .alert_50ec,
  .info-556b,
  .caption-a06f,
  .progress-soft-2d6a,
  .tiny-6d65,
  .nav_purple_3c83 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .west_0e1f,
  .hard-c300,
  .row-under-ee14 {
    max-width: none !important;
  }
  
  .layout-8228 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .carousel_pressed_cb71 {
    font-size: 1.5rem !important;
  }
  
  .frame_5275 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hard-741c,
  .overlay-soft-ee4d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .wide_9302 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .header-e06f {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hard-e96a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .west_0e1f,
  .row-under-ee14 {
    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: 94a5 */
.short_3e85 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: d850 */
.promo-block-x7 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.2;
}
