html,
body {
  max-width: 100%;
  overflow-x: clip;
}

img,
video {
  max-width: 100%;
}

.cart-drawer {
  max-width: 100vw;
}

@media (max-width: 820px) {
  .container {
    width: min(100% - 32px, 1180px);
  }

  .header-inner {
    height: 70px;
    gap: 12px;
  }

  .brand {
    font-size: 20px;
  }

  .header-actions {
    gap: 8px;
  }

  .cart-button {
    padding: 10px 14px;
    font-size: 13px;
  }

  .menu-button {
    padding: 6px;
    line-height: 1;
  }

  .hero {
    padding: 48px 0 56px;
  }

  .hero-grid {
    gap: 22px;
  }

  .hero h1,
  .section h2,
  .contact-section h2 {
    font-size: clamp(38px, 11vw, 54px);
  }

  .hero-text {
    margin: 22px 0;
    font-size: 15px;
  }

  .hero-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 36px;
  }

  .hero-visual {
    min-height: 350px;
  }

  .hero-product-photo {
    height: 350px;
  }

  .tag-bottom {
    left: 0;
    bottom: 28px;
  }

  .tag-top {
    right: 0;
  }

  .trust-grid {
    gap: 12px;
  }

  .trust-grid div {
    padding-right: 10px;
  }

  .section {
    padding: 68px 0;
  }

  .section-heading {
    display: grid;
    gap: 22px;
    margin-bottom: 28px;
  }

  .section-intro {
    max-width: 100%;
  }

  .catalog-audience-tiles {
    margin: 20px 0;
  }

  .catalog-layout {
    display: block;
  }

  .filter-panel {
    position: static;
    top: auto;
    margin-bottom: 18px;
  }

  .catalog-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .search-field {
    min-width: 0;
  }

  .catalog-toolbar select {
    min-width: 0;
    max-width: 160px;
  }

  .configurator-card {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 24px;
  }

  .config-diagram {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 6px;
    width: 100%;
  }

  .diagram-step {
    width: auto;
    min-width: 0;
    height: 92px;
    padding: 12px;
  }

  .diagram-step span {
    font-size: 11px;
    overflow-wrap: anywhere;
  }

  .diagram-arrow {
    font-size: 17px;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-section {
    padding-top: 68px;
  }

  .large-copy {
    font-size: 21px;
  }

  .contact-section {
    padding: 64px 0;
  }

  .contact-card {
    max-width: 100%;
  }

  .footer-top {
    display: grid;
    gap: 22px;
  }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .footer-bottom {
    flex-wrap: wrap;
    gap: 12px 20px;
  }

  .footer-bottom a {
    margin-left: 0;
  }

  .product-detail-modal {
    padding: 0;
    align-items: end;
  }

  .product-detail-box {
    display: block;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .product-detail-media {
    width: 100%;
    height: min(48dvh, 410px);
    min-height: 330px;
    padding: 24px 32px;
  }

  .product-detail-media.has-gallery {
    padding-bottom: 88px;
  }

  .product-detail-info {
    width: 100%;
    height: auto;
    padding: 26px 18px calc(28px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .product-detail-heading {
    padding-right: 0;
  }

  .product-detail-heading h2 {
    font-size: clamp(24px, 7vw, 31px);
    overflow-wrap: anywhere;
  }

  .product-detail-close {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    z-index: 60;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 24px rgba(23, 35, 47, 0.14);
  }

  .product-gallery-prev {
    left: 10px;
  }

  .product-gallery-next {
    right: 10px;
  }

  .product-gallery-thumbs {
    left: 10px;
    right: 10px;
  }
}

@media (max-width: 560px) {
  .container {
    width: calc(100% - 24px);
  }

  .header-inner {
    width: calc(100% - 24px);
  }

  .brand {
    font-size: 18px;
  }

  .cart-button {
    padding: 9px 12px;
  }

  .hero {
    padding-top: 38px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-facts {
    font-size: 9px;
  }

  .hero-visual,
  .hero-product-photo {
    min-height: 300px;
    height: 300px;
  }

  .visual-tag {
    padding: 9px 11px;
    font-size: 13px;
  }

  .trust-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 10px 0;
  }

  .trust-grid div {
    padding: 12px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .catalog-audience-tiles {
    min-height: 88px;
  }

  .catalog-audience-tiles .audience-tile {
    min-width: 0;
    min-height: 88px;
    padding: 16px 14px !important;
    font-size: clamp(10px, 2.8vw, 13px) !important;
    letter-spacing: -0.055em !important;
  }

  .catalog-audience-tiles .audience-tile > span {
    white-space: nowrap;
  }

  .filter-panel .filter-label,
  .filter-panel .filter-label:nth-of-type(3),
  .filter-group,
  .filter-group:nth-of-type(even) {
    display: block;
    width: 100%;
    margin-right: 0;
  }

  .filter-audience-buttons {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-toolbar {
    grid-template-columns: 1fr;
  }

  .catalog-toolbar select {
    width: 100%;
    max-width: none;
    min-height: 44px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .product-image {
    height: 130px;
  }

  .product-body {
    padding: 9px;
  }

  .product-category {
    font-size: 8px;
  }

  .product-name {
    display: -webkit-box;
    min-height: 44px;
    margin: 6px 0 9px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .product-specs {
    display: none;
  }

  .product-meta {
    display: none;
  }

  .product-price,
  .price-new {
    font-size: 12px;
  }

  .add-button {
    width: 30px;
    height: 30px;
    font-size: 17px;
  }

  .configurator-card h2 {
    font-size: 32px;
  }

  .about-grid br,
  .contact-grid br {
    display: none;
  }

  .contact-card {
    padding: 22px;
  }

  .footer-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .product-detail-media {
    height: min(72dvh, 680px);
    min-height: min(72dvh, 680px);
    padding: 12px 14px;
  }

  .product-detail-media.has-gallery {
    padding-bottom: 84px;
  }

  .product-gallery-thumb {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
  }

  .detail-description {
    margin-top: 22px;
  }

  .detail-characteristics {
    margin-top: 24px;
  }
}

.page-jump-nav {
  position: fixed;
  right: 18px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 28;
  display: grid;
  gap: 9px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.page-jump-nav.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.page-jump-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(23, 35, 47, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 8px 26px rgba(23, 35, 47, 0.18);
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.page-jump-button:active {
  transform: scale(0.94);
}

.page-jump-button.page-jump-down {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

body.detail-modal-open .page-jump-nav {
  display: none;
}

@media (min-width: 821px) {
  .page-jump-nav {
    display: none;
  }
}

@media (min-width: 561px) and (max-width: 820px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 340px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
