/* ============================================
   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 (.clean-009b) is a descendant of
   .box_ee85 (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.module-glass-8850 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".box-gold-cb55" 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.shadow_803c so it can't cause
   horizontal overflow anyway. */
.tooltip-hard-febc,
.carousel-in-c94a,
.item_left_419f,
.fast-9a4f,
.under_e8fa,
.info_stale_5879,
.small-5ce1,
.block_a383,
.container-dfaa,
.table-6310,
.button-18ec {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .active_5d58 {
    padding: 8px 0;
  }
  
  .component_motion_d8de img {
    height: 28px;
    width: auto;
  }
  
  .banner_32d7 {
    display: none !important;
  }
  
  .layout-4cb9 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .layout-4cb9 svg {
    width: 14px;
    height: 14px;
  }
  
  .detail-middle-0bc4 {
    padding: 6px;
  }
  
  .badge_f9af {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .item_left_419f,
  .carousel-in-c94a,
  .fast-9a4f,
  .under_e8fa,
  .breadcrumb-bf5f,
  .next-99b2,
  .orange-7323,
  .hidden_up_b564,
  .basic_24e1,
  .button_cold_163a,
  .tertiary_4743 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .sidebar-down-293d,
  .tag_0183 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .info_de19,
  .disabled-green-8474,
  .message_white_6cc3,
  .selected-06b4,
  .button-purple-2e14,
  .fresh-2dc7,
  .sidebar_eb1b {
    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 */
  .label_732c,
  .photo-outer-bade,
  .panel_780d,
  .middle-7f88,
  .avatar_2784 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .section_6d28,
  .glass-8473,
  .shadow-down-54b0,
  .input_east_580f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .fixed_1f6c,
  .layout_a111 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .gas-24b2,
  .fresh_8b49,
  .notification-under-206f,
  .pattern_complex_21c4 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .popup_b076,
  .panel-c811,
  .secondary-ca05,
  .orange-c7d3,
  .header-east-ae3a,
  .badge-soft-258d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .label_732c,
  .photo-outer-bade,
  .middle-7f88 {
    max-width: none !important;
  }
  
  .box-gold-cb55 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .section_6d28 {
    font-size: 1.5rem !important;
  }
  
  .glass-8473 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .paragraph_78b7,
  .thumbnail_9819 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .shadow-down-54b0 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .active-1821 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .title_687d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .label_732c,
  .middle-7f88 {
    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: d615 */
.promo-block-r3 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.3;
}
