.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.05rem;
}

.product-card {
  background: #fff;
  border: 1px solid #e4e4e4;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-media {
  position: relative;
}

.product-like-button {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(17, 17, 17, 0.42);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.82);
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.product-like-button svg {
  width: 23px;
  height: 23px;
  display: block;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 160ms ease, stroke 160ms ease;
}

.product-like-button:hover,
.product-like-button:focus-visible {
  background: #fff;
  border-color: #111;
}

.product-like-button.is-liked {
  color: #f15a29;
  border-color: rgba(17, 17, 17, 0.42);
  background: #fff;
}

.product-like-button.is-liked svg {
  fill: #f15a29;
  stroke: #111;
}

.product-like-button.is-busy {
  opacity: 0.62;
  pointer-events: none;
}

.product-like-button--tile-overlay {
  top: 0;
  right: 0;
  width: 42px;
  height: 42px;
  border-color: transparent;
  background: transparent;
}

.product-like-button--tile-overlay::after {
  content: "";
  position: absolute;
  left: 0.56rem;
  right: 0.56rem;
  bottom: 0.35rem;
  height: 2px;
  background: #f15a29;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 160ms ease;
}

.product-like-button--tile-overlay:hover,
.product-like-button--tile-overlay:focus-visible,
.product-like-button--tile-overlay.is-liked {
  border-color: transparent;
  background: transparent;
}

.product-like-button--tile-overlay svg {
  fill: #fff;
}

.product-like-button--tile-overlay:hover::after,
.product-like-button--tile-overlay:focus-visible::after {
  transform: scaleX(1);
}

.product-image-link {
  display: block;
  background: #f7f7f7;
}

.product-image-link img {
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  height: auto;
  padding: 0;
}

.product-content {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.32;
  font-weight: 400;
}

.product-title a {
  font-weight: inherit;
}

.product-meta {
  margin: 0.4rem 0 0;
  color: #666;
  font-size: 0.86rem;
}

.product-meta--empty {
  visibility: hidden;
}

.product-card .product-description {
  display: none;
  margin: 0.55rem 0 0;
  color: #414141;
  font-size: 0.88rem;
  line-height: 1.48;
}

.product-purchase {
  margin-top: auto;
  padding-top: 0.5rem;
}

.product-purchase-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}

.product-price {
  margin: 0;
  font-weight: 700;
  color: #222;
  font-size: 1.2rem;
  text-align: center;
}

