/* Accessories from product metafield — grid (4 col desktop, 2 col mobile), card hover */
product-accessories.product-accessories-metafield {
  display: block;
  width: 100%;
}

.product-accessories-metafield[hidden] {
  display: none !important;
}

.product-accessories-metafield {
  padding-block-start: var(--section-spacing-block-start, 40px);
  padding-block-end: var(--section-spacing-block-end, 40px);
  background-color: rgb(var(--color-background));
}

.product-accessories-metafield__inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

@media (max-width: 991px) {
  .product-accessories-metafield__inner {
    gap: 20px;
  }
}

.product-accessories-metafield__title {
  margin: 0;
  text-align: center;
  color: rgb(var(--color-text));
  font-size: 40px;
  line-height: 49px;
  font-weight: 700;
}

@media screen and (max-width: 991px) {
  .product-accessories-metafield__title {
    font-size: 24px;
    line-height: 34px;
  }
}

.product-accessories-metafield__grid {
  display: grid;
  grid-template-columns: repeat(var(--pam-mobile-columns, 2), minmax(0, 1fr));
  gap: 16px 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 992px) {
  .product-accessories-metafield__grid {
    grid-template-columns: repeat(var(--pam-desktop-columns, 4), minmax(0, 1fr));
    gap: 24px;
  }
}

.product-accessories-metafield__cell {
  min-width: 0;
}

.product-accessories-metafield__card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  min-width: 0;
  padding: 0;
  border-radius: 12px;
  background-color: rgb(var(--color-background));
  box-shadow: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.3s ease;
}

.product-accessories-metafield__card:hover {
  cursor: pointer;
  box-shadow: 0 0 8px rgba(14, 20, 36, 0.08);
}

.product-accessories-metafield__card .block-product-card__layer-image-wrapper {
  position: relative;
}

/* Hover anywhere on the card: crossfade to second gallery image (see blocks/product-card/_image.css) */
@media (min-width: 992px) {
  .product-accessories-metafield__card:hover
    .block-product-card__layer-image-wrapper.desktop-hover
    .block-product-card__image:nth-of-type(1) {
    opacity: 0;
  }

  .product-accessories-metafield__card:hover
    .block-product-card__layer-image-wrapper.desktop-hover
    .block-product-card__image:nth-of-type(2) {
    opacity: 1;
  }
}

@media (max-width: 991px) {
  .product-accessories-metafield__card:hover
    .block-product-card__layer-image-wrapper.mobile-hover
    .block-product-card__image:nth-of-type(1) {
    opacity: 0;
  }

  .product-accessories-metafield__card:hover
    .block-product-card__layer-image-wrapper.mobile-hover
    .block-product-card__image:nth-of-type(2) {
    opacity: 1;
  }
}

.product-accessories-metafield__card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.product-accessories-metafield__card .block-product-card-info {
  position: relative;
  z-index: 2;
  text-align: left;
  padding: 16px 12px;
}

.product-accessories-metafield__title-link:hover span {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.product-accessories-metafield__card:hover .product-accessories-metafield__title-link span {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.product-accessories-metafield__cell .product-accessories-metafield__card .block-product-title {
  padding-inline: 0;
}

.product-accessories-metafield__card .block-product-title span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  margin-bottom: 8px;
}

@media screen and (max-width: 991px) {
  .product-accessories-metafield__card .block-product-title span {
    font-size: 14px;
    line-height: 20px;
  }
}

.product-accessories-metafield__card .product-variant-sku,
.product-accessories-metafield__card .block-product-variant-sku {
  display: inline-block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #666666;
  margin-bottom: 16px;
}

.product-accessories-metafield__card .product-price__item.product-price__sale {
  font-weight: 700;
  font-size: 22px;
  line-height: 30px;
}

@media screen and (max-width: 991px) {
  .product-accessories-metafield__card .product-price__item.product-price__sale {
    font-size: 16px;
    line-height: 24px;
  }
}

.product-accessories-metafield__card .product-price__item.product-price__origin {
  font-size: 14px;
  line-height: 20px;
  color: #666666;
  font-weight: 400;
}

.product-accessories-metafield__cell .block-product-card.product-card-style--card .block-product-price {
  padding-inline: 0;
}

.product-accessories-metafield__card .block-product-card__image-wrapper {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.product-accessories-metafield__card .block-product-card__image-wrapper .block-product-card__image {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
