/* tastemaker · page: product detail · macrostructure: Editorial product stage · mood: performance editorial · contrast: pass (matrix) · critique: ShowTell 5 · Phil 4 · Hier 5 · Spec 5 · Restr 4 · Var 4 */

body[data-page="product"] {
  --product-surface: #1b1c17;
  --product-surface-deep: #0f100d;
  --product-surface-soft: #20221b;
  --product-copy: #cbd0bd;
  --product-copy-muted: #9da38e;
  --product-border: rgba(234, 255, 0, 0.24);
  --product-shadow: rgba(0, 0, 0, 0.36);
  --product-danger: #ff9b87;
  color-scheme: dark;
}

body[data-page="product"] .product-page {
  grid-template-columns: minmax(0, 1.02fr) minmax(380px, 0.98fr);
  column-gap: clamp(32px, 5vw, 64px);
  row-gap: 48px;
  align-items: start;
  padding-top: calc(var(--header) + 24px);
  padding-bottom: 96px;
}

body[data-page="product"] .product-breadcrumbs {
  min-width: 0;
  min-height: 32px;
  gap: 8px;
  color: var(--product-copy-muted);
  font-size: 0.75rem;
}

body[data-page="product"] .product-breadcrumbs a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  color: var(--product-copy);
}

body[data-page="product"] .product-breadcrumbs a:hover {
  color: var(--gold);
}

body[data-page="product"] .product-breadcrumbs span[aria-current="page"] {
  min-width: 0;
  overflow: hidden;
  color: var(--ivory);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="product"] .product-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  align-self: start;
  animation: product-enter 280ms var(--ease) both;
}

body[data-page="product"] .product-image-frame {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--product-border);
  border-radius: 16px;
  background: var(--product-surface-deep);
  box-shadow: 0 28px 72px var(--product-shadow);
}

body[data-page="product"] .product-image-frame::before {
  content: attr(data-category);
  position: absolute;
  z-index: -1;
  right: -16px;
  bottom: 8px;
  max-width: 110%;
  overflow: hidden;
  color: rgba(234, 255, 0, 0.07);
  font-family: var(--display);
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.86;
  letter-spacing: -0.04em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-page="product"] .product-stage-category,
body[data-page="product"] .product-category-link {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body[data-page="product"] .product-stage-category {
  position: absolute;
  z-index: 2;
  top: 24px;
  left: 24px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--product-border);
  border-radius: 999px;
  background: var(--product-surface);
}

body[data-page="product"] .product-stage img {
  position: relative;
  z-index: 1;
  width: 82%;
  height: 82%;
  max-height: none;
  object-fit: contain;
  filter: drop-shadow(0 28px 32px var(--product-shadow));
  transition: transform 240ms var(--ease);
}

body[data-page="product"] .product-purchase {
  min-width: 0;
  padding: 32px;
  border: 1px solid var(--product-border);
  border-radius: 16px;
  background: var(--product-surface);
  box-shadow: 0 28px 72px var(--product-shadow);
  animation: product-enter 280ms 60ms var(--ease) both;
}

body[data-page="product"] .product-category-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
}

body[data-page="product"] .product-purchase h1 {
  max-width: 16ch;
  margin: 0 0 16px;
  font-size: clamp(2.25rem, 4.4vw, 3.75rem);
  line-height: 1;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

body[data-page="product"] .product-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--product-border);
}

body[data-page="product"] .product-detail-price {
  color: var(--gold);
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-variant-numeric: tabular-nums;
}

body[data-page="product"] .product-availability {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--product-border);
  border-radius: 999px;
  color: var(--product-copy);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

body[data-page="product"] .product-availability i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--product-copy-muted);
}

body[data-page="product"] .product-availability.is-available {
  color: var(--gold);
}

body[data-page="product"] .product-availability.is-available i {
  background: var(--gold);
}

body[data-page="product"] .product-availability.is-unavailable {
  color: var(--product-danger);
  border-color: currentColor;
}

body[data-page="product"] .product-availability.is-unavailable i {
  background: currentColor;
}

body[data-page="product"] .product-summary {
  max-width: 60ch;
  margin: 20px 0 0;
  color: var(--product-copy);
  font-size: 0.875rem;
  line-height: 1.5rem;
  text-wrap: pretty;
}

