/* === Product Builder styles ===
   Reset, :root tokens, html/body base are defined in site.css (loaded first).
   This file only adds product-builder-specific components.
*/

/* === Progress Bar === */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--brown);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition);
  padding: 0;
}

.progress-dot.active {
  background: var(--brown);
}

.progress-dot.completed {
  background: var(--brown-light);
}

.progress-dot:disabled {
  cursor: default;
  opacity: 0.4;
}

/* === Steps === */
.step {
  display: none;
  padding: 60px 20px 40px;
  min-height: 100vh;
  animation: fadeIn 0.4s ease;
}

.step--active {
  display: block;
}

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

.step__container {
  max-width: 520px;
  margin: 0 auto;
}

.step__headline {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--brown);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.3;
}

/* === Hero === */
.hero {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.hero__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream-dark);
  margin-bottom: 32px;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cream-dark), var(--border));
  color: var(--brown);
}

.hero__play-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.hero__content {
  padding: 0 8px;
}

.hero__headline {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--brown);
  margin-bottom: 12px;
  line-height: 1.3;
}

.hero__subheadline {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 32px;
}

/* === Hero Authority === */
.hero__authority {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 24px;
  font-style: italic;
}

/* === How It Works === */
.how-it-works {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 48px auto;
  max-width: 500px;
}

.how-it-works__step {
  text-align: center;
  flex: 1;
}

.how-it-works__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brown);
  color: var(--white);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.how-it-works__step p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.reassurance-bottom {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  padding: 0 20px 40px;
  max-width: 500px;
  margin: 0 auto;
}

/* === Buttons === */
.btn {
  display: inline-block;
  font-family: Georgia, serif;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.btn--primary {
  background: var(--brown);
  color: var(--white);
  padding: 16px 40px;
  min-height: 52px;
}

.btn--primary:hover {
  background: var(--brown-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--large {
  font-size: 1.15rem;
  padding: 18px 48px;
  min-height: 56px;
  width: 100%;
  max-width: 400px;
}

.btn--next {
  display: block;
  width: 100%;
  margin-top: 24px;
}

/* === Character Grid === */
.character-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.character-card {
  background: var(--parchment);
  border: 2px solid var(--sienna);
  box-shadow: 0 0 0 3px var(--parchment), 0 0 0 4px var(--sienna);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  overflow: hidden;
  font-family: var(--font-body);
}

.character-card:hover {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--parchment), 0 0 0 4px var(--amber), 0 8px 24px rgba(212, 149, 58, 0.18);
  transform: translateY(-2px);
}

.character-card.selected {
  border-color: var(--brown);
  background: var(--amber-soft);
  box-shadow: 0 0 0 3px var(--amber-soft), 0 0 0 4px var(--brown);
}

.character-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 160px;
  background: var(--cream-dark);
  overflow: hidden;
}

.character-card__media video,
.character-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.character-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--brown);
  background: linear-gradient(135deg, var(--cream-dark), var(--border));
}

.character-card__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--brown);
  padding: 12px 10px 4px;
}

.character-card__desc {
  font-size: 0.8rem;
  color: var(--text-light);
  padding: 0 8px 12px;
  line-height: 1.4;
}

/* === Form Fields === */
.form-field {
  margin-bottom: 20px;
  position: relative;
}

.form-field__label {
  display: block;
  font-size: 0.95rem;
  color: var(--brown);
  margin-bottom: 8px;
}

.form-field__input {
  width: 100%;
  padding: 14px 18px;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: var(--text);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
  outline: none;
}

.form-field__input:focus {
  border-color: var(--brown);
}

.form-field__input::placeholder {
  color: var(--border);
}

.form-field__counter {
  position: absolute;
  right: 12px;
  bottom: 14px;
  font-size: 0.8rem;
  color: var(--text-light);
  pointer-events: none;
}

/* === Name Preview (Video Overlay) === */
.name-preview-video {
  position: relative;
  border: 2px solid var(--sienna);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 8px;
  min-height: 200px;
  background: var(--parchment);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

.name-preview-video__bg {
  width: 100%;
  display: block;
  border-radius: 14px;
}

.name-preview-video__bg[src=""] {
  display: none;
}

.name-preview-video__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}

.name-preview-video__text {
  font-family: var(--font-hand);
  font-size: 2.6rem;
  color: #fff;
  letter-spacing: 0.02em;
  word-break: break-word;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.3);
  animation: nameReveal 0.4s ease-out;
}

