:root {
  --product-font: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --product-ink: #171a20;
  --product-muted: #767676;
  --product-line: #e5e5e5;
  --product-soft: #f4f4f4;
  --product-green: #16a34a;
  --product-green-hover: #15803d;
  --artisan-red: #c8102e;
  --artisan-dark: #171a20;
  --line: #e5e5e5;
  --muted: #61646b;
}

* {
  box-sizing: border-box;
}

html {
  background: #fafafa;
  color: var(--product-ink);
  font-family: var(--product-font);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: #fafafa;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.product-page {
  min-height: 100vh;
  background: #fafafa;
}

.product-main {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 100px 0 48px;
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  gap: clamp(48px, 6vw, 64px);
  align-items: start;
}

.product-media {
  min-width: 0;
}

.product-hero-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--product-soft);
}

.product-hero-image img,
.product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.product-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 6px;
  background: var(--product-soft);
  padding: 0;
  transition: border-color 160ms ease;
}

.product-thumb:hover {
  border-color: var(--product-line);
}

.product-thumb.is-active {
  border-color: var(--product-ink);
}

.product-thumb.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.product-info {
  min-width: 0;
}

.product-title-block {
  margin-bottom: 24px;
}

.product-title-block h1 {
  margin: 0;
  color: var(--product-ink);
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.product-title-block h1 span {
  color: var(--product-muted);
  font-weight: 400;
}

.product-title-block p {
  margin: 10px 0 0;
  color: var(--product-muted);
  font-size: 14px;
  line-height: 1.7;
}

.product-title-block .product-sku {
  margin-top: 8px;
  font-size: 12px;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--product-line);
  margin-bottom: 24px;
  min-height: 88px;
  padding-bottom: 24px;
}

.product-price-row strong {
  font-size: 28px;
  font-weight: 700;
}

.product-price-row span {
  color: var(--product-muted);
  font-size: 14px;
  min-width: 13em;
}

.product-option {
  margin-bottom: 24px;
}

.product-option-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  min-height: 18px;
}

.product-option-head h2,
.product-quantity-block h2,
.product-specs h2 {
  margin: 0;
  color: var(--product-ink);
  font-size: 14px;
  font-weight: 700;
}

.product-option-head span {
  color: var(--product-muted);
  font-size: 12px;
  text-align: right;
}

.product-choice-grid {
  display: grid;
  gap: 8px;
  max-width: 260px;
}

.product-choice-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.product-choice-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.product-choice-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.product-choice {
  min-height: 44px;
  border: 1px solid var(--product-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--product-ink);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.product-choice:hover {
  border-color: var(--product-muted);
}

.product-choice:disabled,
.product-choice.is-disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.product-choice.is-active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.product-color-row {
  display: flex;
  gap: 12px;
}

.product-color {
  width: 40px;
  height: 40px;
  border: 2px solid var(--product-line);
  border-radius: 50%;
  background: var(--swatch);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.product-color:hover {
  border-color: var(--product-muted);
}

.product-color:disabled,
.product-color.is-disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.product-color.is-active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #2563eb;
  transform: scale(0.94);
}

.product-quantity-block {
  border-bottom: 1px solid var(--product-line);
  margin-bottom: 24px;
  padding-bottom: 24px;
}

.product-quantity-block h2 {
  margin-bottom: 12px;
}

.product-quantity {
  display: inline-grid;
  grid-template-columns: 40px 56px 40px;
  gap: 4px;
}

.product-quantity button,
.product-quantity input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--product-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--product-ink);
  text-align: center;
}

.product-quantity button:hover {
  background: var(--product-soft);
}

.product-quantity button:disabled,
.product-quantity input:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.product-quantity input {
  font-weight: 700;
}

.product-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.product-stock span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--product-green);
}

.product-stock strong {
  font-size: 14px;
  font-weight: 500;
}

.product-add-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border-radius: 6px;
  background: var(--product-green);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background 160ms ease, opacity 160ms ease;
}

.product-add-button:hover {
  background: var(--product-green-hover);
}

.product-add-button.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.product-add-button.is-disabled {
  cursor: not-allowed;
  opacity: 0.42;
  pointer-events: none;
}

.product-notes {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  color: var(--product-muted);
  font-size: 12px;
  line-height: 1.5;
  list-style: none;
}

.product-notes li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--product-green);
}

.product-shipping-note {
  border-radius: 6px;
  background: var(--product-soft);
  margin-top: 24px;
  padding: 16px;
}

.product-shipping-note p {
  margin: 0;
  color: var(--product-muted);
  font-size: 12px;
  line-height: 1.7;
}

.product-specs {
  margin-top: 32px;
}

.product-specs h2 {
  margin-bottom: 16px;
}

.product-spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.product-spec-grid div {
  border-top: 1px solid var(--product-line);
  padding: 16px 4px 0;
  text-align: center;
}

.product-spec-grid span {
  display: block;
  color: var(--product-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.product-spec-grid strong {
  color: var(--product-ink);
  font-size: 14px;
  font-weight: 600;
}

.product-review-sources {
  margin-top: 64px;
  border-top: 1px solid var(--product-line);
  padding-top: 32px;
}

.product-review-sources-head {
  max-width: 760px;
}

.product-review-sources h2 {
  margin: 0;
  color: var(--product-ink);
  font-size: 24px;
  line-height: 1.25;
}

.product-review-sources-head p {
  margin: 10px 0 0;
  color: var(--product-muted);
  font-size: 14px;
  line-height: 1.8;
}

.product-review-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.product-review-source-card {
  display: grid;
  gap: 8px;
  min-height: 220px;
  border: 1px solid var(--product-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.product-review-source-card:hover {
  border-color: #c9c9c9;
}

.product-review-source-type {
  width: fit-content;
  border: 1px solid var(--product-line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--artisan-red);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.product-review-source-card strong {
  color: var(--product-ink);
  font-size: 16px;
  line-height: 1.35;
}

.product-review-source-meta,
.product-review-source-rating,
.product-review-source-note {
  color: var(--product-muted);
  font-size: 12px;
  line-height: 1.55;
}

.product-review-source-rating {
  color: var(--product-ink);
  font-weight: 700;
}

.product-review-source-link {
  align-self: end;
  color: var(--artisan-red);
  font-size: 13px;
  font-weight: 800;
}

.product-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  border-radius: 6px;
  background: var(--product-ink);
  color: #ffffff;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.product-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.share-button.twitter {
  background: #111111;
}

.artisan-pick-panel {
  bottom: 72px;
}

.floating-checkout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  background: #c8102e;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(200, 16, 46, 0.24), 0 18px 50px rgba(200, 16, 46, 0.3);
}

.floating-checkout-button:hover {
  background: #a00d25;
}

@media (max-width: 980px) {
  .product-layout {
    grid-template-columns: 1fr;
  }

  .product-info {
    max-width: 680px;
  }
}

@media (max-width: 720px) {
  .product-main {
    width: min(100% - 32px, 560px);
    padding-top: 84px;
    padding-bottom: 128px;
  }

  .product-thumbs {
    gap: 8px;
  }

  .product-title-block h1 {
    font-size: 26px;
  }

  .product-choice-grid-4,
  .product-choice-grid-5,
  .product-choice-grid-3,
  .product-spec-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-review-source-grid {
    grid-template-columns: 1fr;
  }

  .product-choice-grid {
    max-width: none;
  }
}
