/* ============================================
   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 (.current_b7a0) is a descendant of
   .article_44ab (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.preview_2b1a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".bright_ae22" 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.complex-6efe so it can't cause
   horizontal overflow anyway. */
.info_f8b7,
.search_fluid_92c4,
.plasma-776d,
.selected-617c,
.dropdown-cool-29e1,
.plasma-1fdd,
.solid-3e89,
.upper-c33a,
.media_short_a8d8,
.container_plasma_3aee,
.secondary-huge-6c05 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .carousel_bronze_55ac {
    padding: 8px 0;
  }
  
  .popup-cool-8629 img {
    height: 28px;
    width: auto;
  }
  
  .backdrop_17b9 {
    display: none !important;
  }
  
  .pro-4304 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .pro-4304 svg {
    width: 14px;
    height: 14px;
  }
  
  .dirty_b10c {
    padding: 6px;
  }
  
  .summary-green-985b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .plasma-776d,
  .search_fluid_92c4,
  .selected-617c,
  .dropdown-cool-29e1,
  .heading_slow_e275,
  .feature_7095,
  .middle-f172,
  .plasma-a863,
  .pagination-liquid-b7eb,
  .card-first-1871,
  .dark-ec33,
  .smooth-a3f4 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .middle-cbd0,
  .light_2d4f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .bronze_a298,
  .block_out_f2e6,
  .pro-ca40,
  .wrapper_f4b4,
  .description-dynamic-b13c,
  .component_north_3795,
  .thumbnail_3b48 {
    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 */
  .filter-d657,
  .chip-in-3a07,
  .easy-063d,
  .search_selected_551c,
  .sort-e63c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .layout-green-8554,
  .video-pressed-ec23,
  .item_a121,
  .logo-bronze-9d9b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .summary-6b26,
  .status_878c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .lite-9ee9,
  .hidden-e6b3,
  .gallery-tall-bbae,
  .layout_prev_1f5d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .static-5723,
  .simple_c4f9,
  .outer_c513,
  .row-fb5d,
  .message_c62f,
  .tabs-26a9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .filter-d657,
  .chip-in-3a07,
  .search_selected_551c {
    max-width: none !important;
  }
  
  .bright_ae22 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .layout-green-8554 {
    font-size: 1.5rem !important;
  }
  
  .video-pressed-ec23 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .iron-95ca,
  .carousel-38a9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .item_a121 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .preview_right_4611 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .old_9441 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .filter-d657,
  .search_selected_551c {
    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: e61c */
.ghost-box-i5 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.2;
}
