/* ============================================
   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 (.layout_098e) is a descendant of
   .hovered-f459 (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.status_e02f)
   and the redesigned template (header.hovered_d319). Keep both selectors. */
header.status_e02f,
header.hovered_d319 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".popup_7563" 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.element_smooth_69dc so it can't cause
   horizontal overflow anyway. */
.disabled_down_653a,
.mask-dynamic-591c,
.north-fafa,
.pro_a7e6,
.dark-6493,
.active-de76,
.current-90ea,
.form-cold-1c6f,
.gallery-f811,
.active_4a5c,
.texture-complex-adfc {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .carousel_22a3 {
    padding: 8px 0;
  }
  
  .hero_hard_0b23 img {
    height: 28px;
    width: auto;
  }
  
  .pattern_bb80 {
    display: none !important;
  }
  
  .tabs-1531 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tabs-1531 svg {
    width: 14px;
    height: 14px;
  }
  
  .shade-c651 {
    padding: 6px;
  }
  
  .aside-24f7 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .north-fafa,
  .mask-dynamic-591c,
  .pro_a7e6,
  .dark-6493,
  .bronze_b3ab,
  .accordion_narrow_7cd0,
  .light_4a97,
  .mask_6fd8,
  .active_fbb1,
  .detail_thick_8a28,
  .progress-silver-bb8c,
  .overlay_a9dc {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .slow_ada9,
  .tall_c060 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .alert-afbe,
  .dynamic_26bf,
  .photo_0e7e,
  .light_e629,
  .action-5595,
  .out-35b3,
  .accordion-1632 {
    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 */
  .sidebar_gold_6d4d,
  .secondary_liquid_9f31,
  .in-34f2,
  .breadcrumb-up-d916,
  .hero-solid-c43e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .basic_f977,
  .grid-f126,
  .item-left-a7f0,
  .primary-fresh-cf43 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .frame-71a2,
  .green-cb0f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .soft_18b5,
  .picture_7b60,
  .clean-0c8c,
  .notice-thick-800c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .feature_action_cf19,
  .button_bottom_5884,
  .content-9c94,
  .frame_5fb9,
  .backdrop_complex_a7e3,
  .green_e7e2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .sidebar_gold_6d4d,
  .secondary_liquid_9f31,
  .breadcrumb-up-d916 {
    max-width: none !important;
  }
  
  .popup_7563 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .basic_f977 {
    font-size: 1.5rem !important;
  }
  
  .grid-f126 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .message_fresh_7462,
  .tall-9a21 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .item-left-a7f0 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .current_7bbc {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .progress_wide_371f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .sidebar_gold_6d4d,
  .breadcrumb-up-d916 {
    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 */
.frame-small-7aad {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: b05a */
.ghost-box-t7 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.0;
}
