/* KhoRevit V8.4.2 — keep the viewport width stable on phones and tablets.
   The navigation originally overflowed when larger typography restored the
   cart label and the shop button remained next to the brand and menu icon. */

@media (max-width: 820px) {
  html, body { width: 100%; max-width: 100%; overflow-x: clip; }
  #home, .hero-wrap, .section, .footer, .header { width: 100%; max-width: 100%; }

  .header .container.nav {
    display: flex; flex-wrap: nowrap; align-items: center;
    width: calc(100% - 30px); max-width: 1190px; min-width: 0;
    gap: 9px; margin: 0 auto;
  }
  .header .brand { flex: 0 1 auto; min-width: 0; gap: 8px; }
  .header .brand-mark { flex: 0 0 40px; }
  .header .brand-title { white-space: nowrap; }
  .header .brand-sub { white-space: nowrap; }
  .header .nav-actions {
    display: flex; flex: 0 0 auto; align-items: center;
    min-width: 0; gap: 8px; margin-left: auto;
  }
  /* The store remains accessible in the hamburger menu. */
  .header .nav-actions > .outline-btn,
  .header .nav-actions > .khv8-account-link { display: none !important; }
  /* Restore the icon-only cart after typography.css re-enabled its text. */
  .header .khv8-cart-link {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 32px; min-width: 32px; min-height: 40px;
    font-size: 0 !important; line-height: 0 !important; white-space: nowrap;
  }
  .header .khv8-cart-link::before {
    content: '🛒'; display: block; font-size: 24px; line-height: 1;
  }
  .header .menu-toggle {
    display: inline-flex !important; align-items: center; justify-content: center;
    flex: 0 0 36px; width: 36px; height: 42px; padding: 0;
  }

  .hero { grid-template-columns: minmax(0, 1fr); width: calc(100% - 30px); }
  .hero > div { min-width: 0; max-width: 100%; }
  .hero h1, .hero p { max-width: 100%; overflow-wrap: break-word; }
  .hero-buttons { max-width: 100%; flex-wrap: wrap; }
  .hero-buttons a { max-width: 100%; }
  .hero-art { width: 100%; max-width: 100%; min-width: 0; }
  .hero-art > img { max-width: 100%; }

  .section .container, .footer .container { min-width: 0; }
  .section-heading > div { min-width: 0; }
  .categories, .products, .benefits, .footer-columns {
    max-width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .category, .product, .benefit, .category-text, .feature-copy { min-width: 0; }
  .category-text strong, .product h3 { overflow-wrap: anywhere; }
  .feature { grid-template-columns: minmax(0, 1fr); max-width: 100%; }
}

@media (max-width: 540px) {
  .container, .hero { width: calc(100% - 30px); max-width: 100%; }
  .header .brand-title { font-size: clamp(14px, 4vw, 17px); }
  .header .brand-sub { font-size: 8px; letter-spacing: 0; }
  .hero { padding-top: 44px; }
  .hero h1 { font-size: clamp(29px, 8.3vw, 35px); letter-spacing: -.6px; }
  .hero-stats {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px; width: 100%;
  }
  .hero-stats > div { min-width: 0; overflow-wrap: anywhere; }
  .hero-stats strong { line-height: 1.3; }
  .hero-art { height: auto; min-height: 240px; }
  .hero-art > img { width: min(100%, 260px); height: auto; max-height: 290px; }
  .section-heading { flex-wrap: wrap; }
  .section-heading .view-all { max-width: 100%; }
  .categories, .products, .footer-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .benefits { grid-template-columns: minmax(0, 1fr); }
  .footer-columns > div { min-width: 0; overflow-wrap: anywhere; }
}

@media (max-width: 360px) {
  .header .brand-mark { flex-basis: 34px; width: 34px; height: 34px; font-size: 23px; }
  .header .brand-title { font-size: 13px; }
  .header .brand-sub { font-size: 7px; }
  .header .nav-actions { gap: 5px; }
  .header .khv8-cart-link { flex-basis: 29px; min-width: 29px; }
  .header .menu-toggle { flex-basis: 31px; width: 31px; }
}
