/* Shared grid sizing. Keep each component's column count, spacing and scroll behavior. */
@media (max-width: 1180px) {
  main :is(
    .benefit-grid, .news-grid, .case-requirements, .case-work__grid,
    .case-result__grid, .case-related__grid, .catalog-grid, .case-products__row,
    .catalog-static-grid, .headboard-grid, .locks-equipment-grid, .locks-type-grid,
    .locks-model-grid, .locks-installed-grid, .soft-product-grid,
    .textile-assortment__grid, .textile-benefits__grid, .textile-related__grid,
    .collection38-included__grid, .home-collections__grid, .fitout-benefit-grid,
    .fitout-budget__grid, .channel-grid, .route-grid, .details-grid,
    .access-card-grid, .access-cert-grid, .design-stage-list, .design-included-grid,
    .design-media-grid, .design-price-grid, .stories__grid, .doors-type-grid,
    .doors-cut-grid, .collections-compare__cards, .cards-3, .cards-2,
    .certificates-grid, .info-card-list, .process-grid, .doc-grid,
    .product-related__grid, .projects-grid, .kit__grid, .advantages__grid,
    .similar__grid, .conditions
  ) > * {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  main .contacts-hero__grid > .coord-card,
  main .news-hero__grid > .featured-card,
  main .details-grid > .dark-cta,
  main .contacts-grid > .map-card,
  main .safety-map__grid > .sout-card,
  main .faq-intro > .help-card {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  /* These two product layouts previously used fixed 335px tracks or inner blocks. */
  main .case-products__row,
  main .product-related__grid {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    align-items: stretch;
    height: auto;
  }

  main .case-product-card,
  main .product-related-card {
    display: flex;
    flex-direction: column;
    height: auto;
    min-width: 0;
  }

  main .case-product-photo,
  main .product-related-card__photo {
    position: relative;
    top: auto;
    left: auto;
    display: block;
    width: 100%;
    height: auto;
    flex: 0 0 auto;
  }
  main .case-product-photo { aspect-ratio: 335 / 250; }
  main .product-related-card__photo { aspect-ratio: 335 / 190; }
  main .product-related-card__photo img { position: absolute; inset: 0; }

  main .case-product-card h3,
  main .product-related-card h3 {
    position: static;
    width: auto;
    margin: 30px 23px 28px;
    overflow-wrap: anywhere;
  }

  main .case-product-divider {
    position: static;
    display: block;
    width: auto;
    margin: 0 23px;
    flex: 0 0 1px;
  }
  main .case-product-row {
    position: static;
    width: auto;
    margin: 0 23px;
    padding: 16px 0;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 14px;
  }
  main .case-product-row span { min-width: 0; overflow-wrap: anywhere; }
  main .case-product-link {
    position: static;
    width: auto;
    min-height: 40px;
    height: auto;
    margin: auto 23px 20px;
    padding-top: 12px;
    white-space: normal;
  }
  main .case-product-link span:last-child { flex-shrink: 0; }

  main .product-related-card h3 { margin-bottom: 12px; }
  main .product-related-card__meta {
    position: static;
    width: auto;
    margin: 0 23px 20px;
    overflow-wrap: anywhere;
  }
  main .product-related-card__divider {
    position: static;
    width: 100%;
    display: block;
    flex: 0 0 1px;
    margin-top: auto;
  }
  main .product-related-card__link {
    position: static;
    margin: 20px 23px;
    white-space: normal;
  }
}

@media (max-width: 760px) {
  main .case-products__row,
  main .product-related__grid { grid-template-columns: minmax(0, 1fr); }
  main .product-related__inner { width: calc(100% - 32px); }
}
