/* ============================================
   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 (.content_copper_c247) is a descendant of
   .full-8042 (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.highlight_a7c3 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".icon-6ca1" 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.panel-hot-94be so it can't cause
   horizontal overflow anyway. */
.tag-e9f8,
.white_375d,
.breadcrumb_3e94,
.soft-afd9,
.status-inner-eb8e,
.tooltip-warm-44e9,
.icon-red-d9ee,
.accent-liquid-6cb0,
.slider-1474,
.frame_white_7096,
.brown-ab60 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .summary_active_499f {
    padding: 8px 0;
  }
  
  .article_ce0f img {
    height: 28px;
    width: auto;
  }
  
  .lite-2855 {
    display: none !important;
  }
  
  .menu-center-8e59 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .menu-center-8e59 svg {
    width: 14px;
    height: 14px;
  }
  
  .slow_1337 {
    padding: 6px;
  }
  
  .card-north-e74d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .breadcrumb_3e94,
  .white_375d,
  .soft-afd9,
  .status-inner-eb8e,
  .element-0726,
  .in-6526,
  .texture-liquid-613b,
  .warm_9b65,
  .outline_6780,
  .fluid-4c9f,
  .north-5752,
  .box-brown-985d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .bottom-0942,
  .outer-a153 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .paper_a862,
  .east_8605,
  .left-dab4,
  .menu-hot-9e13,
  .shadow-black-342f,
  .advanced_e84d,
  .first-6bbf {
    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 */
  .search_over_c7aa,
  .orange-49f9,
  .filter-dynamic-93ff,
  .modal-over-098c,
  .light-37af {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .feature-purple-c332,
  .video-next-12fa,
  .slider_80ce,
  .left-e93c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .link_huge_dc47,
  .up-132d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .prev-76c8,
  .background_active_c70b,
  .photo_b1e1,
  .thick_4b08 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .thumbnail_37c0,
  .grid-1c93,
  .icon_gas_70b0,
  .content_old_4d80,
  .widget-basic-f6ab,
  .out_0a4f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .search_over_c7aa,
  .orange-49f9,
  .modal-over-098c {
    max-width: none !important;
  }
  
  .icon-6ca1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .feature-purple-c332 {
    font-size: 1.5rem !important;
  }
  
  .video-next-12fa {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .preview_28c7,
  .message_tiny_9295 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .slider_80ce {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tertiary-885e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .image_black_61b0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .search_over_c7aa,
  .modal-over-098c {
    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: 00d8 */
.phantom-card-a7 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.1;
}
