:root {
  --alf-bg: #f6f4f1;
  --alf-surface: #ffffff;
  --alf-ink: #1a1a1a;
  --alf-muted: #6b6560;
  --alf-line: rgba(26, 26, 26, 0.08);
  --alf-accent: #8b5a3c;
  --alf-accent-soft: rgba(139, 90, 60, 0.12);
  --alf-shadow: 0 24px 80px rgba(26, 26, 26, 0.12);
  --alf-radius-lg: 20px;
  --alf-radius-md: 14px;
  --alf-radius-sm: 10px;
  --alf-font: "DM Sans", system-ui, -apple-system, sans-serif;
  --alf-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--alf-font);
  color: var(--alf-ink);
  background: radial-gradient(1200px 600px at 20% -10%, #ebe6df 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e8dfd6 0%, transparent 50%), var(--alf-bg);
}

.demo {
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) 1.5rem;
}

.demo__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--alf-muted);
  margin: 0 0 0.75rem;
}

.demo__title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.demo__copy {
  color: var(--alf-muted);
  line-height: 1.6;
  margin: 0 0 2rem;
  font-size: 0.95rem;
}

.alfred-launch {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(165deg, #a06f4d 0%, var(--alf-accent) 45%, #6d432c 100%);
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(139, 90, 60, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.35s var(--alf-ease), box-shadow 0.35s var(--alf-ease);
}

.alfred-launch:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(139, 90, 60, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.alfred-launch:active {
  transform: translateY(0);
}

/* PDP complete-the-look launcher.
   Injected by alfred.js on WooCommerce PDPs only (detected via the
   `single-product` body class). Reuses the .alfred-launch visual styling
   and adds floating bottom-right positioning to match the existing quiz
   launcher's location. The quiz launcher is hidden on PDPs via JS, so
   only one floating action is visible at a time. */
.alfred-launch--ctl {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 999;
}

.alfred-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 18, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--alf-ease);
  z-index: 1000;
}

.alfred-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.alfred-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100vw - 2rem));
  max-height: min(640px, calc(100vh - 2rem));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--alf-surface);
  border-radius: var(--alf-radius-lg);
  box-shadow: var(--alf-shadow);
  border: 1px solid var(--alf-line);
  transform: translate(-50%, -48%) scale(0.96);
  opacity: 0;
  transition: transform 0.45s var(--alf-ease), opacity 0.45s var(--alf-ease);
  z-index: 1001;
}

.alfred-backdrop.is-open .alfred-panel {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.alfred-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--alf-line);
}

.alfred-panel__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.alfred-panel__mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--alf-accent-soft), transparent);
  border: 1px solid var(--alf-line);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--alf-accent);
}

.alfred-panel__titles h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.alfred-panel__titles p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--alf-muted);
}

.alfred-close {
  border: none;
  background: transparent;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--alf-muted);
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s;
}

.alfred-close:hover {
  background: rgba(26, 26, 26, 0.05);
  color: var(--alf-ink);
}

.alfred-panel__body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.alfred-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 1.25rem;
}

.alfred-progress span {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: var(--alf-line);
  overflow: hidden;
}

.alfred-progress span::after {
  content: "";
  display: block;
  height: 100%;
  width: 0%;
  background: var(--alf-accent);
  border-radius: inherit;
  transition: width 0.45s var(--alf-ease);
}

.alfred-progress span.is-active::after {
  width: 100%;
}

.alfred-progress span.is-done::after {
  width: 100%;
  opacity: 0.35;
}

.alfred-step {
  animation: alfred-in 0.45s var(--alf-ease) both;
}

@keyframes alfred-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alfred-q {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  line-height: 1.3;
}

.alfred-options {
  display: grid;
  gap: 0.5rem;
}

.alfred-option {
  text-align: left;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--alf-ink);
  padding: 0.85rem 1rem;
  border-radius: var(--alf-radius-sm);
  border: 1px solid var(--alf-line);
  background: #faf9f7;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--alf-ease);
}

.alfred-option:hover {
  border-color: rgba(139, 90, 60, 0.35);
  background: #fff;
  transform: translateX(2px);
}

