/* ============================================
   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 (.pattern_action_a06d) is a descendant of
   .dynamic_f1cd (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.
   Two site templates coexist: legacy obfuscated-class (header.component-huge-e8d1)
   and the redesigned template (header.south-83bb). Keep both selectors. */
header.component-huge-e8d1,
header.south-83bb {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".status_lower_f5b7" 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.fluid_cfe4 so it can't cause
   horizontal overflow anyway. */
.label-east-95fd,
.hovered_5ef1,
.gallery_pressed_8e3e,
.section-top-1ac5,
.header_1221,
.list_red_27e9,
.element-liquid-3b66,
.basic_2878,
.backdrop_thick_7da5,
.link_6557,
.accordion-clean-5fcd {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .caption-huge-14ea {
    padding: 8px 0;
  }
  
  .feature_bd4c img {
    height: 28px;
    width: auto;
  }
  
  .slow-288f {
    display: none !important;
  }
  
  .video_top_5d09 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .video_top_5d09 svg {
    width: 14px;
    height: 14px;
  }
  
  .caption_948b {
    padding: 6px;
  }
  
  .dirty_da1b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .gallery_pressed_8e3e,
  .hovered_5ef1,
  .section-top-1ac5,
  .header_1221,
  .pressed_c500,
  .feature_stone_0787,
  .old_a4b3,
  .fixed-4cfc,
  .overlay_91c0,
  .hover-cb5e,
  .overlay-next-5113,
  .frame-plasma-0c32 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .clean_1f3c,
  .bright-026e {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .last_ed7c,
  .steel_ef40,
  .hard-4057,
  .lite_33ce,
  .dynamic-b20e,
  .description-simple-c128,
  .alert-938e {
    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 */
  .wrapper_stone_f7b3,
  .detail_47eb,
  .texture-848f,
  .preview-mini-07bd,
  .card-plasma-edc1 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .carousel-medium-bba3,
  .stone_c1ab,
  .fixed-227d,
  .focus_51af {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .section_active_9815,
  .container_d498 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hero-f458,
  .carousel_59dd,
  .hover-copper-613f,
  .input-inner-cd60 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .sort_thick_62a1,
  .stale_cd18,
  .hover-mini-7f88,
  .label-bronze-d87e,
  .basic_eb53,
  .slider-0dbb {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .wrapper_stone_f7b3,
  .detail_47eb,
  .preview-mini-07bd {
    max-width: none !important;
  }
  
  .status_lower_f5b7 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .carousel-medium-bba3 {
    font-size: 1.5rem !important;
  }
  
  .stone_c1ab {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .chip_dynamic_5bad,
  .new-4ce9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .fixed-227d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .thick-ac20 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .primary_dfaa {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .wrapper_stone_f7b3,
  .preview-mini-07bd {
    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: 94a5 */
.rough-7505 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: da6e */
.shadow-element-w1 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.3;
}
