/* Shared product price: amount + 円 + （税込） (ops enter digits only). */
.mns-price {
  display: inline-flex;
  align-items: baseline;
  color: #000;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

@media (max-width: 768px) {
  .mns-price {
    font-size: 22px;
  }
}

.mns-price__value {
  font-size: 1em;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
}

.mns-price__unit {
  margin-left: 0.12em;
  font-size: 0.55em;
  font-weight: 500;
  line-height: 1;
}

.mns-price__tax {
  margin-left: 0.28em;
  font-size: 0.48em;
  font-weight: 500;
  line-height: 1;
}

.mns-product-card {
  /* Contain product art — no bleed scale (scale + overflow:hidden crops edges).
     Cover hover overlays set their own scale separately. */
  --mns-product-card-image-bleed-scale: 1;
  --mns-product-card-media-pad: clamp(14px, 1.5vw, 20px);
  /* Extra top pad so corner tags clear the product art. */
  --mns-product-card-media-pad-top: clamp(32px, 3.2vw, 40px);
  /* Default product art: contain. Simple hover field uses cover separately. */
  --mns-media-object-fit: contain;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  isolation: isolate;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(21, 23, 22, 0.1);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: #2E2F2F;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(21, 23, 22, 0.03);
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.mns-product-card:hover {
  border-color: rgba(94, 111, 103, 0.38);
  background: #ffffff;
  box-shadow: 0 20px 44px rgba(21, 23, 22, 0.08);
}

.mns-product-card__hover-overlay {
  position: absolute;
  /* Simple hover field: full-bleed cover over the media frame. */
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  /* Opaque base so fade-out is over the main image, not the card white. */
  background: #ffffff;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.mns-product-card.is-variant-hovered .mns-product-card__hover-overlay {
  visibility: visible;
  opacity: 1;
}

/* Keep the main image fully opaque underneath; only the overlay fades.
   Cross-fading both layers at once flashed the white card background. */

.mns-product-card__hover-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  object-position: center center;
  mix-blend-mode: normal;
  transform: scale(var(--mns-media-bleed-scale, var(--mns-product-card-image-bleed-scale)));
}

.mns-product-card__media {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  margin: 0;
  overflow: hidden;
  padding: var(--mns-product-card-media-pad-top, clamp(32px, 3.2vw, 40px))
    var(--mns-product-card-media-pad, clamp(14px, 1.5vw, 20px))
    var(--mns-product-card-media-pad, clamp(14px, 1.5vw, 20px));
}

.mns-product-card__image {
  /* Fit inside the padded (non-square) content box. Do not force 1:1 —
     top tag safe-pad makes content shorter than wide at narrow widths. */
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center center;
  mix-blend-mode: multiply;
  transform: scale(var(--mns-product-card-image-bleed-scale));
  transform-origin: center center;
  transition: transform 240ms ease;
}

.mns-product-card:hover .mns-product-card__image {
}

/* 悬浮图字段：铺满整卡（含文案区），不限定图区 */
.mns-product-card--full-hover .mns-product-card__media {
  grid-area: 1 / 1;
}

.mns-product-card--full-hover .mns-product-card__body {
  grid-row: 2;
}

.mns-product-card--full-hover .mns-product-card__hover-overlay {
  /* 跨满整格，包含块始终是整卡，避免松手时百分比高度失效 */
  grid-area: 1 / 1 / -1 / -1;
  inset: 0;
  z-index: 1;
  display: block;
  align-self: stretch;
  justify-self: stretch;
  width: auto;
  height: auto;
  padding: 0;
  border-radius: inherit;
  /* Cover photo is opaque; keep overlay clear so fade does not veil body copy. */
  background: transparent;
  /* 隐藏时延后 visibility，避免淡出中途变 hidden 触发布局回落 */
  transition:
    opacity 220ms ease,
    visibility 0s linear 220ms;
}

.mns-product-card--full-hover.is-variant-hovered .mns-product-card__hover-overlay {
  visibility: visible;
  opacity: 1;
  transition:
    opacity 220ms ease,
    visibility 0s linear 0s;
}

.mns-product-card--full-hover .mns-product-card__hover-overlay img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  object-fit: cover !important;
  object-position: center center;
  mix-blend-mode: normal;
  transform: scale(1.02) !important;
  transform-origin: center center;
  transition: none;
}

/* 回退主图：绝对叠在图区上（与 media 同宽同 1:1），contain + multiply */
.mns-product-card--full-hover.is-hover-media .mns-product-card__hover-overlay {
  position: absolute;
  grid-area: unset;
  inset: auto;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  padding: var(--mns-product-card-media-pad-top, clamp(32px, 3.2vw, 40px))
    var(--mns-product-card-media-pad, clamp(14px, 1.5vw, 20px))
    var(--mns-product-card-media-pad, clamp(14px, 1.5vw, 20px));
  background: #ffffff;
  border-radius: 0;
}

