.products {
  padding-top: 83px;
  padding-bottom: 94px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.section-heading p {
  max-width: 670px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

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

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface-tint);
  transition: background 0.2s ease;
}

.product-card:hover {
  background: #edf1f7;
}

.product-card:hover h3 {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-card-button {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.product-card-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.product-image {
  display: grid;
  place-items: center;
  height: 245px;
  padding: 10px 14px 0;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-details {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 5px 21px 26px;
}

.product-details h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.product-details p {
  min-height: 38px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.product-note {
  margin: 18px 0 0;
  color: #777;
  font-size: 11px;
}

.product-dialog {
  width: 440px;
  max-width: calc(100% - 32px);
  padding: 32px;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-family: var(--font);
}

.product-dialog::backdrop {
  background: rgba(15, 20, 30, 0.58);
}

.product-dialog h2 {
  font-size: 28px;
}

.product-dialog p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.product-dialog form {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}

.product-dialog button {
  padding: 10px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--action);
  color: var(--action-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

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

@media (max-width: 900px) {
  .product-image {
    height: 250px;
  }
}

@media (max-width: 700px) {
  .products {
    padding-top: 61px;
    padding-bottom: 65px;
  }
  .section-heading {
    display: block;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .product-image {
    height: 170px;
    padding: 6px 8px 0;
  }
  .product-details {
    padding: 4px 14px 20px;
  }
  .product-details h3 {
    font-size: 18px;
  }
  .product-details p {
    min-height: 52px;
    font-size: 12px;
  }
}
