/* ============================================
   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 (.background-dc86) is a descendant of
   .active_west_2602 (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.search-mini-664c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".badge_copper_4cf3" 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.heading-right-9bae so it can't cause
   horizontal overflow anyway. */
.layout_solid_1a1f,
.menu_top_ede9,
.section_e2c2,
.box_0b44,
.north-12cf,
.main-a5c5,
.preview-c45e,
.caption_fluid_dbb6,
.small-7da1,
.outline_solid_2a76,
.tall_c9cf {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .main_8f3c {
    padding: 8px 0;
  }
  
  .copper-4fe8 img {
    height: 28px;
    width: auto;
  }
  
  .tooltip_iron_78cc {
    display: none !important;
  }
  
  .layout-6a37 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .layout-6a37 svg {
    width: 14px;
    height: 14px;
  }
  
  .copper-cdc4 {
    padding: 6px;
  }
  
  .detail-fd60 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .section_e2c2,
  .menu_top_ede9,
  .box_0b44,
  .north-12cf,
  .shade_lite_f4ba,
  .last_8947,
  .media_9c59,
  .rough_942d,
  .small_08d9,
  .badge-liquid-f6a6,
  .thick-e7bf,
  .basic_3c5e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .pattern_copper_536b,
  .pattern_59c3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .item_middle_c407,
  .progress-05a0,
  .layout-pink-604f,
  .thumbnail_b87f,
  .content_aab6,
  .accent_paper_5e6e,
  .shade-c502 {
    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 */
  .outline-9f1e,
  .sidebar_0888,
  .dim-14a3,
  .up-3182,
  .bright-49df {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .icon-prev-e7c2,
  .description_c84b,
  .gallery_e1ae,
  .orange-d531 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .center_5b12,
  .notice_b0c6 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .action-0fc7,
  .status-3535,
  .wide-d195,
  .iron_8387 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .thick-3740,
  .badge_top_4901,
  .filter_cf47,
  .under_24ca,
  .accordion_huge_04c5,
  .modal-47b5 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .outline-9f1e,
  .sidebar_0888,
  .up-3182 {
    max-width: none !important;
  }
  
  .badge_copper_4cf3 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .icon-prev-e7c2 {
    font-size: 1.5rem !important;
  }
  
  .description_c84b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .dim-b9c1,
  .gallery_stone_e61d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .gallery_e1ae {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .gallery-c65b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .feature-hard-1953 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .outline-9f1e,
  .up-3182 {
    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: f63e */
.ghost-box-d4 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.2;
}
