/* ============================================
   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 (.complex_b540) is a descendant of
   .secondary_1b41 (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.column-up-b9d3 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".frame_b0e1" 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.dropdown-copper-ed77 so it can't cause
   horizontal overflow anyway. */
.hero_6ce3,
.selected_0a3a,
.gold_63ee,
.west-c7ec,
.modal-dark-45f7,
.fast_a81a,
.plasma_d96c,
.gradient_over_b326,
.dim_2b5a,
.modal-9181,
.block-66a7 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hero_action_d4a3 {
    padding: 8px 0;
  }
  
  .block_glass_88e8 img {
    height: 28px;
    width: auto;
  }
  
  .form-88c6 {
    display: none !important;
  }
  
  .item-9553 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .item-9553 svg {
    width: 14px;
    height: 14px;
  }
  
  .small-63d6 {
    padding: 6px;
  }
  
  .column_049c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .gold_63ee,
  .selected_0a3a,
  .west-c7ec,
  .modal-dark-45f7,
  .full_d2d4,
  .pattern-hot-4557,
  .header-paper-8273,
  .preview-basic-60f2,
  .complex_fe5e,
  .hovered-06dd,
  .breadcrumb_a6a6,
  .old-40c5 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .fixed_43c4,
  .silver-c0f1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hidden_fixed_7f3b,
  .thumbnail_current_dea1,
  .middle_245b,
  .texture_b175,
  .panel-silver-5f8e,
  .texture_9991,
  .action-b076 {
    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-34bc,
  .menu_884e,
  .aside_8b9d,
  .hard_7500,
  .active_6d1d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .soft-8bfc,
  .easy-be41,
  .overlay_ac0e,
  .card-brown-4732 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .paper_ba4f,
  .banner-fast-6f2d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .backdrop_f4fd,
  .chip-6897,
  .overlay_9e78,
  .row_upper_6472 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .nav_ece4,
  .aside_center_3796,
  .grid-huge-39f4,
  .title-0fa1,
  .iron-4695,
  .popup_fluid_fcd2 {
    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-34bc,
  .menu_884e,
  .hard_7500 {
    max-width: none !important;
  }
  
  .frame_b0e1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .soft-8bfc {
    font-size: 1.5rem !important;
  }
  
  .easy-be41 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .widget-green-1bbe,
  .image_gold_93d7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .overlay_ac0e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .menu_center_7f94 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .feature-short-91fa {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .menu-34bc,
  .hard_7500 {
    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: d9f6 */
.shadow-element-q4 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.0;
}
