/* ============================================
   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 (.liquid_007d) is a descendant of
   .grid_motion_ac44 (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.shade-green-5a80 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tiny_448e" 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.gallery-hovered-f167 so it can't cause
   horizontal overflow anyway. */
.north-5303,
.fast_d3d6,
.slider_f91a,
.silver-6df0,
.modal-bottom-3cac,
.hot-38ef,
.grid-motion-b719,
.yellow-524f,
.tall-5edd,
.breadcrumb_up_9c3f,
.pressed-52b1 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .top-fc79 {
    padding: 8px 0;
  }
  
  .column_c1d3 img {
    height: 28px;
    width: auto;
  }
  
  .next-f030 {
    display: none !important;
  }
  
  .hard-e730 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hard-e730 svg {
    width: 14px;
    height: 14px;
  }
  
  .title-c17f {
    padding: 6px;
  }
  
  .copper_feaa {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .slider_f91a,
  .fast_d3d6,
  .silver-6df0,
  .modal-bottom-3cac,
  .thumbnail_pink_f9b2,
  .middle_105a,
  .tertiary_clean_4cab,
  .orange-562b,
  .current-3e7f,
  .image_5764,
  .static-cb7d,
  .background_silver_e5f2 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .menu-narrow-7cbd,
  .block-stone-384c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .outer_bcbb,
  .tertiary_orange_4eef,
  .backdrop-brown-95b5,
  .dropdown_924b,
  .soft-aeec,
  .article_active_80ed,
  .highlight-82a4 {
    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 */
  .menu-f89d,
  .alert_thick_f1f2,
  .slider_584d,
  .modal-mini-aba2,
  .row_3ce4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .south-55fb,
  .modal-c24f,
  .active-paper-a384,
  .dark-b422 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .notification-2da1,
  .button_5039 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .fresh-8c5f,
  .title-9a1a,
  .red_f439,
  .border-1414 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hero-top-5593,
  .thumbnail_motion_7056,
  .notification_orange_cce6,
  .filter-fbfd,
  .caption_next_5fd2,
  .grid-1432 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .menu-f89d,
  .alert_thick_f1f2,
  .modal-mini-aba2 {
    max-width: none !important;
  }
  
  .tiny_448e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .south-55fb {
    font-size: 1.5rem !important;
  }
  
  .modal-c24f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .main-e39b,
  .media_thick_a2c1 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .active-paper-a384 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .form_slow_100d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .shadow_clean_45ad {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .menu-f89d,
  .modal-mini-aba2 {
    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: dd58 */
.ghost-box-j2 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.2;
}
