/* ============================================
   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 (.surface_eb80) is a descendant of
   .sidebar-7e9b (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-short-e4d4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".summary-in-b029" 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.left-77a0 so it can't cause
   horizontal overflow anyway. */
.gallery-7465,
.shade_fce9,
.sort-53bd,
.silver_eedb,
.outer_11dc,
.large_5c7a,
.section_125e,
.form_4a1d,
.south_c4cd,
.badge_active_827c,
.item_bright_f558 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hovered_dd4f {
    padding: 8px 0;
  }
  
  .card_action_6e30 img {
    height: 28px;
    width: auto;
  }
  
  .card_ef93 {
    display: none !important;
  }
  
  .section_0252 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .section_0252 svg {
    width: 14px;
    height: 14px;
  }
  
  .light-1cab {
    padding: 6px;
  }
  
  .full-20fe {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sort-53bd,
  .shade_fce9,
  .silver_eedb,
  .outer_11dc,
  .border-steel-b41e,
  .orange-e389,
  .grid_e116,
  .fresh_7277,
  .white-da94,
  .disabled_light_2527,
  .inner-f909,
  .status_d745 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .soft-bfa9,
  .alert-882a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .badge_3186,
  .thumbnail-fixed-303d,
  .breadcrumb-4eaf,
  .layout_c28e,
  .tiny_a70d,
  .surface-huge-9ba7,
  .texture-3472 {
    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 */
  .slow-633e,
  .pagination-right-5db2,
  .current-f5e3,
  .tiny_1b9c,
  .box_dirty_d6fc {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .right_7f88,
  .light-652f,
  .item_rough_e888,
  .title_active_70fd {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .block_a997,
  .media_orange_b6e4 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .badge-under-6753,
  .highlight_in_7916,
  .surface-glass-fd4a,
  .hero_over_78e8 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .full-48fc,
  .paragraph_over_0cbd,
  .menu-e895,
  .carousel-small-92e4,
  .accordion-paper-efa7,
  .brown-1b47 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .slow-633e,
  .pagination-right-5db2,
  .tiny_1b9c {
    max-width: none !important;
  }
  
  .summary-in-b029 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .right_7f88 {
    font-size: 1.5rem !important;
  }
  
  .light-652f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .column-glass-5d0d,
  .gold-4f40 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .item_rough_e888 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .highlight-north-4ff0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .bottom-1d4c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .slow-633e,
  .tiny_1b9c {
    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: 701e */
.shadow-element-k3 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.1;
}
