.ymal {
  width: 100%;
  padding: var(--ymal-pad-top, 28px) 20px var(--ymal-pad-bottom, 28px);
  background: var(--ymal-section-bg, #ffffff);
  box-sizing: border-box;
}

.ymal__inner {
  width: 100%;
  max-width: var(--ymal-max-width, 1440px);
  margin: 0 auto;
}

.ymal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ymal__head-copy {
  min-width: 0;
}

.ymal__title {
  margin: 0;
  color: var(--ymal-title, #1f2a24);
  font-size: var(--ymal-title-size, 28px);
  font-weight: 700;
  line-height: 1.2;
}

.ymal__subtitle {
  margin: 6px 0 0;
  color: var(--ymal-subtitle, #7a847c);
  font-size: 13px;
  line-height: 1.4;
}

.ymal__shop-all {
  flex-shrink: 0;
  color: var(--ymal-link, #214f2f);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.ymal__row {
  display: grid;
  grid-template-columns: repeat(var(--ymal-cols, 5), minmax(0, 1fr));
  gap: var(--ymal-gap, 14px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ymal__card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ymal-card-border, #ebe6de);
  border-radius: var(--ymal-radius, 16px);
  box-shadow: 0 2px 10px rgba(33, 79, 47, 0.04);
}

.ymal__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.ymal__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--ymal-media-bg, #f3eee6);
}

.ymal__media--plain {
  padding: 20px 16px;
}

.ymal__media--plain img,
.ymal__media--plain .image,
.ymal__media--plain picture,
.ymal__media--plain picture img {
  display: block;
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(33, 79, 47, 0.12));
}

.ymal__media--bag {
  align-items: flex-end;
  justify-content: center;
  /* 顶部留给提手拱形，避免被 overflow 裁切 */
  padding: 34% 16px 0;
  overflow: hidden;
}

.ymal__bag {
  position: relative;
  z-index: 1;
  width: 62%;
  margin-bottom: -20%;
  overflow: visible;
}

/* CSS 背包：与评价媒体卡同一套提手 + LovinPet */
.ymal__bag--css {
  aspect-ratio: 1 / 0.82;
  background: var(--ymal-bag-body, #f0d0c6);
  border-radius: 12px 12px 14px 14px;
  box-shadow: 0 8px 18px rgba(90, 55, 40, 0.14);
}

.ymal__bag--css::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -58%;
  width: 76%;
  height: 72%;
  border: 10px solid #e7c2b7;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  box-sizing: border-box;
  transform: translateX(-50%);
}

.ymal__bag--css::after {
  content: "LovinPet";
  position: absolute;
  left: 50%;
  top: 52%;
  color: var(--ymal-bag-text, #836151);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(11px, 1.05vw, 14px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.ymal__bag img,
.ymal__bag .image,
.ymal__bag picture,
.ymal__bag picture img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.ymal__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 14px;
  background: #fff;
}

.ymal__media--bag + .ymal__info {
  padding-top: 22px;
}

.ymal__name {
  margin: 0;
  overflow: hidden;
  color: var(--ymal-name, #1f2a24);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ymal__desc {
  margin: 0;
  overflow: hidden;
  color: var(--ymal-desc, #7a847c);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ymal__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
}

.ymal__price {
  margin: 0;
  color: var(--ymal-price, #1f2a24);
  font-size: 14px;
  font-weight: 700;
}

.ymal__rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ymal-star, #e2a33a);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.ymal__stars {
  letter-spacing: -1px;
}

@media (max-width: 1199.98px) {
  .ymal__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .ymal {
    padding-inline: 16px;
  }

  .ymal__head {
    flex-direction: column;
  }

  .ymal__title {
    font-size: 22px;
  }

  .ymal__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