body[data-page="product"] .product-option-table {
  gap: 20px;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--product-border);
  border-radius: 12px;
  background: var(--product-surface-deep);
}

body[data-page="product"] .product-option-field {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

body[data-page="product"] .product-option-heading {
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

body[data-page="product"] .product-option-heading > span {
  color: var(--ivory);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body[data-page="product"] .product-option-heading small {
  color: var(--product-copy-muted);
  font-size: 0.75rem;
}

body[data-page="product"] .product-option-choices {
  gap: 8px;
}

body[data-page="product"] .product-option-choices button {
  min-height: 44px;
  padding: 8px 12px;
  border-color: var(--product-border);
  border-radius: 12px;
  background: var(--product-surface-soft);
  font-size: 0.875rem;
  transition: color 140ms var(--ease), background-color 140ms var(--ease), border-color 140ms var(--ease), transform 120ms var(--ease);
}

body[data-page="product"] .product-option-choices button.is-selected {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

body[data-page="product"] .product-option-choices button:active,
body[data-page="product"] .product-buy-row .btn:active {
  transform: scale(0.98);
}

body[data-page="product"] .product-option-choices button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

body[data-page="product"] .product-clear-options {
  min-height: 32px;
  justify-self: end;
  padding: 0 4px;
  color: var(--gold);
  font-size: 0.75rem;
}

body[data-page="product"] .product-selection-feedback {
  min-height: 24px;
  margin-top: 12px;
}

body[data-page="product"] .product-selection-status {
  color: var(--product-copy-muted);
  font-size: 0.75rem;
  line-height: 1rem;
}

body[data-page="product"] .product-buy-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

body[data-page="product"] .product-detail-qty {
  min-height: 52px;
  overflow: hidden;
  border-color: var(--product-border);
  border-radius: 12px;
  background: var(--product-surface-deep);
}

body[data-page="product"] .product-detail-qty button {
  width: 44px;
  height: 50px;
  color: var(--ivory);
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}

body[data-page="product"] .product-detail-qty span {
  min-width: 32px;
  font-variant-numeric: tabular-nums;
}

body[data-page="product"] .product-buy-row .btn {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  transition: filter 140ms var(--ease), transform 120ms var(--ease);
}

body[data-page="product"] .product-assurance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--product-border);
  border-radius: 12px;
  list-style: none;
}

body[data-page="product"] .product-assurance li {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--product-border);
}

body[data-page="product"] .product-assurance li:last-child {
  border-right: 0;
}

body[data-page="product"] .product-assurance strong,
body[data-page="product"] .product-assurance span,
body[data-page="product"] .product-assurance a {
  display: block;
}

body[data-page="product"] .product-assurance strong {
  color: var(--ivory);
  font-size: 0.75rem;
}

body[data-page="product"] .product-assurance span,
body[data-page="product"] .product-assurance a {
  margin-top: 4px;
  color: var(--product-copy-muted);
  font-size: 0.75rem;
  line-height: 1rem;
  text-wrap: pretty;
}

body[data-page="product"] .product-assurance a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body[data-page="product"] .product-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top-color: var(--product-border);
}

body[data-page="product"] .product-meta div {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
}

