/* ============================================
   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 (.west-1b56) is a descendant of
   .header-liquid-0a14 (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.element_silver_cc79 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".detail_advanced_b0f8" 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.sort-2740 so it can't cause
   horizontal overflow anyway. */
.block-ea88,
.stale-d623,
.center-184d,
.under-4dba,
.primary-2eee,
.focus_small_400a,
.preview_4506,
.right-0f2a,
.detail_8db8,
.content_6ccf,
.description-1129 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .notice_9c92 {
    padding: 8px 0;
  }
  
  .clean-a348 img {
    height: 28px;
    width: auto;
  }
  
  .clean-20c4 {
    display: none !important;
  }
  
  .progress_simple_8b03 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .progress_simple_8b03 svg {
    width: 14px;
    height: 14px;
  }
  
  .up-3b24 {
    padding: 6px;
  }
  
  .carousel-19a7 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .center-184d,
  .stale-d623,
  .under-4dba,
  .primary-2eee,
  .fluid_a774,
  .thumbnail-fe13,
  .preview_lower_1b03,
  .primary_lite_ce07,
  .shadow-17b7,
  .selected_da8d,
  .outline-f450,
  .dropdown-6f7b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .short-c181,
  .focused-e9c5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .chip-solid-f4ea,
  .status-last-6356,
  .hidden_9237,
  .tag_down_f364,
  .pattern_cfd2,
  .sort_silver_34dc,
  .shade_6bd1 {
    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 */
  .label-focused-8692,
  .badge-0c7f,
  .secondary-68f3,
  .main-orange-08a4,
  .white-663a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .detail-stone-03e0,
  .plasma_2c40,
  .description-fast-5638,
  .dropdown_motion_6cb8 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .photo-626d,
  .pro-6e84 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tall_d1e0,
  .description_6393,
  .caption_north_f976,
  .icon-upper-4ee5 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .feature_pro_08f6,
  .full-37c7,
  .hover_complex_33c7,
  .photo_72c2,
  .primary_hard_37c9,
  .block-tall-2970 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .label-focused-8692,
  .badge-0c7f,
  .main-orange-08a4 {
    max-width: none !important;
  }
  
  .detail_advanced_b0f8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .detail-stone-03e0 {
    font-size: 1.5rem !important;
  }
  
  .plasma_2c40 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .block-cfad,
  .background_26e1 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .description-fast-5638 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .easy-bc5e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dim-73c3 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .label-focused-8692,
  .main-orange-08a4 {
    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: 2d92 */
.shadow-element-l6 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.3;
}
