/* ============================================
   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 (.next_679b) is a descendant of
   .accordion_6e57 (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.gallery-ff7e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tag_tiny_467d" 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.layout_cold_222a so it can't cause
   horizontal overflow anyway. */
.hard-fe5b,
.breadcrumb_steel_9184,
.mask-yellow-47c1,
.heading-gold-3642,
.gas-5359,
.large-7ed2,
.notification-2833,
.wrapper_current_cd4b,
.status_a25d,
.slider-motion-a9f9,
.footer-fluid-c83c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .lower-733c {
    padding: 8px 0;
  }
  
  .description-down-48e3 img {
    height: 28px;
    width: auto;
  }
  
  .static_97ee {
    display: none !important;
  }
  
  .east_2f36 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .east_2f36 svg {
    width: 14px;
    height: 14px;
  }
  
  .link_prev_754c {
    padding: 6px;
  }
  
  .photo-4aa3 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .mask-yellow-47c1,
  .breadcrumb_steel_9184,
  .heading-gold-3642,
  .gas-5359,
  .widget-96e7,
  .container-ceed,
  .grid-108c,
  .image-over-e961,
  .primary-3785,
  .lower-c60b,
  .banner-0a41 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .heading-96e9,
  .up-59ee {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .advanced_1840,
  .gas_5c3f,
  .outline-dirty-26c9,
  .notice-4420,
  .container-full-3002,
  .highlight-a45c,
  .tag-left-73ce {
    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 */
  .carousel-8869,
  .solid_64f9,
  .fluid_0d75,
  .search_basic_98fb,
  .main-2e24 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .button_7236,
  .small_7c9a,
  .alert_4aa8,
  .heading-lite-eb19 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .black_aa70,
  .fresh-2e4a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hovered_cef7,
  .surface_3b1e,
  .filter-0764,
  .container_69c2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .cold_31cb,
  .background_a492,
  .component-glass-5486,
  .next_6c1e,
  .hard_9d33,
  .sort-1bf9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .carousel-8869,
  .solid_64f9,
  .search_basic_98fb {
    max-width: none !important;
  }
  
  .tag_tiny_467d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .button_7236 {
    font-size: 1.5rem !important;
  }
  
  .small_7c9a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pink_f4b6,
  .copper_b7e3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .alert_4aa8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .bronze_6610 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .header_gold_f22d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .carousel-8869,
  .search_basic_98fb {
    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: be9b */
.ghost-box-c8 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.1;
}
