/* Shared breakpoints — public pages (loaded last) */

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img, video, canvas, svg { max-width: 100%; }

iframe { max-width: 100%; }

.product-grid,
.gallery-grid,
.cat-grid,
.cards-3,
.values-grid,
.kz-info-grid,
.footer-grid,
.benefits-inner {
  min-width: 0;
}

.product-grid > *,
.cat-grid > *,
.gallery-grid > *,
.cards-3 > * {
  min-width: 0;
}

body.nav-open {
  overflow: hidden;
}

body.nav-open .site-header.home-header::after {
  content: "";
  position: fixed;
  inset: 0;
  top: 100%;
  height: 100vh;
  background: rgba(8, 7, 6, 0.48);
  z-index: 45;
}

@media (max-width: 1100px) {
  .product-grid,
  .gallery-grid,
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .cards-3,
  .values-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
  .container { width: min(var(--max), calc(100% - 36px)); }
}

@media (max-width: 900px) {
  .cards-3,
  .values-grid,
  .contact-grid,
  .footer-grid,
  .split,
  .contact-layout,
  .form-row {
    grid-template-columns: 1fr;
  }

  .nav-desktop { display: none; }
  .menu-toggle { display: grid; }
  .home-ref .header-bar { position: sticky; }

  .mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 20px;
    z-index: 50;
    max-height: min(78vh, 640px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  html[dir="rtl"] .mobile-nav { direction: rtl; text-align: start; }
  html[dir="ltr"] .mobile-nav { direction: ltr; text-align: start; }

  .mobile-nav.open { display: block; }
  .mobile-nav .nav-list {
    flex-direction: column;
    gap: 6px;
  }
  .mobile-nav .nav-list a {
    padding: 12px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .split img,
  .hero { min-height: 52vh; }

  .section,
  .kz-section { padding: 56px 0; }

  .search-panel,
  .account-panel {
    inset-inline: 12px;
    width: auto;
    top: calc(100% + 8px);
  }

  .drawer { width: min(430px, 100%); }
}

@media (max-width: 768px) {
  .product-grid,
  .gallery-grid,
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

  .cat-shop-head,
  .toolbar { flex-wrap: wrap; }

  .footer-brand { flex-wrap: wrap; }

  .kz-form { padding: 20px 16px; }

  .modal,
  #product-modal.product-detail-modal {
    width: min(920px, calc(100% - 16px));
    max-height: calc(100dvh - 16px);
  }
}

@media (max-width: 640px) {
  :root { --header-h: 76px; }
  .container { width: min(var(--max), calc(100% - 24px)); }

  .logo-sub { display: none; }

  /* Keep two product columns on phones when space allows */
  .product-grid,
  .gallery-grid,
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  .hero-actions,
  .product-actions,
  .toolbar { flex-direction: column; align-items: stretch; }

  .hero-actions .btn,
  .product-actions .btn,
  .chip,
  .search,
  .select { width: 100%; }

  .qty button,
  .qty-select button { width: 40px; height: 40px; }

  .cart-item { grid-template-columns: 64px 1fr; }
  .cart-item .remove-item { grid-column: 1 / -1; justify-self: start; }

  .site-footer { padding: 36px 0 88px; }

  input, select, textarea { font-size: 16px; }

  h1 { font-size: clamp(1.7rem, 8vw, 2.6rem); }
}

@media (max-width: 430px) {
  .container { width: min(var(--max), calc(100% - 20px)); }
  .product-grid,
  .gallery-grid,
  .cat-grid { gap: 10px; }
  .product-card img { height: 160px; }
  .category-card { min-height: 220px; }
  .home-tools { gap: 2px; padding: 3px 5px; }
  .checkout-line { grid-template-columns: 56px 1fr; }
  .checkout-line img { width: 56px; height: 56px; }
}

@media (max-width: 360px) {
  .product-grid,
  .cat-grid { gap: 8px; }
  .home-tools .lang-btn { padding: 0 6px; font-size: 0.68rem; }
}

@media (min-width: 1400px) {
  :root { --max: 1280px; }
}

@media (min-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@supports (padding: max(0px)) {
  .kz-wa-float {
    inset-inline-end: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }
  .drawer-footer {
    padding-bottom: max(22px, env(safe-area-inset-bottom));
  }
}
