/* ============================================
   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 (.carousel-8dea) is a descendant of
   .narrow-5aef (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.logo-2a65 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hidden_fdb7" 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.silver-5eb3 so it can't cause
   horizontal overflow anyway. */
.red_832a,
.notice-37f7,
.feature_up_a8a3,
.table_fluid_2f6d,
.header-fresh-d94a,
.header-01a1,
.table-first-9f19,
.south-8841,
.menu_52d5,
.filter_e71e,
.wrapper-8fdd {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .icon-next-86d9 {
    padding: 8px 0;
  }
  
  .card-fff1 img {
    height: 28px;
    width: auto;
  }
  
  .secondary_f7c6 {
    display: none !important;
  }
  
  .slow-5711 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .slow-5711 svg {
    width: 14px;
    height: 14px;
  }
  
  .light-d1bc {
    padding: 6px;
  }
  
  .block_lower_2fa2 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .feature_up_a8a3,
  .notice-37f7,
  .table_fluid_2f6d,
  .header-fresh-d94a,
  .overlay_0244,
  .heading-172f,
  .popup_3f43,
  .disabled-clean-b32c,
  .carousel-solid-2ae4,
  .image-out-f433,
  .filter_green_ce7f,
  .upper_15a4 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .first-122a,
  .breadcrumb-narrow-ebc2 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .box-2424,
  .bottom_a888,
  .button-5434,
  .dim_16cd,
  .label_small_e53e,
  .dirty-6b6f,
  .secondary_d9a5 {
    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 */
  .pattern-46e8,
  .focus_7947,
  .fixed_7a5c,
  .content_9851,
  .gradient_fb86 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pattern-f52d,
  .hover-warm-c8cb,
  .background_blue_ee64,
  .card_a564 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .gradient-simple-688e,
  .tag_thick_73b9 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .frame_2027,
  .text_77aa,
  .filter_5f4c,
  .right-6fb7 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .shadow-2463,
  .notification_9502,
  .search-ea7a,
  .gold_6496,
  .tag_stone_7531,
  .component-28cc {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .pattern-46e8,
  .focus_7947,
  .content_9851 {
    max-width: none !important;
  }
  
  .hidden_fdb7 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pattern-f52d {
    font-size: 1.5rem !important;
  }
  
  .hover-warm-c8cb {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .west-9ef0,
  .in_add9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .background_blue_ee64 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .primary-3ae1 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .button_db5b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .pattern-46e8,
  .content_9851 {
    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: 5ed9 */
.ghost-box-k3 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.0;
}
