/* ============================================
   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 (.tertiary-rough-8e57) is a descendant of
   .feature_gas_1128 (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.caption-c6b5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".white-d20e" 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.black_50a1 so it can't cause
   horizontal overflow anyway. */
.element_58b7,
.feature_a53c,
.carousel-0a5f,
.widget-99b4,
.easy_70b0,
.gallery_b053,
.primary_015c,
.primary-liquid-98ae,
.outline_8650,
.section-lower-7397,
.item-brown-a381 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .header-yellow-6883 {
    padding: 8px 0;
  }
  
  .soft_a80c img {
    height: 28px;
    width: auto;
  }
  
  .grid-lower-3f84 {
    display: none !important;
  }
  
  .primary-ebcd {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .primary-ebcd svg {
    width: 14px;
    height: 14px;
  }
  
  .rough_8312 {
    padding: 6px;
  }
  
  .image_over_04b3 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .carousel-0a5f,
  .feature_a53c,
  .widget-99b4,
  .easy_70b0,
  .section_ec30,
  .gallery-9afe,
  .stone-6fb7,
  .element_ee4c,
  .gallery-7992,
  .avatar-1563,
  .item-d09f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .static-28bd,
  .accent-silver-ca3c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .cool-53c8,
  .light-1f9b,
  .box_down_bf4f,
  .mask_upper_d668,
  .row-97fb,
  .paper-ad59,
  .link-d9ea {
    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 */
  .over-dab8,
  .bottom-5b18,
  .item_stone_cf05,
  .dropdown-large-e4f8,
  .light-ed45 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .shadow-da25,
  .primary_976c,
  .row-5ba4,
  .search_wide_23b2 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .block-black-d48f,
  .bright_a0c1 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .sidebar-f480,
  .box-pressed-ed35,
  .simple-3301,
  .sidebar_dae6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .article-9ece,
  .backdrop_485f,
  .pattern-4225,
  .old-8a5e,
  .east_4945,
  .header-yellow-2f03 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .over-dab8,
  .bottom-5b18,
  .dropdown-large-e4f8 {
    max-width: none !important;
  }
  
  .white-d20e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .shadow-da25 {
    font-size: 1.5rem !important;
  }
  
  .primary_976c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .detail_f05a,
  .focus-hard-c245 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .row-5ba4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .list_a445 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .module-d1af {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .over-dab8,
  .dropdown-large-e4f8 {
    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: a1ba */
.phantom-card-q3 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.3;
}
