.articlepilot-product-card {
  box-sizing: border-box;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 1rem;
  margin: 1.5rem 0;
  background: #fff;
}

.articlepilot-product-card__disclosure {
  margin: 0 0 .75rem;
  color: #5f6b7a;
  font-size: .8125rem;
}

.articlepilot-product-card__body {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 1rem;
  align-items: start;
}

.articlepilot-product-card__media {
  min-width: 0;
  text-align: center;
}

.articlepilot-product-card__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
}

.articlepilot-product-card__image-source {
  margin: .5rem 0 0;
  color: #6b7280;
  font-size: .75rem;
}

.articlepilot-product-card__image-pending {
  display: block;
  padding: 2rem .5rem;
  color: #6b7280;
  font-size: .8125rem;
}

.articlepilot-product-card__name {
  margin: 0;
  font-size: 1.1rem;
}

.articlepilot-product-card__description {
  margin: .5rem 0 0;
}

.articlepilot-product-card__note {
  display: block;
  margin: .5rem 0 0;
  color: #61727f;
  font-size: .75rem;
  line-height: 1.5;
}

.articlepilot-product-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.articlepilot-product-card__link {
  display: inline-block;
  padding: .5rem .75rem;
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
  font-size: .875rem;
}

.articlepilot-product-card__link--rakuten { background: #bf0000; }
.articlepilot-product-card__link--amazon { background: #232f3e; }
.articlepilot-product-card__link--yahoo { background: #5c2d91; }

/* デザイン設定のある新規カードだけ、広告編集画面のレイアウトに合わせます。 */
.articlepilot-product-card.layout-horizontal,
.articlepilot-product-card.layout-vertical {
  container: articlepilot-product-card / inline-size;
  color: #172c3b;
  border-radius: 12px;
}

.articlepilot-product-card.layout-horizontal.card-shape-square,
.articlepilot-product-card.layout-vertical.card-shape-square {
  border-radius: 0;
}

.articlepilot-product-card.layout-horizontal.card-shadow,
.articlepilot-product-card.layout-vertical.card-shadow {
  box-shadow: 0 2px 8px rgb(23 44 59 / 12%);
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__body,
.articlepilot-product-card.layout-vertical .articlepilot-product-card__body {
  display: flex;
  min-width: 0;
  gap: 16px;
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__body {
  align-items: center;
}

.articlepilot-product-card.layout-vertical {
  max-width: 360px;
  margin-inline: auto;
}

.articlepilot-product-card.layout-vertical .articlepilot-product-card__body {
  flex-direction: column;
  align-items: stretch;
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__media,
.articlepilot-product-card.layout-vertical .articlepilot-product-card__media {
  display: flex;
  flex: 0 0 var(--articlepilot-card-image-size, 96px);
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  width: var(--articlepilot-card-image-size, 96px);
  height: var(--articlepilot-card-image-size, 96px);
  overflow: hidden;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: #fff;
}

.articlepilot-product-card.layout-vertical .articlepilot-product-card__media {
  align-self: center;
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__image,
.articlepilot-product-card.layout-vertical .articlepilot-product-card__image {
  width: auto;
  max-width: 100%;
  max-height: 100%;
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__image-source,
.articlepilot-product-card.layout-vertical .articlepilot-product-card__image-source {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: #61727f;
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__content,
.articlepilot-product-card.layout-vertical .articlepilot-product-card__content {
  flex: 1 1 auto;
  min-width: 0;
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__name,
.articlepilot-product-card.layout-vertical .articlepilot-product-card__name {
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.45;
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__description,
.articlepilot-product-card.layout-vertical .articlepilot-product-card__description {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
  color: #506474;
  font-size: 13px;
  line-height: 1.5;
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__note,
.articlepilot-product-card.layout-vertical .articlepilot-product-card__note {
  margin-top: 9px;
  overflow-wrap: anywhere;
  white-space: pre-line;
  color: #61727f;
  font-size: 11px;
  line-height: 1.5;
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__links,
.articlepilot-product-card.layout-vertical .articlepilot-product-card__links {
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__links > li {
  flex: 0 1 calc((100% - 16px) / 3);
}

.articlepilot-product-card.layout-vertical .articlepilot-product-card__links {
  flex-direction: column;
}

.articlepilot-product-card.layout-vertical .articlepilot-product-card__links > li {
  width: 100%;
}

.articlepilot-product-card.layout-horizontal .articlepilot-product-card__link,
.articlepilot-product-card.layout-vertical .articlepilot-product-card__link {
  display: inline-flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--articlepilot-card-button-color, #bf0032);
  color: var(--articlepilot-card-button-text-color, #fff);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.articlepilot-product-card.layout-horizontal.button-style-outline .articlepilot-product-card__link,
.articlepilot-product-card.layout-vertical.button-style-outline .articlepilot-product-card__link {
  border: 1px solid var(--articlepilot-card-button-color, #bf0032);
  background-color: transparent;
  color: var(--articlepilot-card-button-color, #bf0032);
}

.articlepilot-product-card.layout-horizontal.button-shape-square .articlepilot-product-card__link,
.articlepilot-product-card.layout-vertical.button-shape-square .articlepilot-product-card__link {
  border-radius: 0;
}

.articlepilot-product-card.layout-horizontal.button-shape-pill .articlepilot-product-card__link,
.articlepilot-product-card.layout-vertical.button-shape-pill .articlepilot-product-card__link {
  border-radius: 999px;
}

.articlepilot-product-card.layout-horizontal.button-shadow .articlepilot-product-card__link,
.articlepilot-product-card.layout-vertical.button-shadow .articlepilot-product-card__link {
  box-shadow: 0 2px 5px rgb(23 44 59 / 20%);
}

.articlepilot-product-card__link:focus-visible {
  outline: 3px solid #165b85;
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .articlepilot-product-card__body {
    grid-template-columns: 1fr;
  }
}

@container articlepilot-product-card (max-width: 420px) {
  .articlepilot-product-card.layout-horizontal .articlepilot-product-card__body {
    flex-direction: column;
    align-items: stretch;
  }

  .articlepilot-product-card.layout-horizontal .articlepilot-product-card__media {
    align-self: center;
  }

  .articlepilot-product-card.layout-horizontal .articlepilot-product-card__links {
    flex-direction: column;
  }

  .articlepilot-product-card.layout-horizontal .articlepilot-product-card__links > li {
    flex: 0 0 auto;
    width: 100%;
  }
}
