/* ============================================
   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 (.row_8a81) is a descendant of
   .logo-brown-2e5e (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.table-active-6de9 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".focused-7a85" 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.description_320d so it can't cause
   horizontal overflow anyway. */
.slider_red_3c42,
.banner-top-71aa,
.stone_0e0f,
.thumbnail_3c4b,
.bottom_f2a5,
.photo_756b,
.badge_short_a8d3,
.hard_873b,
.right-8690,
.short_9527,
.form_0216 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .photo-prev-9f59 {
    padding: 8px 0;
  }
  
  .nav-c6a2 img {
    height: 28px;
    width: auto;
  }
  
  .button_paper_7ed1 {
    display: none !important;
  }
  
  .alert-7d71 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .alert-7d71 svg {
    width: 14px;
    height: 14px;
  }
  
  .complex_b477 {
    padding: 6px;
  }
  
  .lite_1265 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .stone_0e0f,
  .banner-top-71aa,
  .thumbnail_3c4b,
  .bottom_f2a5,
  .banner-24b7,
  .detail_dark_0463,
  .row_0c83,
  .complex_e53e,
  .summary-4228,
  .carousel-6501,
  .pagination_b0b1,
  .outline_inner_bfdd {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .picture_copper_3078,
  .notification-8cfb {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .sidebar_3e0b,
  .input_52f3,
  .button_soft_1928,
  .tertiary-steel-13f3,
  .header-red-31b5,
  .grid-out-ed9d,
  .info_d837 {
    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 */
  .carousel_36cf,
  .tag-thick-1b48,
  .photo_418e,
  .hero-a5ae,
  .gallery-d3c9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .widget_0a5a,
  .left-a4d9,
  .active-fixed-973f,
  .smooth_0e3a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .filter_hot_3cad,
  .west-55bf {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .current-4db6,
  .section-2b85,
  .down-0fa3,
  .progress_west_45c9 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .feature-wide-930b,
  .content-28a5,
  .photo_be11,
  .pattern_8386,
  .over_4dc4,
  .hot-d4ce {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .carousel_36cf,
  .tag-thick-1b48,
  .hero-a5ae {
    max-width: none !important;
  }
  
  .focused-7a85 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .widget_0a5a {
    font-size: 1.5rem !important;
  }
  
  .left-a4d9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tertiary-lite-708e,
  .stone-dda7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .active-fixed-973f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hero_dbf2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .block-263a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .carousel_36cf,
  .hero-a5ae {
    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: 2310 */
.phantom-card-f5 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.3;
}