.alfred-option:active {
  transform: scale(0.99);
}

.alfred-results-head {
  margin-bottom: 1rem;
}

.alfred-results-head h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.alfred-results-head p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--alf-muted);
  line-height: 1.5;
}

.alfred-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.alfred-card {
  border: 1px solid var(--alf-line);
  border-radius: var(--alf-radius-md);
  overflow: hidden;
  background: #faf9f7;
  animation: alfred-in 0.5s var(--alf-ease) both;
}

.alfred-card:nth-child(2) {
  animation-delay: 0.06s;
}

.alfred-card:nth-child(3) {
  animation-delay: 0.12s;
}

/* Product image card area.
   Uses background longhand properties (NOT the `background` shorthand)
   so the inline `background-image: url(...)` set by JS for real product
   photos isn't wiped out. Gradient values are the fallback when no
   photo URL is available.
   aspect-ratio: 3/4 because fashion product shots are portrait. */
.alfred-card__img {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-color: #c4b5a0;
  background-image: linear-gradient(135deg, var(--img-a, #c4b5a0), var(--img-b, #8b7e6d));
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* Photo variant — the inline style sets background-image: url('https://...').
   Soft neutral background colour shows while the image loads.
   Lives as its own rule so photo-specific tweaks (positioning, filters,
   etc.) can be added here later without affecting the gradient fallback. */
.alfred-card__img--photo {
  background-color: #efe7dd;
}

.alfred-card__body {
  padding: 0.9rem 1rem 1rem;
}

.alfred-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.alfred-card__name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.alfred-card__price {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--alf-accent);
  white-space: nowrap;
}

.alfred-card__why {
  font-size: 0.78rem;
  color: var(--alf-muted);
  line-height: 1.45;
  margin: 0 0 0.85rem;
}

.alfred-add {
  width: 100%;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--alf-line);
  background: var(--alf-ink);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s var(--alf-ease);
}

.alfred-add:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.alfred-add:active {
  transform: translateY(0);
}

.alfred-loading-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--alf-ink);
}

.alfred-loading-sub {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: var(--alf-muted);
  line-height: 1.5;
}

.alfred-dots {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.alfred-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--alf-accent);
  opacity: 0.25;
  animation: alfred-dot 1.1s ease-in-out infinite;
}

.alfred-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.alfred-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes alfred-dot {
  0%,
  80%,
  100% {
    opacity: 0.2;
    transform: scale(1);
  }
  40% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.demo-pdp {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--alf-line);
}

.demo-pdp__label {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--alf-muted);
}

.demo-pdp__row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.demo-pdp__row > div:last-child {
  min-width: 0;
  flex: 1;
}

.demo-pdp__swatch {
  width: 3.25rem;
  height: 4rem;
  border-radius: var(--alf-radius-sm);
  border: 1px solid var(--alf-line);
  flex-shrink: 0;
  background: linear-gradient(135deg, #2f3f6b, #1e2847);
}

.demo-pdp__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--alf-ink);
  line-height: 1.45;
}

.demo-pdp__name .demo-pdp__price {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--alf-muted);
}

.alfred-suggests {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--alf-ink);
  background: #faf9f7;
  border: 1px solid var(--alf-line);
  border-radius: var(--alf-radius-sm);
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--alf-ease);
}

.alfred-suggests:hover {
  border-color: rgba(139, 90, 60, 0.35);
  background: #fff;
  transform: translateY(-1px);
}

.alfred-ctl-layer {
  z-index: 1100;
}

.alfred-outfit-note {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--alf-radius-md);
  border: 1px solid var(--alf-line);
  background: linear-gradient(145deg, var(--alf-accent-soft), transparent);
}

.alfred-outfit-note__text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--alf-ink);
}

@media (prefers-reduced-motion: reduce) {
  .alfred-launch,
  .alfred-backdrop,
  .alfred-ctl-layer,
  .alfred-panel,
  .alfred-step,
  .alfred-card,
  .alfred-option,
  .alfred-suggests,
  .alfred-add,
  .alfred-dots span {
    transition: none;
    animation: none;
  }
}