/* ============================================
   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 (.module_d5f3) is a descendant of
   .focus_8181 (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.badge-wide-64d2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".chip-0e77" 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.picture-liquid-8ccf so it can't cause
   horizontal overflow anyway. */
.tiny-e26c,
.progress-out-8b5e,
.modal_f86e,
.search-large-ead9,
.tall_f643,
.notice_4d57,
.hidden-pro-4bf1,
.upper-cf00,
.element_a1de,
.overlay_stale_e5f7,
.status-smooth-3f31 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hidden-fast-2a94 {
    padding: 8px 0;
  }
  
  .last-cb52 img {
    height: 28px;
    width: auto;
  }
  
  .element_23d0 {
    display: none !important;
  }
  
  .hero_new_d5ec {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hero_new_d5ec svg {
    width: 14px;
    height: 14px;
  }
  
  .hard_2e00 {
    padding: 6px;
  }
  
  .frame_pink_9487 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .modal_f86e,
  .progress-out-8b5e,
  .search-large-ead9,
  .tall_f643,
  .breadcrumb_blue_3624,
  .shadow_right_5ebf,
  .popup-ff80,
  .highlight_yellow_5f0b,
  .label-fb1f,
  .header-b441,
  .table-silver-1242,
  .article_wood_a7ba {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .label_48be,
  .gas_254a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hero_0e46,
  .feature_f91b,
  .main_5d60,
  .article-brown-67b1,
  .slider-dynamic-4068,
  .column_hot_ad4d,
  .thumbnail_655e {
    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 */
  .element-paper-c869,
  .warm_f077,
  .picture_ff45,
  .short-fc79,
  .pattern-tiny-df6a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .description_60b6,
  .nav-79dd,
  .upper-5e77,
  .pagination-272f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hover-42d9,
  .down-379f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .info-south-8ce1,
  .chip_up_a724,
  .filter-8f96,
  .down_b4ca {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .footer_ea1a,
  .slider_orange_05ac,
  .hidden-acb2,
  .hovered-0ccf,
  .sort_active_f096,
  .outer-de92 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .element-paper-c869,
  .warm_f077,
  .short-fc79 {
    max-width: none !important;
  }
  
  .chip-0e77 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .description_60b6 {
    font-size: 1.5rem !important;
  }
  
  .nav-79dd {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .dropdown-dc3e,
  .slider_4eee {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .upper-5e77 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .active_e535 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .secondary_stone_cc31 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .element-paper-c869,
  .short-fc79 {
    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: c247 */
.widget-item-q3 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.2;
}
