/* ============================================
   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 (.form-faa8) is a descendant of
   .pink_9f0f (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.tag-5602 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".brown-b7f3" 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.notification-f8af so it can't cause
   horizontal overflow anyway. */
.large_ad23,
.banner_clean_27e9,
.outline-ef31,
.search-c7bb,
.pink-5768,
.tooltip-bottom-09d7,
.section-cdd8,
.south_5fef,
.hover-f016,
.solid-f86f,
.west-5af1 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .short_9711 {
    padding: 8px 0;
  }
  
  .sidebar_hot_647f img {
    height: 28px;
    width: auto;
  }
  
  .large_ca54 {
    display: none !important;
  }
  
  .carousel_57e5 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .carousel_57e5 svg {
    width: 14px;
    height: 14px;
  }
  
  .list-3c59 {
    padding: 6px;
  }
  
  .button-wide-a5af {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .outline-ef31,
  .banner_clean_27e9,
  .search-c7bb,
  .pink-5768,
  .breadcrumb_e368,
  .footer_cfd3,
  .sort-6484,
  .soft_6874,
  .search_1aa4,
  .hero_7a37,
  .fixed_ac94,
  .feature_9eea {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .gas_eb3c,
  .gradient_4834 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .sidebar_green_162f,
  .accordion_bronze_be62,
  .gradient-6ebf,
  .picture-9da8,
  .inner_c2fe,
  .overlay_2a55,
  .bronze_3300 {
    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 */
  .center_f965,
  .layout-0ae2,
  .green_ffd2,
  .secondary-cc04,
  .link-c744 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .complex_61f1,
  .media-5a7b,
  .header-492e,
  .sort_f50c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .grid-simple-38be,
  .text_stone_2e8c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .overlay-ce1c,
  .feature-short-93d0,
  .disabled_dim_5e43,
  .accent-inner-3d86 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .brown_14b9,
  .photo-stone-4138,
  .media-yellow-5cdc,
  .disabled_gold_fcd8,
  .secondary_7153,
  .heading_hard_5b86 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .center_f965,
  .layout-0ae2,
  .secondary-cc04 {
    max-width: none !important;
  }
  
  .brown-b7f3 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .complex_61f1 {
    font-size: 1.5rem !important;
  }
  
  .media-5a7b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .search_advanced_c0fd,
  .card_gold_f0c9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .header-492e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .link_middle_427a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .primary-23ae {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .center_f965,
  .secondary-cc04 {
    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: bd0f */
.shadow-element-k9 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.0;
}
