/* ============================================
   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 (.detail_16f7) is a descendant of
   .text_fixed_2949 (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.image-old-8843 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".badge_dynamic_8fbc" 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.filter-selected-bd51 so it can't cause
   horizontal overflow anyway. */
.notification_small_b4f0,
.lower-f0be,
.sort-white-f19f,
.list_easy_2ed9,
.popup-73c3,
.current_8ec6,
.sort_29c4,
.container-cold-d0ae,
.outline-db9f,
.wide_7221,
.logo_motion_ccf3 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .advanced_3a92 {
    padding: 8px 0;
  }
  
  .basic-4395 img {
    height: 28px;
    width: auto;
  }
  
  .footer_c86a {
    display: none !important;
  }
  
  .filter_f50a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .filter_f50a svg {
    width: 14px;
    height: 14px;
  }
  
  .prev-e8e1 {
    padding: 6px;
  }
  
  .sort-over-c1ec {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sort-white-f19f,
  .lower-f0be,
  .list_easy_2ed9,
  .popup-73c3,
  .list-orange-0aa0,
  .list-narrow-7e89,
  .white_2699,
  .warm_5318,
  .rough-f3be,
  .pressed_f134,
  .filter_5c2f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .black-7146,
  .form-662f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tooltip-dark-9d89,
  .progress_90b2,
  .slider-stone-f6a2,
  .black-17c0,
  .summary-7b9e,
  .notification_motion_c875,
  .texture-1070 {
    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 */
  .block_0dba,
  .background_bronze_f97e,
  .notification-wide-0695,
  .background-fast-b1aa,
  .item_3f21 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .prev_4a90,
  .row_upper_299e,
  .dropdown_bright_b8ed,
  .aside_stone_36a1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .black-673a,
  .content_short_bd14 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .button-thick-c79f,
  .tag-f709,
  .status-e184,
  .photo-7f4c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .cold-c0b5,
  .link_focused_828d,
  .section_inner_ae4c,
  .old-00a2,
  .title-action-3f1a,
  .slider-last-73b2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .block_0dba,
  .background_bronze_f97e,
  .background-fast-b1aa {
    max-width: none !important;
  }
  
  .badge_dynamic_8fbc {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .prev_4a90 {
    font-size: 1.5rem !important;
  }
  
  .row_upper_299e {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .modal-1c10,
  .dropdown_3436 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .dropdown_bright_b8ed {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .texture_65ba {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .paragraph-red-dac2 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .block_0dba,
  .background-fast-b1aa {
    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: fb08 */
.ghost-box-o8 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.0;
}
