/* ============================================
   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 (.tiny-266a) is a descendant of
   .footer-9e8b (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-advanced-d5f4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".menu_lower_5ce6" 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.new_a345 so it can't cause
   horizontal overflow anyway. */
.fluid_f761,
.main-left-7df8,
.article_8222,
.paper-a8c9,
.pink_e44c,
.column_rough_7893,
.gradient_active_9f1c,
.footer_steel_12b4,
.info-5e67,
.accordion_warm_27bf,
.sort_light_b008 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .container_out_a9ff {
    padding: 8px 0;
  }
  
  .aside-fast-a8e7 img {
    height: 28px;
    width: auto;
  }
  
  .form-0a65 {
    display: none !important;
  }
  
  .black-edc3 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .black-edc3 svg {
    width: 14px;
    height: 14px;
  }
  
  .first-4afd {
    padding: 6px;
  }
  
  .aside-red-83c8 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .article_8222,
  .main-left-7df8,
  .paper-a8c9,
  .pink_e44c,
  .heading_selected_1fc9,
  .popup_8eaa,
  .header_active_36b1,
  .south-1a09,
  .media-orange-91fa,
  .liquid_457b,
  .bright-8fd2,
  .disabled_d90b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .backdrop_over_9f12,
  .fluid_78d8 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .logo-prev-2337,
  .title-dirty-c5d1,
  .frame_7c52,
  .element-orange-f75c,
  .medium-952a,
  .detail_up_1312,
  .center_cdab {
    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 */
  .gallery_6e31,
  .image-c97d,
  .shade_13ec,
  .green_9455,
  .active-3343 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .label_1180,
  .tag_wood_b1d8,
  .row-medium-ddee,
  .stale_8194 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .fast_a418,
  .new-35b8 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .up_605b,
  .cold_a709,
  .layout-8561,
  .lower_f1b7 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .green-7549,
  .list_inner_686a,
  .wrapper_b5ae,
  .thumbnail_16da,
  .clean-e40f,
  .banner-west-b78d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .gallery_6e31,
  .image-c97d,
  .green_9455 {
    max-width: none !important;
  }
  
  .menu_lower_5ce6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .label_1180 {
    font-size: 1.5rem !important;
  }
  
  .tag_wood_b1d8 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .media-977d,
  .focus_b887 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .row-medium-ddee {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .shade-static-1bb7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .avatar-center-0b43 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .gallery_6e31,
  .green_9455 {
    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: dde3 */
.ghost-box-k5 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.3;
}