.mns-product-card--full-hover.is-hover-media .mns-product-card__hover-overlay img {
  position: relative;
  inset: auto;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center center;
  mix-blend-mode: multiply;
  transform: scale(var(--mns-product-card-image-bleed-scale)) !important;
  transform-origin: center center;
}

/* 首页新商品：整卡悬浮用更长渐变 */
.mns-new-products-section[data-mns-new-products] .mns-product-card--full-hover .mns-product-card__hover-overlay {
  transition:
    opacity 0.5s ease,
    visibility 0s linear 0.5s;
}

.mns-new-products-section[data-mns-new-products] .mns-product-card--full-hover.is-variant-hovered .mns-product-card__hover-overlay {
  transition:
    opacity 0.5s ease,
    visibility 0s linear 0s;
}

.mns-product-card__model {
  display: block;
  margin: 4px 0 0;
  color: rgba(46, 47, 47, 0.48);
  font-family: var(--mns-font-heading, var(--font-heading));
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
}

.mns-product-card__tags {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  font-size: var(--mns-product-card-meta-size, var(--mns-product-card-tag-size));
  font-weight: 400;
  line-height: 1;
  color: var(--mns-product-card-tag-color, var(--mns-ink, #2E2F2F));
  pointer-events: none;
  transition: color 180ms ease;
}

.mns-product-card__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 8px;
  border: 1px solid var(--mns-product-card-tag-border);
  border-radius: 999px;
  background: var(--mns-product-card-tag-bg);
  box-shadow: 0 2px 8px rgba(20, 24, 22, 0.06);
  color: inherit;
  line-height: 1;
  white-space: nowrap;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

/* absolute ※ 不占流：胶囊右侧预留 左边距 2px + 角标字宽 */
.mns-product-card__tag:has(.mns-product-card__tag-char .mns-product-card__tag-mark) {
  padding-right: calc(8px + 2px + max(var(--mns-text-min-mark, 8px), 0.333em));
}

.mns-product-card__tag-char {
  position: relative;
  display: inline-block;
  line-height: 1;
}

.mns-product-card__tag-mark {
  position: absolute;
  top: 0;
  left: 100%;
  margin: 0 0 0 2px;
  /* 约末字 1/3，且不低于全局角标最小可读 */
  font-size: max(var(--mns-text-min-mark, 8px), 33.333%);
  font-weight: 500;
  line-height: 1;
  transform: none;
  pointer-events: none;
}

/* 无前导字的孤立 ※：回到文档流，胶囊自然加宽 */
.mns-product-card__tag > .mns-product-card__tag-mark {
  position: relative;
  top: auto;
  left: auto;
  vertical-align: super;
}

.mns-product-card__disclaimer {
  margin: 6px 0 0;
  max-width: 100%;
  color: var(--mns-product-card-disclaimer-color);
  font-size: max(var(--mns-text-min-mark, 8px), 0.625rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-align: right;
  transition: color 180ms ease;
}

.mns-product-card:hover .mns-product-card__disclaimer,
.mns-product-card.is-variant-hovered .mns-product-card__disclaimer {
  color: var(--mns-product-card-disclaimer-color-hover);
}

.mns-product-card.is-hover-dark .mns-product-card__disclaimer {
  color: var(--mns-product-card-disclaimer-color-on-dark);
  text-shadow: none;
}

.mns-product-card__body {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: clamp(8px, 1vw, 12px) clamp(15px, 1.6vw, 20px) clamp(15px, 1.6vw, 20px);
}

.mns-product-card__title {
  display: grid;
  min-width: 0;
  gap: 0;
}

.mns-product-card__title .mns-product-card__price {
  margin-top: 6px;
}

.mns-product-card__name {
  display: -webkit-box;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  color: #202322;
  font-size: var(--mns-product-card-title-size);
  font-weight: 500;
  line-height: 1.36;
  -webkit-line-clamp: 2;
}

.mns-product-card__selling-point {
  box-sizing: border-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: rgba(46, 47, 47, 0.52);
  font-size: var(--mns-product-card-meta-size, var(--mns-product-card-tag-size));
  font-weight: 400;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mns-product-card__price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0;
  color: #000;
  font-family: var(--mns-font-heading, var(--font-heading));
  line-height: 1.12;
}

.mns-product-card__variants {
  display: flex;
  min-height: 26px;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.mns-product-card__variant-list {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 6px;
}

.mns-product-card__variant-chip {
  display: grid;
  width: 24px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(21, 23, 22, 0.12);
  border-radius: 4px;
  background: var(--mns-variant-color, #f3f3ef);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78);
}

.mns-product-card__variant-chip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(var(--mns-product-card-image-bleed-scale));
}

.mns-product-card__variant-overflow {
  display: grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 4px;
  background: rgba(240, 240, 238, 0.92);
  color: rgba(46, 47, 47, 0.62);
  font-family: var(--mns-font-heading, var(--font-heading));
  font-size: 0.68rem;
  white-space: nowrap;
}

.mns-product-card__variant-overflow--mobile {
  display: none;
}

.mns-product-card.is-hover-dark .mns-product-card__body,
.mns-product-card.is-hover-dark .mns-product-card__name,
.mns-product-card.is-hover-dark .mns-product-card__price,
.mns-product-card.is-hover-dark .mns-product-card__price .mns-price,
.mns-product-card.is-hover-dark .mns-product-card__price .mns-price__value,
.mns-product-card.is-hover-dark .mns-product-card__price .mns-price__unit,
.mns-product-card.is-hover-dark .mns-product-card__price .mns-price__tax,
.mns-product-card.is-hover-dark .mns-product-card__model,
.mns-product-card.is-hover-dark .mns-product-card__selling-point,
.mns-product-card.is-hover-dark .mns-product-card__tags,
.mns-product-card.is-hover-dark .mns-product-card__tag {
  color: #fff;
}

/* 左上标签：与标题/卖点同一套深浅悬停切换 */
.mns-product-card.is-hover-dark .mns-product-card__tags {
  color: var(--mns-product-card-tag-color-on-dark, #fff);
}

.mns-product-card.is-hover-dark .mns-product-card__tag {
  border-color: var(--mns-product-card-tag-border-on-dark);
  background: var(--mns-product-card-tag-bg-on-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  color: inherit;
}

/* 浅色整卡悬浮图：角标改为黑底白字（回退主图的图区模式不改角标） */
.mns-product-card.is-variant-hovered:not(.is-hover-dark):not(.is-hover-media) .mns-product-card__tags {
  color: #fff;
}

.mns-product-card.is-variant-hovered:not(.is-hover-dark):not(.is-hover-media) .mns-product-card__tag {
  color: #fff;
  background: #2E2F2F;
  border-color: #2E2F2F;
  box-shadow: 0 2px 8px rgba(20, 24, 22, 0.16);
}

.mns-product-card.is-hover-dark .mns-product-card__body {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.32);
}

@media (max-width: 768px) {
  .mns-product-card {
    --mns-product-card-title-size: 0.78rem;
    grid-template-rows: auto auto;
  }

  .mns-product-card__tags {
    top: 8px;
    left: 8px;
    gap: 4px;
  }

  .mns-product-card__disclaimer {
    max-width: 100%;
    font-size: 9px;
  }

  .mns-product-card__tag {
    min-height: 18px;
    padding: 1px 7px;
  }

  .mns-product-card__media {
    aspect-ratio: 1 / 1;
    --mns-product-card-media-pad: 8px;
    /* Keep ≥ tag top(8) + tag height(~18+border) + gap — 28px was flush/overlap. */
    --mns-product-card-media-pad-top: 34px;
  }

  .mns-product-card__image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
  }

  .mns-product-card__body {
    gap: 7px;
    padding: 8px 9px 10px;
    text-align: left;
  }

  /* Mobile-nav product rows: layout owned by header-parity (always L/R).
     Do not re-stack cards here — avoids 769–1060px vertical flash. */

  .mns-product-card__model {
    font-size: 0.72em;
  }

  .mns-product-card__variants {
    min-width: 0;
    min-height: 18px;
    justify-content: flex-start;
    gap: 6px;
    overflow: hidden;
  }

  .mns-product-card__variant-list {
    min-width: 0;
    justify-content: flex-start;
    gap: 3px;
    overflow: hidden;
  }

  .mns-product-card__variant-chip,
  .mns-product-card__variant-overflow {
    width: 18px;
    min-width: 18px;
    height: 18px;
  }

  .mns-product-card__variant-chip.is-mobile-hidden,
  .mns-product-card__variant-overflow--desktop {
    display: none;
  }

  .mns-product-card__variant-overflow--mobile {
    display: grid;
  }

  .mns-product-card__variant-overflow {
    width: auto;
    min-width: 22px;
    padding-inline: 4px;
    font-size: 0.62rem;
  }

  .mns-product-card__name {
    min-height: 2.56em;
    overflow-wrap: anywhere;
    font-size: var(--mns-product-card-title-size);
    line-height: 1.28;
  }

  .mns-product-card__price {
    gap: 3px;
  }
}

@media (hover: none), (pointer: coarse) {
  .mns-product-card:hover {
    border-color: rgba(21, 23, 22, 0.1);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 0 rgba(21, 23, 22, 0.03);
    transform: none;
  }

  .mns-product-card:hover .mns-product-card__image {
    transform: scale(var(--mns-product-card-image-bleed-scale));
  }

  .mns-product-card__hover-overlay {
    display: none;
  }
}
