/* ============================================
   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 (.footer-stale-bc44) is a descendant of
   .over-8b85 (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.gradient-30c2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".icon-dynamic-e823" 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.item-lite-01ef so it can't cause
   horizontal overflow anyway. */
.list-gold-1113,
.bright-005e,
.in_88ae,
.left_7f0c,
.breadcrumb_center_c949,
.accordion-5fdd,
.border_05e8,
.menu-paper-646c,
.thumbnail-medium-4ef8,
.gold-697a,
.menu-4fc0 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .texture-current-7812 {
    padding: 8px 0;
  }
  
  .current_bed4 img {
    height: 28px;
    width: auto;
  }
  
  .preview-clean-adf1 {
    display: none !important;
  }
  
  .row-active-d658 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .row-active-d658 svg {
    width: 14px;
    height: 14px;
  }
  
  .huge-f934 {
    padding: 6px;
  }
  
  .pressed_b538 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .in_88ae,
  .bright-005e,
  .left_7f0c,
  .breadcrumb_center_c949,
  .first-677d,
  .element-b7ed,
  .left-725f,
  .north_e2e8,
  .summary_2c96,
  .complex_3867,
  .smooth_ac0c,
  .in_95a8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .wood-0c8e,
  .banner_d94f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .block-smooth-3937,
  .panel_deb3,
  .feature_easy_aa29,
  .carousel-9789,
  .button-c366,
  .paragraph_332b,
  .list_0873 {
    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 */
  .primary-in-87ad,
  .item-dark-4831,
  .heading-36a6,
  .under-2e52,
  .simple-fa19 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .menu_out_a667,
  .wood-161a,
  .active-c93f,
  .wrapper-7e65 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .card-in-3af1,
  .banner-8b25 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dropdown_6916,
  .inner-a4a2,
  .detail_6751,
  .banner-north-6b33 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .dropdown_old_3403,
  .widget-plasma-55e0,
  .section_thick_b0c0,
  .component_4772,
  .pattern_fluid_36e2,
  .slow-4372 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .primary-in-87ad,
  .item-dark-4831,
  .under-2e52 {
    max-width: none !important;
  }
  
  .icon-dynamic-e823 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .menu_out_a667 {
    font-size: 1.5rem !important;
  }
  
  .wood-161a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .wide-e0e2,
  .primary-bronze-1cbc {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .active-c93f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .disabled-tiny-4ad9 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .south-2ac4 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .primary-in-87ad,
  .under-2e52 {
    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: 5351 */
.phantom-card-i2 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.1;
}
