.c-favorite {
  max-width: 100%;
  margin: 0;
}

/* ツール詳細の購入ボタンと同じピル型・幅に揃える */
.c-favorite__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: clamp(180px, 28vw, 260px);
  max-width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid #0000001a;
  border-radius: 999px;
  background: #fff;
  color: #1c1c1c;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.c-favorite__button:hover {
  border-color: #1c1c1c;
  background: #f6f6f6;
}

.c-favorite__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  transition: transform 0.25s ease, fill 0.25s ease, stroke 0.25s ease;
}

.c-favorite__button[aria-pressed="true"] {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.c-favorite__button[aria-pressed="true"]:hover {
  border-color: #fda4af;
  background: #ffe4e6;
}

.c-favorite__button[aria-pressed="true"] .c-favorite__icon {
  fill: #f43f5e;
  stroke: #f43f5e;
  animation: c-favorite-pop 0.3s ease;
}

.c-favorite__button:focus-visible {
  outline: 2px solid #03a9f4;
  outline-offset: 3px;
}

.c-favorite__button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.c-favorite__status {
  margin: 8px 0 0;
  font-size: 13px;
  color: #777;
  text-align: center;
  overflow-wrap: anywhere;
}

.c-favorite__status:empty {
  display: none;
}

.c-favorite__status[data-error="true"] {
  color: #b91c1c;
}

.c-favorite__status-link {
  margin-left: 4px;
  color: #0369a1;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.c-favorite__status-link::after {
  content: " ›";
}

.c-favorite__status-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* カード画像に重ねる丸型のアイコンボタン */
.c-favorite--compact {
  position: relative;
}

.c-favorite--compact .c-favorite__button {
  width: 40px;
  min-height: 0;
  height: 40px;
  padding: 0;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.92);
  color: #555;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.c-favorite--compact .c-favorite__button:hover {
  background: #fff;
  color: #1c1c1c;
}

.c-favorite--compact .c-favorite__button[aria-pressed="true"] {
  background: #fff;
}

.c-favorite--compact .c-favorite__label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 成功時はボタン表示で伝わるため読み上げのみ、失敗時だけ吹き出しで見せる */
.c-favorite--compact .c-favorite__status:not([data-error="true"]) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.c-favorite--compact .c-favorite__status[data-error="true"] {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  max-width: 220px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@keyframes c-favorite-pop {
  50% {
    transform: scale(1.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .c-favorite__button,
  .c-favorite__icon {
    transition: none;
  }

  .c-favorite__button[aria-pressed="true"] .c-favorite__icon {
    animation: none;
  }
}