.product-add-inline {
  margin-top: 0;
  width: 100%;
  border: 0;
  border-radius: 3px;
  background: #111;
  color: #fff;
  text-transform: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 0.58rem 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.product-add-inline:hover {
  color: #fff;
}

.product-button-content {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.product-button-content::after {
  content: "";
  position: absolute;
  left: -0.12rem;
  right: -0.12rem;
  bottom: -0.18rem;
  height: 2px;
  background: #f15a29;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 160ms ease;
}

.product-add-inline:hover .product-button-content::after,
.product-add-inline:focus-visible .product-button-content::after {
  transform: scaleX(1);
}

.product-button-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.product-add-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-add-inline--desktop {
  display: none;
}

@media (max-width: 860px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-purchase {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .product-purchase-actions {
    margin-top: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex: 0 0 42px;
  }

  .product-price {
    text-align: left;
    min-width: 0;
  }

  .product-add-inline {
    padding-top: 0.48rem;
    padding-bottom: 0.48rem;
  }

  .product-add-inline--mobile {
    width: auto;
    min-width: 42px;
    margin-top: 0;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    flex: 0 0 auto;
  }

  .product-add-inline--mobile .product-button-content {
    gap: 0;
  }

  .product-add-inline--mobile .product-button-label {
    display: none;
  }
}

@media (hover: hover) and (pointer: fine) and (min-width: 861px) {
  .collection-page .product-card {
    position: relative;
    isolation: isolate;
    container-type: inline-size;
  }

  .collection-page .product-media,
  .collection-page .product-content {
    z-index: 1;
  }

  .collection-page .product-title {
    min-height: calc(0.95rem * 1.32 * 2);
  }

  .collection-page .product-meta {
    min-height: calc(0.86rem * 1.2);
    line-height: 1.2;
  }

  .collection-page .product-card--hover-cart {
    --product-card-hover-description-max: min(21.5rem, 129cqw);

    align-self: start;
    transition: border-color 150ms ease, box-shadow 150ms ease;
  }

  .collection-page .product-card--hover-cart:hover,
  .collection-page .product-card--hover-cart:focus-within {
    z-index: 3;
    overflow: visible;
    border-color: #d9d0c9;
    box-shadow: none;
    transition-delay: 500ms;
  }

  .collection-page .product-card--hover-cart .product-description {
    display: block;
    position: absolute;
    top: calc(100% - 1px);
    left: -1px;
    right: -1px;
    z-index: 2;
    box-sizing: border-box;
    max-height: 0;
    margin: 0;
    padding: 0 0.75rem;
    opacity: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid transparent;
    border-top: 0;
    transform: translateY(-4px);
    transition:
      max-height 190ms ease,
      padding 160ms ease,
      opacity 120ms ease,
      transform 160ms ease,
      border-color 150ms ease,
      box-shadow 150ms ease;
  }

  .collection-page .product-card--hover-cart .product-description-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 15;
    line-clamp: 15;
  }

  .collection-page .product-card--hover-cart:hover .product-description,
  .collection-page .product-card--hover-cart:focus-within .product-description {
    max-height: 21.5rem;
    max-height: var(--product-card-hover-description-max);
    padding-top: 0.55rem;
    padding-bottom: calc(0.75rem + 10px);
    opacity: 1;
    border-color: #d9d0c9;
    box-shadow: none;
    transform: translateY(0);
    transition-delay: 500ms;
  }

  .product-card--hover-cart .product-like-button--tile-overlay {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
  }

  .product-card--hover-cart .product-purchase {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
  }

  .product-card--hover-cart .product-purchase-actions {
    display: contents;
    margin-top: 0;
  }

  .product-card--hover-cart .product-price {
    width: 100%;
    text-align: center;
  }

  .product-card--hover-cart .product-add-inline--mobile {
    position: absolute;
    top: 50%;
    right: 0;
    width: auto;
    min-width: 42px;
    margin-top: 0;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(-50% + 8px));
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .product-card--hover-cart .product-add-inline--mobile .product-button-content {
    gap: 0;
  }

  .product-card--hover-cart .product-add-inline--mobile .product-button-label {
    display: none;
  }

  .product-card--hover-cart:hover .product-add-inline--mobile,
  .product-card--hover-cart:focus-within .product-add-inline--mobile,
  .product-card--hover-cart .product-add-inline--mobile:focus-visible,
  .product-card--hover-cart:hover .product-like-button--tile-overlay,
  .product-card--hover-cart:focus-within .product-like-button--tile-overlay,
  .product-card--hover-cart .product-like-button--tile-overlay:focus-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .product-card--hover-cart:hover .product-add-inline--mobile,
  .product-card--hover-cart:focus-within .product-add-inline--mobile,
  .product-card--hover-cart .product-add-inline--mobile:focus-visible {
    transform: translateY(-50%);
  }

  .product-card--hover-cart:hover .product-like-button--tile-overlay,
  .product-card--hover-cart:focus-within .product-like-button--tile-overlay,
  .product-card--hover-cart .product-like-button--tile-overlay:focus-visible {
    transform: translateY(0);
  }

  .collection-page .content-shelf .product-card--hover-cart .product-description,
  .collection-page .content-shelf .product-card--hover-cart:hover .product-description,
  .collection-page .content-shelf .product-card--hover-cart:focus-within .product-description {
    display: none;
    max-height: 0;
    padding: 0;
    opacity: 0;
    border-color: transparent;
    box-shadow: none;
    transform: translateY(-4px);
  }
}

@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }
}