body[data-page="product"] .product-meta dt {
  color: var(--product-copy-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

body[data-page="product"] .product-meta dd {
  min-width: 0;
  color: var(--product-copy);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

body[data-page="product"] .product-description,
body[data-page="product"] .product-related {
  border-top-color: var(--product-border);
}

body[data-page="product"] .product-description {
  grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
  gap: clamp(32px, 7vw, 96px);
  padding-top: 64px;
}

body[data-page="product"] .product-description-heading span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body[data-page="product"] .product-description h2,
body[data-page="product"] .product-related h2 {
  font-size: clamp(2.25rem, 4vw, 3rem);
  line-height: 1;
  text-wrap: balance;
}

body[data-page="product"] .product-description-copy {
  max-width: 68ch;
  color: var(--product-copy);
  font-size: 1rem;
  line-height: 1.75rem;
}

body[data-page="product"] .product-description-copy > p:first-child {
  color: var(--ivory);
  font-size: 1.125rem;
  line-height: 1.75rem;
}

body[data-page="product"] .product-description-copy p {
  margin-bottom: 24px;
  text-wrap: pretty;
}

body[data-page="product"] .product-directions {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--product-border);
  border-radius: 12px;
  background: var(--product-surface);
}

body[data-page="product"] .product-directions > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
}

body[data-page="product"] .product-directions h3 {
  margin: 0 0 8px;
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

body[data-page="product"] .product-directions p {
  margin: 0;
  color: var(--product-copy);
}

body[data-page="product"] .product-related {
  margin-top: 16px;
  padding-top: 64px;
}

body[data-page="product"] .product-related-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

body[data-page="product"] .product-related-head > a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--gold);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

body[data-page="product"] .product-related .product-grid {
  max-width: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

body[data-page="product"] .product-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
}

body[data-page="product"] .product-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes product-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) and (pointer: fine) {
  body[data-page="product"] .product-image-frame:hover img {
    transform: scale(1.025);
  }

  body[data-page="product"] .product-option-choices button:not(:disabled):hover,
  body[data-page="product"] .product-detail-qty button:hover {
    background: var(--gold);
    color: var(--ink);
  }
}

@media (max-width: 980px) {
  body[data-page="product"] .product-page {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: calc(var(--header) + 16px);
    padding-bottom: 64px;
  }

  body[data-page="product"] .product-image-frame {
    aspect-ratio: 4 / 3;
  }

  body[data-page="product"] .product-stage img {
    width: 76%;
    height: 76%;
  }

  body[data-page="product"] .product-purchase {
    padding: 24px;
  }

  body[data-page="product"] .product-description {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

@media (max-width: 700px) {
  body[data-page="product"] .product-breadcrumbs span[aria-current="page"],
  body[data-page="product"] .product-breadcrumbs span:last-of-type {
    display: none;
  }

  body[data-page="product"] .product-breadcrumbs a {
    min-height: 44px;
  }

  body[data-page="product"] .product-image-frame {
    aspect-ratio: 1 / 1;
  }

  body[data-page="product"] .product-purchase {
    padding: 20px;
  }

  body[data-page="product"] .product-purchase h1 {
    font-size: 2.5rem;
  }

  body[data-page="product"] .product-option-table {
    padding: 16px;
  }

  body[data-page="product"] .product-option-field {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  body[data-page="product"] .product-option-heading {
    min-height: 0;
  }

  body[data-page="product"] .product-option-heading small {
    display: none;
  }

  body[data-page="product"] .product-buy-row {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  body[data-page="product"] .product-detail-qty button {
    width: 44px;
  }

  body[data-page="product"] .product-assurance {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="product"] .product-assurance li {
    display: grid;
    grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--product-border);
  }

  body[data-page="product"] .product-assurance li:last-child {
    border-bottom: 0;
  }

  body[data-page="product"] .product-assurance span,
  body[data-page="product"] .product-assurance a {
    margin-top: 0;
  }

  body[data-page="product"] .product-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="product"] .product-description,
  body[data-page="product"] .product-related {
    padding-top: 48px;
  }

  body[data-page="product"] .product-related-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  body[data-page="product"] .product-related .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  body[data-page="product"] .product-page {
    width: min(calc(100% - 24px), 1240px);
  }

  body[data-page="product"] .product-stage-category {
    top: 16px;
    left: 16px;
  }

  body[data-page="product"] .product-purchase h1 {
    font-size: 2.25rem;
  }

  body[data-page="product"] .product-buy-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="product"] .product-detail-qty {
    width: 100%;
    justify-content: space-between;
  }

  body[data-page="product"] .product-detail-qty span {
    flex: 1;
  }

  body[data-page="product"] .product-directions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="product"] .product-stage,
  body[data-page="product"] .product-purchase {
    animation: none;
  }

  body[data-page="product"] .product-reveal {
    opacity: 1;
    transform: none;
    transition: opacity 120ms linear;
  }

  body[data-page="product"] .product-stage img,
  body[data-page="product"] .product-option-choices button,
  body[data-page="product"] .product-detail-qty button,
  body[data-page="product"] .product-buy-row .btn {
    transition-duration: 0ms;
  }
}
