/*
 * SORKISTx Block — commerce/wizard-steps
 * 5-step jewellery customisation wizard modal.
 */

/* ─── Modal shell ────────────────────────────────────────────────────────────── */

.wizard-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.wizard-modal[hidden] { display: none; }

.wizard-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(12px);
}

.wizard-modal__panel {
  position: relative;
  z-index: 1;
  width: min(680px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--color-bg, #0f0f14);
  border: 1px solid rgba(196, 163, 90, 0.25);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  animation: wizard-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes wizard-in {
  from { opacity: 0; transform: scale(0.88) translateY(24px); }
}

.wizard-modal__close {
  position: absolute;
  inset-block-start: var(--space-4);
  inset-inline-end: var(--space-4);
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.wizard-modal__close:hover {
  background: rgba(196, 163, 90, 0.2);
  color: #C4A35A;
}

/* ─── Header ─────────────────────────────────────────────────────────────────── */

.wizard-modal__head {
  padding: var(--space-8) var(--space-8) var(--space-5);
  border-block-end: 1px solid var(--color-border);
}

.wizard-modal__title {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 800;
  margin-block-end: var(--space-2);
  background: linear-gradient(135deg, #e8c97a, #C4A35A, #8a6c30);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wizard-modal__subtext {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-block-end: var(--space-6);
}

/* ─── Step indicator ─────────────────────────────────────────────────────────── */

.wizard-steps-indicator {
  display: flex;
  gap: 0;
  counter-reset: steps;
}

.wizard-step-dot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  cursor: default;
}

/* Connecting line between dots */
.wizard-step-dot:not(:last-child)::after {
  content: '';
  position: absolute;
  inset-block-start: 16px;
  inset-inline-start: calc(50% + 16px);
  width: calc(100% - 32px);
  height: 1px;
  background: var(--color-border);
  transition: background 0.3s;
}

.wizard-step-dot.is-complete:not(:last-child)::after { background: #C4A35A; }

.wizard-step-dot__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
  position: relative;
  z-index: 1;
}

.wizard-step-dot.is-active .wizard-step-dot__num {
  border-color: #C4A35A;
  background: rgba(196, 163, 90, 0.15);
  color: #C4A35A;
}

.wizard-step-dot.is-complete .wizard-step-dot__num {
  border-color: #C4A35A;
  background: #C4A35A;
  color: #000;
}

.wizard-step-dot__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.wizard-step-dot.is-active .wizard-step-dot__label { color: #C4A35A; }

@media (max-width: 480px) {
  .wizard-step-dot__label { display: none; }
}

/* ─── Panel transitions ───────────────────────────────────────────────────────── */

.wizard-modal__body { overflow: hidden; position: relative; }

.wizard-panel {
  display: none;
  padding: var(--space-6) var(--space-8);
  animation: wizard-panel-in 0.3s ease both;
}

@keyframes wizard-panel-in {
  from { opacity: 0; transform: translateX(20px); }
}

.wizard-panel.is-active { display: block; }
.wizard-panel.exit-left { animation: wizard-panel-out-left 0.25s ease both; }

@keyframes wizard-panel-out-left {
  to { opacity: 0; transform: translateX(-20px); }
}

.wizard-panel__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-block-end: var(--space-2);
}

.wizard-panel__subtext {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-block-end: var(--space-5);
}

/* ─── Step 1: Materials ───────────────────────────────────────────────────────── */

.wizard-material-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
}

@media (max-width: 480px) { .wizard-material-grid { grid-template-columns: repeat(3, 1fr); } }

.wizard-material-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.wizard-material-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wizard-material-card__swatch {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid transparent;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.2);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.wizard-material-card:hover .wizard-material-card__swatch { transform: scale(1.1); }
.wizard-material-card input:checked + .wizard-material-card__swatch {
  border-color: #C4A35A;
  box-shadow: 0 4px 20px rgba(196, 163, 90, 0.4), inset 0 2px 4px rgba(255,255,255,0.2);
}

.wizard-material-card__label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-align: center;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.wizard-material-card input:checked ~ .wizard-material-card__label { color: #C4A35A; }

/* ─── Step 2: Stones ──────────────────────────────────────────────────────────── */

.wizard-stone-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
}

@media (max-width: 480px) { .wizard-stone-grid { grid-template-columns: repeat(3, 1fr); } }

.wizard-stone-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.wizard-stone-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wizard-stone-card__gem {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.wizard-stone-card:hover .wizard-stone-card__gem { transform: scale(1.08); }
.wizard-stone-card input:checked + .wizard-stone-card__gem {
  border-color: #C4A35A;
  box-shadow: 0 4px 16px rgba(196, 163, 90, 0.25);
}

.wizard-stone-card__label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-align: center;
  color: var(--color-text-muted);
}

.wizard-stone-card input:checked ~ .wizard-stone-card__label { color: #C4A35A; }

/* ─── Step 3: Style ───────────────────────────────────────────────────────────── */

.wizard-style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

@media (max-width: 480px) { .wizard-style-grid { grid-template-columns: 1fr 1fr; } }

.wizard-style-card {
  cursor: pointer;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.wizard-style-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wizard-style-card:hover { border-color: rgba(196, 163, 90, 0.5); }
.wizard-style-card:has(input:checked) {
  border-color: #C4A35A;
  background: rgba(196, 163, 90, 0.08);
}

.wizard-style-card__label {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text);
}

.wizard-style-card__desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ─── Step 4: Details ─────────────────────────────────────────────────────────── */

.wizard-budget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.wizard-budget-value {
  color: #C4A35A;
}

.wizard-budget-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(to right, #C4A35A 0%, #C4A35A 25%, var(--color-border) 25%);
  margin-block: var(--space-3);
  cursor: pointer;
}

.wizard-budget-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #C4A35A;
  border: 2px solid var(--color-bg);
  box-shadow: 0 2px 6px rgba(196, 163, 90, 0.4);
  cursor: pointer;
}

.wizard-budget-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-muted);
}

/* ─── Step 5: Contact ─────────────────────────────────────────────────────────── */

.wizard-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.wizard-contact-grid .field-label:last-child { grid-column: span 2; }

@media (max-width: 480px) {
  .wizard-contact-grid { grid-template-columns: 1fr; }
  .wizard-contact-grid .field-label:last-child { grid-column: span 1; }
}

.wizard-contact-ctas {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-block-start: var(--space-6);
}

.btn--whatsapp {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn--whatsapp:hover { background: #128C7E; border-color: #128C7E; }

.wizard-status {
  margin-block-start: var(--space-3);
  font-size: var(--font-size-sm);
  min-height: 1.4em;
}

.wizard-status.is-success { color: var(--color-success); }
.wizard-status.is-error   { color: var(--color-error);   }

/* ─── Navigation bar ─────────────────────────────────────────────────────────── */

.wizard-modal__nav {
  padding: var(--space-5) var(--space-8);
  border-block-start: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

/* ─── Field helpers ───────────────────────────────────────────────────────────── */

.field-label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.field-input {
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition: border-color var(--transition-fast);
  width: 100%;
}

.field-input:focus {
  outline: none;
  border-color: #C4A35A;
  box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.15);
}

textarea.field-input { resize: vertical; min-height: 90px; }
