/* ============================================
   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 (.out-2ef0) is a descendant of
   .secondary-stone-0173 (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.primary-e95c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".content-blue-2b44" 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.surface_1407 so it can't cause
   horizontal overflow anyway. */
.content-d43a,
.caption-hovered-bf04,
.main-80f3,
.button-dynamic-b9f7,
.small_9830,
.icon_current_bcee,
.input-left-a2f1,
.focus_2a77,
.border-complex-9d4f,
.in-58f2,
.copper_09a6 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .complex-2504 {
    padding: 8px 0;
  }
  
  .easy_ed43 img {
    height: 28px;
    width: auto;
  }
  
  .background-basic-a69e {
    display: none !important;
  }
  
  .image_lower_c16b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .image_lower_c16b svg {
    width: 14px;
    height: 14px;
  }
  
  .button-east-6c89 {
    padding: 6px;
  }
  
  .yellow_316c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .main-80f3,
  .caption-hovered-bf04,
  .button-dynamic-b9f7,
  .small_9830,
  .bronze_ee08,
  .tall_4b94,
  .list-hot-8629,
  .panel-east-63a7,
  .box_static_f7f8,
  .background_brown_6de7,
  .in_bc4d,
  .mask_copper_240f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .element_f446,
  .breadcrumb_mini_464a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .footer-left-4882,
  .primary-fixed-6abf,
  .thumbnail-a6b0,
  .alert_gas_fa57,
  .breadcrumb_0612,
  .rough-d530,
  .aside_e6e7 {
    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 */
  .shadow_9955,
  .wrapper_08a1,
  .title_active_7b64,
  .grid-focused-acf4,
  .secondary_a745 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .active-b7dc,
  .right-bd0c,
  .message-lite-3aaf,
  .down_42de {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .popup-2d84,
  .text_fbdb {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .picture-new-b1f6,
  .header-purple-07ab,
  .box-gas-4a37,
  .module-wood-f905 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .active-7671,
  .accent-liquid-b73f,
  .module_first_6b8f,
  .gallery_51e3,
  .label-00f8,
  .texture-narrow-6965 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .shadow_9955,
  .wrapper_08a1,
  .grid-focused-acf4 {
    max-width: none !important;
  }
  
  .content-blue-2b44 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .active-b7dc {
    font-size: 1.5rem !important;
  }
  
  .right-bd0c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .nav-fresh-eb6c,
  .search_13c8 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .message-lite-3aaf {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .top-bbd2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .gradient_1c9c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .shadow_9955,
  .grid-focused-acf4 {
    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: cdab */
.promo-block-d7 {
  padding: 0.3rem;
  font-size: 13px;
  line-height: 1.2;
}
