/* ============================================
   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 (.down-06a6) is a descendant of
   .panel_1f84 (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.logo-prev-d48c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".shade-rough-bd84" 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_ad9f so it can't cause
   horizontal overflow anyway. */
.mask-892a,
.copper-9f27,
.item-a01c,
.focus_easy_1133,
.image_steel_aafa,
.notice-soft-aa83,
.selected_dc60,
.menu-cf16,
.search_outer_f45d,
.card-c3ca,
.hard-c39c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .block_silver_196a {
    padding: 8px 0;
  }
  
  .gradient-7116 img {
    height: 28px;
    width: auto;
  }
  
  .slow_31f9 {
    display: none !important;
  }
  
  .center_16ca {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .center_16ca svg {
    width: 14px;
    height: 14px;
  }
  
  .sort_slow_7ea5 {
    padding: 6px;
  }
  
  .link_b3c1 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .item-a01c,
  .copper-9f27,
  .focus_easy_1133,
  .image_steel_aafa,
  .paragraph_5af5,
  .hovered-f111,
  .lower_9b4b,
  .link-right-be6a,
  .media-7dd9,
  .element_brown_d45f,
  .filter_6820 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .progress_hot_6c35,
  .brown-ec8a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .dirty-e075,
  .soft-0cb2,
  .slow_e690,
  .primary_62b1,
  .input-09f8,
  .last-9d82,
  .glass-4851 {
    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 */
  .message-red-db9f,
  .hover-c2e4,
  .blue-c713,
  .selected-5d80,
  .component_fa48 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .frame-1120,
  .bronze_6d6b,
  .shade-6167,
  .middle_b0f0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .status-hot-9dcb,
  .bottom_f89e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hidden_cbac,
  .button-00eb,
  .summary-8ef8,
  .gallery_white_f567 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .focused-a2ea,
  .notification_cold_dfb5,
  .feature_395b,
  .dim-c78b,
  .alert_64df,
  .cool-6f11 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .message-red-db9f,
  .hover-c2e4,
  .selected-5d80 {
    max-width: none !important;
  }
  
  .shade-rough-bd84 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .frame-1120 {
    font-size: 1.5rem !important;
  }
  
  .bronze_6d6b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .accent-e29a,
  .last-0232 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .shade-6167 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .message-hard-d25b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .focus-95c4 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .message-red-db9f,
  .selected-5d80 {
    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: 9a47 */
.promo-block-h6 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.3;
}
