/* ============================================
   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 (.header-0a05) is a descendant of
   .gallery_3c69 (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.tooltip-a568)
   and the redesigned template (header.narrow-bc4f). Keep both selectors. */
header.tooltip-a568,
header.narrow-bc4f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".section_a9ce" 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.main-down-8ead so it can't cause
   horizontal overflow anyway. */
.pressed_7fdf,
.widget_selected_ab6b,
.center-f1e5,
.form-f280,
.search-40c6,
.shadow-brown-7d1c,
.tertiary_wide_43f2,
.wrapper_basic_7ad5,
.section_522f,
.frame_dirty_0813,
.banner-73f3 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .section_bcb5 {
    padding: 8px 0;
  }
  
  .outer_3893 img {
    height: 28px;
    width: auto;
  }
  
  .accordion-basic-83f4 {
    display: none !important;
  }
  
  .texture_c58b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .texture_c58b svg {
    width: 14px;
    height: 14px;
  }
  
  .status_outer_da8e {
    padding: 6px;
  }
  
  .badge_first_9c46 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .center-f1e5,
  .widget_selected_ab6b,
  .form-f280,
  .search-40c6,
  .gas-2585,
  .media-gas-e99b,
  .summary_b624,
  .south_5b18,
  .hidden-medium-d784,
  .hero_4d62,
  .liquid_3263,
  .hover-185c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .container-glass-9a34,
  .short-6359 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .notification-basic-fee9,
  .black-581b,
  .pattern_advanced_8989,
  .orange_8412,
  .large_2970,
  .prev_d24a,
  .item_26c7 {
    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 */
  .preview_2b2c,
  .sidebar-77f6,
  .thumbnail-motion-2225,
  .solid_b1e5,
  .primary-fluid-0cf5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .backdrop-small-96b1,
  .brown-28e2,
  .section_short_c542,
  .warm_59f1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .dark-3fb4,
  .menu_last_fcd0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .lite-cda3,
  .purple_da03,
  .frame_small_3c06,
  .overlay_cdac {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gradient-active-279a,
  .top-22ca,
  .panel-out-6555,
  .tag-728f,
  .mask-basic-0f55,
  .slider-orange-d6c9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .preview_2b2c,
  .sidebar-77f6,
  .solid_b1e5 {
    max-width: none !important;
  }
  
  .section_a9ce {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .backdrop-small-96b1 {
    font-size: 1.5rem !important;
  }
  
  .brown-28e2 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .caption-b467,
  .gradient-a179 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .section_short_c542 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .nav_6324 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .sort_easy_c940 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .preview_2b2c,
  .solid_b1e5 {
    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 */
.heading-under-5a82 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 4331 */
.promo-block-c8 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.1;
}
