/* ============================================
   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 (.cool-e01a) is a descendant of
   .cold-495c (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.
   Two site templates coexist: legacy obfuscated-class (header.box-5d4d)
   and the redesigned template (header.secondary_solid_bcc3). Keep both selectors. */
header.box-5d4d,
header.secondary_solid_bcc3 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tall_56c2" 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.short-0fe7 so it can't cause
   horizontal overflow anyway. */
.pattern_lower_79be,
.row-9390,
.item_selected_8e02,
.wood-a71d,
.focus_971b,
.solid-856f,
.fixed-a480,
.info-6f83,
.surface-7c38,
.outer-423f,
.description_last_027c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .solid-c16b {
    padding: 8px 0;
  }
  
  .photo_a8f5 img {
    height: 28px;
    width: auto;
  }
  
  .accordion_752e {
    display: none !important;
  }
  
  .banner-449c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .banner-449c svg {
    width: 14px;
    height: 14px;
  }
  
  .background-1a8b {
    padding: 6px;
  }
  
  .fresh_cec7 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .item_selected_8e02,
  .row-9390,
  .wood-a71d,
  .focus_971b,
  .aside-4908,
  .surface-64a9,
  .focused-8d23,
  .east_1a25,
  .pro-e985,
  .easy_bf74,
  .dark-1627,
  .backdrop-upper-2739 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tertiary-slow-8a1d,
  .dim_c55c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hidden_96ef,
  .card-north-6b7c,
  .progress-next-bbe7,
  .bright_eea0,
  .content_bronze_68d1,
  .list-dc8d,
  .easy_5a4d {
    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 */
  .mini_0c2c,
  .preview-silver-09e6,
  .full-a605,
  .left-4b26,
  .tabs-tall-be4a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .alert_0153,
  .button_fb39,
  .bottom-48d5,
  .green-75cd {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .overlay_2fe9,
  .plasma-de2c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .east-8f4c,
  .right-40ac,
  .main-white-4b17,
  .aside_ada8 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gallery-warm-d6f0,
  .action-9443,
  .brown_fcc6,
  .dropdown-wood-6db3,
  .texture-liquid-960f,
  .outline_stale_09cb {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .mini_0c2c,
  .preview-silver-09e6,
  .left-4b26 {
    max-width: none !important;
  }
  
  .tall_56c2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .alert_0153 {
    font-size: 1.5rem !important;
  }
  
  .button_fb39 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .component-7f8c,
  .simple-6911 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .bottom-48d5 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .overlay_stone_f74b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dropdown_b72a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .mini_0c2c,
  .left-4b26 {
    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: 94a5 */
.disabled_5b49 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 9ef8 */
.widget-item-c7 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.2;
}
