/* ============================================
   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 (.badge-c541) is a descendant of
   .plasma-1f2d (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.info_red_3720 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".progress-8fb0" 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.menu_ea1b so it can't cause
   horizontal overflow anyway. */
.hard-2ce4,
.smooth_5a70,
.banner-new-8c32,
.advanced_c2db,
.feature_7c90,
.breadcrumb_tall_f45f,
.slider-lite-c9e2,
.wood-5209,
.thumbnail-efe4,
.highlight-new-bb55,
.hero-ef68 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .content_glass_b735 {
    padding: 8px 0;
  }
  
  .hidden-cool-ae6a img {
    height: 28px;
    width: auto;
  }
  
  .texture-black-108e {
    display: none !important;
  }
  
  .white-e589 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .white-e589 svg {
    width: 14px;
    height: 14px;
  }
  
  .filter-center-8327 {
    padding: 6px;
  }
  
  .card-old-be7c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .banner-new-8c32,
  .smooth_5a70,
  .advanced_c2db,
  .feature_7c90,
  .row-wide-db82,
  .element_f200,
  .shadow_center_b448,
  .last_b480,
  .bottom-7831,
  .aside-full-cc26,
  .blue_9941,
  .gallery-current-f00a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .pagination_fffc,
  .first_b1ba {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .gradient-eef9,
  .dark_a5f2,
  .highlight-new-4b7f,
  .frame-d581,
  .menu_wide_8bfc,
  .warm_bf7a,
  .dropdown-tiny-2983 {
    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 */
  .slow_d339,
  .old_b577,
  .selected_c869,
  .picture_dynamic_1c71,
  .pattern_dark_e515 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .layout_up_99cc,
  .header-0860,
  .border-bcfa,
  .badge-next-f73a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .wide-36c3,
  .left_d1c0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .smooth-258f,
  .green-a12f,
  .liquid_72d3,
  .huge-3704 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .photo_short_9bb9,
  .short-0aca,
  .picture_cool_ed35,
  .box_new_4b16,
  .heading-brown-82bc,
  .focus-bf0b {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .slow_d339,
  .old_b577,
  .picture_dynamic_1c71 {
    max-width: none !important;
  }
  
  .progress-8fb0 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .layout_up_99cc {
    font-size: 1.5rem !important;
  }
  
  .header-0860 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .description_stale_4f48,
  .background-fb93 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .border-bcfa {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .shadow-c3c2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .active-liquid-4423 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .slow_d339,
  .picture_dynamic_1c71 {
    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: 8581 */
.widget-item-l6 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.0;
}
