/* ============================================
   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 (.red_7b9c) is a descendant of
   .lite-3a55 (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.main-8938 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".image_last_5a3f" 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.orange_bbbb so it can't cause
   horizontal overflow anyway. */
.chip-333c,
.dynamic_87dd,
.outline_1f51,
.dropdown_27f8,
.primary-gold-399d,
.shadow-cold-06ae,
.shade_ddd1,
.module_9752,
.text_smooth_509d,
.info-action-4955,
.slow-45ee {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hidden-3d6a {
    padding: 8px 0;
  }
  
  .modal-cool-d647 img {
    height: 28px;
    width: auto;
  }
  
  .label-cold-8681 {
    display: none !important;
  }
  
  .pattern_pro_ee5b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .pattern_pro_ee5b svg {
    width: 14px;
    height: 14px;
  }
  
  .plasma_808a {
    padding: 6px;
  }
  
  .silver-573c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .outline_1f51,
  .dynamic_87dd,
  .dropdown_27f8,
  .primary-gold-399d,
  .plasma_76c1,
  .slider-rough-60eb,
  .article-glass-8835,
  .photo-hard-fddf,
  .accordion-1e2b,
  .picture_c962,
  .hard_bfca {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .shadow-dark-9abd,
  .narrow-154d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fluid_fe31,
  .highlight_tall_5aac,
  .next-8837,
  .widget-aa77,
  .photo-gold-0d24,
  .thumbnail_stone_9338,
  .item-motion-73fe {
    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 */
  .aside_orange_75a8,
  .info_12ec,
  .chip-8fe6,
  .overlay-inner-0705,
  .glass-20c3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .yellow-b838,
  .outline_19e6,
  .column_caf5,
  .input_3a5f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .light_715b,
  .secondary-prev-f345 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .row_north_3df7,
  .overlay_d880,
  .fluid-5d8e,
  .middle-177a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .message-9cad,
  .filter-dynamic-cc50,
  .video-7f13,
  .badge_dirty_a2f0,
  .easy-fdbc,
  .avatar_in_d78e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .aside_orange_75a8,
  .info_12ec,
  .overlay-inner-0705 {
    max-width: none !important;
  }
  
  .image_last_5a3f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .yellow-b838 {
    font-size: 1.5rem !important;
  }
  
  .outline_19e6 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .carousel_36a1,
  .message-76e4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .column_caf5 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .old_1cfe {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .active-2a69 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .aside_orange_75a8,
  .overlay-inner-0705 {
    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: a958 */
.shadow-element-j2 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.2;
}