/* Name-reveal GIF — position text on the blank card area */
.name-preview-video.has-name-reveal .name-preview-video__overlay {
  background: none;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  /* Default card-area positioning (teddy) — overridden per-animation via CSS vars */
  --card-top: 20%;
  --card-left: 23%;
  --card-width: 47%;
  --card-height: 36%;
}

.name-preview-video.has-name-reveal .name-preview-video__text {
  position: absolute;
  top: var(--card-top);
  left: var(--card-left);
  width: var(--card-width);
  height: var(--card-height);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--name-font-size, 2.4rem);
  color: var(--brown, #5c3d2e);
  text-shadow: none;
  text-align: center;
  line-height: 1.1;
  transform: rotate(var(--name-rotation, 0deg));
  animation: nameCardReveal 0.6s ease-out;
}

@keyframes nameCardReveal {
  0% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* No character selected fallback — show centred text on parchment */
.name-preview-video:not(.has-character) .name-preview-video__overlay {
  background: none;
  align-items: center;
  padding-bottom: 0;
}

.name-preview-video:not(.has-character) .name-preview-video__text {
  color: var(--brown);
  text-shadow: none;
}

@keyframes nameReveal {
  0% { opacity: 0; transform: translateY(8px) scale(0.95); }
  60% { opacity: 1; transform: translateY(-3px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Legacy fallback class kept for hint text */
.name-preview__text {
  font-family: var(--font-hand);
  font-size: 2.6rem;
  color: var(--brown);
  letter-spacing: 0.01em;
  word-break: break-word;
}

.name-preview__hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

/* === Suggestion Pills === */
.suggestion-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.suggestion-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--text);
  font-family: Georgia, serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.pill:hover {
  border-color: var(--brown);
  background: var(--cream);
}

.pill.active {
  background: var(--brown);
  color: var(--white);
  border-color: var(--brown);
}

/* === Reassurance Text === */
.reassurance-text {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
  font-style: italic;
  margin: 16px 0;
}

/* === Preview Video === */
.preview-video {
  margin-bottom: 28px;
}

.preview-video video,
.preview-video__gif {
  width: 100%;
  border-radius: var(--radius);
  background: var(--cream-dark);
  display: block;
}

.preview-video__placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--cream-dark), var(--border));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--brown);
}

.preview-video__note {
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* === Order Summary === */
.order-summary {
  background: var(--parchment);
  border: 2px solid var(--border);
  border-top: 3px solid var(--sienna);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}

.order-summary__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--brown);
  margin-bottom: 16px;
}

.order-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  gap: 12px;
}

.order-summary__label {
  font-size: 0.9rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.order-summary__value {
  font-size: 0.9rem;
  color: var(--text);
  text-align: right;
}

.order-summary__price {
  font-size: 1.2rem;
  color: var(--brown);
  font-weight: bold;
}

.order-summary__divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.order-summary__edit {
  display: inline-block;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--brown);
  font-family: Georgia, serif;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.order-summary__edit:hover {
  color: var(--brown-light);
}

/* === Fan Quotes (Step 3) === */
.fan-quotes {
  margin-bottom: 24px;
  text-align: center;
  min-height: 80px;
  position: relative;
}

.fan-quotes__item {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}

.fan-quotes__item--active {
  display: block;
}

.fan-quotes__item p {
  font-size: 1rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 4px;
}

.fan-quotes__item cite {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: normal;
}

/* === Reassurance Block === */
.reassurance-block {
  margin-bottom: 28px;
}

.reassurance-block p {
  font-size: 0.9rem;
  color: var(--text-light);
  text-align: center;
  padding: 6px 0;
  position: relative;
  padding-left: 24px;
}

.reassurance-block p::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--brown);
}

/* === Desktop === */
@media (min-width: 768px) {
  .character-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero__headline {
    font-size: 2.2rem;
  }

  .step__headline {
    font-size: 1.8rem;
  }

  .name-preview-video__text,
  .name-preview__text {
    font-size: 3.2rem;
  }

  .name-preview-video.has-name-reveal .name-preview-video__text {
    font-size: var(--name-font-size, 2.4rem);
  }

  .btn--large {
    width: auto;
    min-width: 320px;
  }

  .step {
    padding-top: 80px;
  }
}

/* === Center CTA === */
#step-0 {
  text-align: center;
}

#step-3 .btn--large {
  display: block;
  margin: 0 auto;
}

/* Hide video elements when no src */
video:not([src]):not(:has(source[src])) {
  display: none;
}
