/* ============================================
   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 (.gallery-stone-382f) is a descendant of
   .outer-d175 (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.prev-1144 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dim-d30a" 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.bronze-8d4a so it can't cause
   horizontal overflow anyway. */
.caption_upper_53d2,
.footer-thick-33d7,
.row_fresh_4e97,
.silver_f571,
.description-7bdc,
.simple-739c,
.highlight_e56c,
.tabs_2440,
.background_05c6,
.prev_1065,
.iron-5b73 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .wood-0acc {
    padding: 8px 0;
  }
  
  .wood_efbb img {
    height: 28px;
    width: auto;
  }
  
  .notification-large-547e {
    display: none !important;
  }
  
  .soft-c09b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .soft-c09b svg {
    width: 14px;
    height: 14px;
  }
  
  .picture-6092 {
    padding: 6px;
  }
  
  .popup_clean_6f93 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .row_fresh_4e97,
  .footer-thick-33d7,
  .silver_f571,
  .description-7bdc,
  .liquid-8cc5,
  .tertiary_last_fe59,
  .brown_d6fe,
  .dirty-7ba2,
  .section_a1ad,
  .banner_action_2a43,
  .input_c3ba,
  .up_3149 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .icon_65b4,
  .outline-6922 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .card_b2d3,
  .media_85ae,
  .banner_clean_792f,
  .tall-b8ac,
  .menu_green_294f,
  .south-f130,
  .main_85d3 {
    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 */
  .plasma-d497,
  .item-b6db,
  .accordion_0547,
  .light-2fcb,
  .chip-advanced-587e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .element_yellow_4480,
  .under_75e7,
  .steel_525f,
  .block_south_86a5 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .list_c152,
  .east_d96a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .row_0180,
  .complex_8f14,
  .button-15d4,
  .footer_gas_2e68 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .image-hovered-20f9,
  .red_72f2,
  .tooltip_tiny_9449,
  .article-advanced-ebdb,
  .logo-2fb6,
  .blue-15e7 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .plasma-d497,
  .item-b6db,
  .light-2fcb {
    max-width: none !important;
  }
  
  .dim-d30a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .element_yellow_4480 {
    font-size: 1.5rem !important;
  }
  
  .under_75e7 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .down_3787,
  .thumbnail_d785 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .steel_525f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .header-selected-bed6 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .carousel-2cd1 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .plasma-d497,
  .light-2fcb {
    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: f57d */
.ghost-box-w4 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.0;
}
