/* Result: skin profile on the black panel, then the products (each with Buy Now), then Save and Start again. */

.result-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  min-height: 56svh;
  padding: calc(var(--safe-top) + 20px) var(--gutter) 36px;
  background: var(--color-brand);
  color: var(--color-on-brand);
}

.result-hero-top .logo { width: min(210px, 56vw); }

.result-kicker {
  margin-bottom: 12px;
  font: 600 var(--step--2) / 1.4 var(--font-text);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-on-brand);
  opacity: 0.75;
}

.profile { list-style: none; padding: 0; }

.profile-item {
  padding: 14px 0 16px;
  border-top: 1px solid rgb(255 255 255 / 0.22);
}

.profile-label {
  display: block;
  font: var(--display-weight) clamp(2.25rem, 11vw, 3rem) / 1.08 var(--font-display);
  letter-spacing: -0.01em;
}

.profile-text {
  display: block;
  margin-top: 6px;
  max-width: 36ch;
  font-size: var(--step--1);
  opacity: 0.82;
}

.profile-empty {
  font: var(--display-weight) var(--step-4) / 1.12 var(--font-display);
  max-width: 16ch;
}

/* Products */
.result-main {
  padding: 44px var(--gutter) calc(var(--safe-bottom) + 40px);
}

/* Section titles: uppercase Montserrat, as on the brand website */
.result-heading {
  font: 300 var(--step-3) / 1.2 var(--font-text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-note {
  margin-top: 10px;
  color: var(--color-ink-soft);
  max-width: 40ch;
}

.product-list {
  list-style: none;
  display: grid;
  gap: 56px;
  margin-top: 28px;
  padding: 0;
}

/* Every photo is a cut-out, straight on the backdrop and never blended, so products keep their true colours */
.product-figure {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 0.9;
  margin: 0 calc(var(--gutter) * -1);
  background: var(--color-backdrop);
  border-radius: var(--radius-panel);
  overflow: hidden;
}

.product-figure img {
  width: 82%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.product-body { padding-top: 24px; }

/* The step: a small pink-red label above the name, clearly unlike it */
.product-step {
  margin-bottom: 10px;
  font: 600 var(--step--2) / 1 var(--font-text);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.product-name {
  font: var(--heading-weight) clamp(1.75rem, 7.6vw, 2rem) / 1.15 var(--font-display);
  letter-spacing: -0.005em;
}

.product-line {
  margin-top: 8px;
  font: 500 var(--step--2) / 1.3 var(--font-text);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

.product-summary {
  margin-top: 16px;
  font-size: var(--step-0);
  max-width: 40ch;
}

.product-detail {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-line);
}

.product-detail h4 {
  margin-bottom: 8px;
  font: 600 var(--step--2) / 1.3 var(--font-text);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
}

.product-detail p,
.product-reasons {
  font-size: var(--step--1);
  color: var(--color-ink);
  line-height: 1.65;
  max-width: 44ch;
}

/* Format v1.1 warning, e.g. NPRA's required sunscreen line */
.product-warning {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--color-backdrop);
  border-left: 3px solid var(--color-accent);
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--color-ink);
}

/* Buy Now (format v1.2): a small outlined button; the stores panel slides down under it */
.product-buy { margin-top: 24px; }
.buy-toggle .icon { transition: transform 0.3s var(--ease-out); }
.buy-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }

.buy-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease-out);
}

.buy-panel.is-open { grid-template-rows: 1fr; }
.buy-panel-inner { min-height: 0; overflow: hidden; }

/*
  One even 1 px line between all four stores and round them: the list draws the top and left
  lines, each store its right and bottom. Borders always land on whole device pixels; the 1 px
  gaps used before could blur away at some widths.
*/
.buy-stores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--color-line);
  border-left: 1px solid var(--color-line);
}

.buy-stores > li {
  border-right: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}

/* White cells: the stores' own logo files (Shopee's has a white background) show as they are */
.buy-store {
  position: relative;
  display: grid;
  place-items: center;
  height: 76px;
  padding: 14px 18px;
  background: var(--color-cell);
  touch-action: manipulation;
}

a.buy-store:active .buy-logo,
a.buy-store:active .buy-name { opacity: 0.55; }
.buy-logo { width: auto; max-width: 100%; height: 26px; object-fit: contain; }
.buy-name { font: 600 var(--step--1) / 1 var(--font-text); color: var(--color-heading); }

/* No link yet: greyed out, with a small "coming soon", and nothing to tap */
.buy-store.is-soon { padding-bottom: 26px; }
.buy-store.is-soon .buy-logo,
.buy-store.is-soon .buy-name { filter: grayscale(1); opacity: 0.38; }

.buy-soon {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  font: 500 10px / 1 var(--font-text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .buy-panel, .buy-toggle .icon { transition: none; }
}

/* Add-on extras (eye care, masks) sit after the routine */
.result-extras { margin-top: 72px; }

/* Placeholder for content the brand kit marks as MISSING (review mode only) */
.product .is-missing {
  display: inline-block;
  padding: 6px 10px;
  border: 1.5px dashed var(--color-accent);
  color: var(--color-ink);
  font-weight: 600;
}

.product-reasons { padding-left: 1.1em; }
.product-reasons li + li { margin-top: 4px; }
.product-reasons li::marker { color: var(--color-accent); }

/* Actions */
.result-actions {
  display: grid;
  gap: 12px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--color-line);
}

.save-status {
  min-height: 1.5em;
  font-size: var(--step--1);
  color: var(--color-ink-soft);
}

.save-status:empty { min-height: 0; }
.result-actions .fine-print { margin-top: 12px; }

/* Desktop: profile panel stays on the left while the products scroll on the right */
@media (min-width: 900px) {
  .screen-result {
    display: grid;
    grid-template-columns: minmax(380px, 0.9fr) 1fr;
    align-items: start;
  }

  .result-hero {
    position: sticky;
    top: 0;
    min-height: 100svh;
    padding: calc(var(--safe-top) + 40px) 56px calc(var(--safe-bottom) + 56px) max(56px, var(--safe-left));
  }

  .profile-label { font-size: var(--step-6); }
  .product-figure { margin: 0; }
  .result-hero-top .logo { width: 240px; }

  .result-main {
    max-width: 640px;
    padding: 72px max(64px, var(--safe-right)) calc(var(--safe-bottom) + 64px) 64px;
  }

  .result-actions .button { width: auto; justify-self: start; min-width: 240px; }
}
