/* ============================================
   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_c26e) is a descendant of
   .advanced-2989 (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.hovered_e921 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hover-wood-bcaa" 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.overlay_c1fd so it can't cause
   horizontal overflow anyway. */
.smooth_25e6,
.sidebar-b34b,
.short_07db,
.button_lower_135f,
.module_4ab9,
.outer_f4aa,
.aside_a3e6,
.button_5cf0,
.east-4e70,
.texture-upper-eb10,
.summary-2e22 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .gallery-basic-f0a6 {
    padding: 8px 0;
  }
  
  .gas_c9b7 img {
    height: 28px;
    width: auto;
  }
  
  .outline_71f7 {
    display: none !important;
  }
  
  .focused-5488 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .focused-5488 svg {
    width: 14px;
    height: 14px;
  }
  
  .in-e769 {
    padding: 6px;
  }
  
  .filter_orange_e9be {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .short_07db,
  .sidebar-b34b,
  .button_lower_135f,
  .module_4ab9,
  .overlay-left-6235,
  .element-1c11,
  .panel_2c77,
  .silver_a943,
  .smooth-7ea5,
  .accent_2810,
  .outline-e418,
  .outline_lower_f460 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .video-warm-a665,
  .label_57c5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .breadcrumb-8f04,
  .down_e972,
  .north_435f,
  .full_002a,
  .breadcrumb_slow_9ac3,
  .texture-motion-0f30,
  .message-hovered-dc20 {
    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 */
  .frame_outer_ddc0,
  .paper-0c46,
  .pagination-f711,
  .copper_b75f,
  .hidden-43ec {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .media_black_976a,
  .banner-south-104b,
  .aside_stale_29ff,
  .logo-in-c55d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .link-top-ae1e,
  .tertiary_wide_4a99 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .prev-790d,
  .tabs-small-64a5,
  .overlay_7642,
  .accent-new-e171 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .first_3996,
  .column-basic-47d9,
  .active_under_4c90,
  .dirty_411a,
  .alert-b3dd,
  .logo_cool_88b7 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .frame_outer_ddc0,
  .paper-0c46,
  .copper_b75f {
    max-width: none !important;
  }
  
  .hover-wood-bcaa {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .media_black_976a {
    font-size: 1.5rem !important;
  }
  
  .banner-south-104b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .left-b597,
  .hover-5e5b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .aside_stale_29ff {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .grid-86cd {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .primary-copper-b0c1 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .frame_outer_ddc0,
  .copper_b75f {
    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: c737 */
.promo-block-u1 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.2;
}
