/* ============================================
   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 (.active_bfb8) is a descendant of
   .carousel-0a5b (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.box_a91c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hidden_70d9" 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.heading-hard-5224 so it can't cause
   horizontal overflow anyway. */
.input_2afd,
.border_c4a3,
.alert_under_0d8f,
.box_current_875b,
.popup-24c6,
.preview-dynamic-7ed9,
.disabled_gold_9946,
.form-08af,
.easy-bb49,
.table-dc1a,
.tertiary_6781 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .background_d490 {
    padding: 8px 0;
  }
  
  .grid-37b8 img {
    height: 28px;
    width: auto;
  }
  
  .gradient-e522 {
    display: none !important;
  }
  
  .notification_8747 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .notification_8747 svg {
    width: 14px;
    height: 14px;
  }
  
  .detail-9326 {
    padding: 6px;
  }
  
  .pattern_selected_418e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .alert_under_0d8f,
  .border_c4a3,
  .box_current_875b,
  .popup-24c6,
  .photo_ee3f,
  .accordion_fast_a9a9,
  .plasma_4dbe,
  .slider_e24e,
  .hard-eefe,
  .list_smooth_5a97,
  .active-complex-5af9,
  .soft_12de {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .preview_plasma_37ab,
  .wood_584a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .item_b0cb,
  .grid-old-35b3,
  .active_pink_f243,
  .list-complex-2557,
  .article_tiny_b206,
  .nav-gold-be19,
  .disabled_hot_7653 {
    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 */
  .paragraph-focused-bf3c,
  .media_wood_9977,
  .layout_26d1,
  .carousel-2875,
  .texture_left_f988 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .progress_black_ff8d,
  .search_prev_11cb,
  .clean_1351,
  .table-2602 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .heading-green-1979,
  .badge-2abc {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .out-5ead,
  .chip_fixed_cb56,
  .text-a6d8,
  .container-07b0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .info-small-6996,
  .overlay-0d5e,
  .menu-complex-cc67,
  .next-f66b,
  .accent_white_612b,
  .header_161a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .paragraph-focused-bf3c,
  .media_wood_9977,
  .carousel-2875 {
    max-width: none !important;
  }
  
  .hidden_70d9 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .progress_black_ff8d {
    font-size: 1.5rem !important;
  }
  
  .search_prev_11cb {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .down_62a5,
  .huge-58cf {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .clean_1351 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .dropdown-new-8cfa {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .popup_active_fcaf {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .paragraph-focused-bf3c,
  .carousel-2875 {
    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: fa03 */
.promo-block-t1 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.1;
}
