/* ============================================
   HOMOZ Wizard Workflow Styles
   ============================================ */

/* Header */
.wizard-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: var(--space-6) var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, var(--color-bg-primary) 0%, transparent 100%);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wizard-header.visible {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0);
}

.wizard-logo {
  height: 24px;
  width: auto;
  filter: var(--filter-logo);
}

.wizard-step-indicator {
  display: flex;
  gap: var(--space-3);
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border-subtle);
  transition: all var(--transition-base);
}

.step-dot.active {
  background: var(--color-accent-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Content Area */
.wizard-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 120px var(--space-6) 160px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  align-items: stretch;
}

/* Footer Nav */
.nav-wizard {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border: none;
  outline: none;
  padding: var(--space-6) var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to top, var(--color-bg-primary) 0%, transparent 100%);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.page-active .nav-wizard,
.page-entering .nav-wizard {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Step 1: Shape Selection ---- */
.shape-selector-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-12);
  align-items: center;
  min-height: calc(100vh - 280px);
}

.shape-preview-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.paddle-platform-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, var(--color-bg-subtle) 0%, transparent 65%);
}

.preview-paddle {
  position: relative;
  z-index: 5;
  width: 55%;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: paddleBob 3s ease-in-out infinite;
}

@keyframes paddleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.preview-image {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.3)) drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

/* Gold halo shadow under paddle */
.preview-platform {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 30px;
}

.platform-glow {
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
  filter: blur(10px);
  animation: platformPulse 3s ease-in-out infinite;
}

@keyframes platformPulse {
  0%, 100% { opacity: 1; transform: scaleX(1.1); }
  50% { opacity: 0.6; transform: scaleX(0.9); }
}

/* Balance point indicator */
.balance-indicator {
  position: absolute;
  left: -20%;
  right: -20%;
  top: 50%;
  z-index: 6;
  pointer-events: none;
  transition: top 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.balance-line {
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--color-rojo) 15%, var(--color-rojo) 85%, transparent 100%);
  box-shadow: 0 0 12px rgba(192, 57, 43, 0.6), 0 0 4px rgba(192, 57, 43, 0.8);
}

/* Enlarge button */
.btn-enlarge {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 18px;
  transition: all var(--transition-base);
  z-index: 10;
}

.btn-enlarge:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--color-accent-gold);
  color: var(--color-accent-gold);
}

/* Legend */
.legend-wrapper {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}

.geometry-legend {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-4) var(--space-6);
  background: var(--color-bg-faint);
  border: 1px solid var(--color-border-faint);
  border-radius: var(--radius-full);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.legend-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-sweetspot {
  background: rgba(192, 57, 43, 0.6);
}

.legend-balance {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-rojo);
  box-shadow: 0 0 6px rgba(192, 57, 43, 0.6);
}

.legend-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Shape nav arrows */
.shape-nav-controls {
  display: none !important; /* Hidden globally to clean up UI */
}

.shape-nav-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all var(--transition-base);
}

.shape-nav-arrow:hover {
  border-color: var(--color-accent-gold);
  color: var(--color-accent-gold);
  background: rgba(212, 175, 55, 0.05);
}

/* Shape stats panel (right column) */
.shape-stats-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.step-title-right {
  font-size: var(--text-2xl);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-6);
}

.shape-selection-right {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.shape-btn {
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  transition: all var(--transition-base);
}

.shape-btn:hover {
  border-color: var(--color-accent-gold);
  color: var(--color-text-primary);
}

.shape-btn.active {
  background: var(--color-accent-gold);
  border-color: var(--color-accent-gold);
  color: var(--color-bg-primary);
}

/* Shape button icons (initial state) */
.step-initial .shape-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.shape-btn-icon {
  height: 40px;
  width: auto;
  filter: var(--filter-icon);
  transition: filter var(--transition-base);
}

.shape-btn:hover .shape-btn-icon {
  filter: var(--filter-icon-hover);
}

.shape-btn.active .shape-btn-icon {
  filter: var(--filter-icon-active);
}

.step-revealed .shape-btn-icon {
  display: none;
}

/* Stats header */
.stats-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.stats-name {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-accent-gold);
}

.stats-subtitle {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-gold);
  margin-bottom: var(--space-2);
}

.stats-description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

/* Stats bars */
.stats-ratings {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.stat-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-fill-container {
  height: 6px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  width: 100%;
}

.stat-fill {
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: var(--color-accent-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stat-fill-base {
  z-index: 1;
}

.stat-fill-bonus {
  background: #2ecc71;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
  z-index: 0;
}

.stat-fill-loss {
  background: #e74c3c;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
  z-index: 0;
  opacity: 0.6;
}

.modifier {
  font-size: var(--text-xs);
  font-weight: bold;
  margin-left: var(--space-2);
}

.modifier.positive {
  color: #2ecc71;
}

.modifier.negative {
  color: #e74c3c;
}

/* Circular Gauge */
.stats-gauge {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.circular-gauge {
  position: relative;
  width: 120px;
  height: 70px;
  overflow: hidden;
}

.circular-gauge svg {
  width: 120px;
  height: 120px;
  position: absolute;
  top: 0;
  left: 0;
}

.gauge-bg-gradient {
  fill: none;
  stroke: url(#gaugeStaticGradient);
  stroke-width: 10;
  stroke-dasharray: 251.3;
  stroke-dashoffset: 0;
  transform: rotate(180deg);
  transform-origin: center;
}

.gauge-needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 3px;
  height: 45px;
  background: var(--color-accent-gold);
  border-radius: 2px;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(0deg);
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.gauge-center-dot {
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--color-accent-gold);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  width: 120px;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gauge-labels span:first-child {
  color: var(--color-azul);
}

.gauge-labels span:last-child {
  color: var(--color-rojo);
}

/* Price */
.stats-price {
  margin-top: var(--space-8);
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.price-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.price-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
}

/* Continue button */
.btn-continue-inline {
  margin-top: var(--space-6);
  width: 100%;
  padding: var(--space-4) var(--space-8);
  background: linear-gradient(135deg, var(--color-accent-gold), var(--color-accent-gold-light));
  color: var(--color-bg-primary);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.btn-continue-inline:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

/* ---- Step 2: Material Selection ---- */
.material-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-12);
  align-items: center;
  min-height: 60vh;
}

.material-preview-column {
  position: sticky;
  top: 120px;
  align-self: start;
}

.material-image-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/5;
  position: relative;
  width: 100%;
  max-width: 600px;
}

.material-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

/* Material nav arrows */
.material-nav-controls {
  display: none !important; /* Hidden globally to clean up UI */
}

.material-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.material-thumbnails-horizontal {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.material-thumbnail {
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all var(--transition-base);
}

.material-thumbnail:hover {
  border-color: var(--color-accent-gold);
  color: var(--color-text-primary);
}

.material-thumbnail.active {
  background: var(--color-accent-gold);
  border-color: var(--color-accent-gold);
  color: var(--color-bg-primary);
}

.material-name {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-accent-gold);
  margin-bottom: var(--space-4);
}

.material-description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.material-ratings {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.material-price {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.material-price.free {
  color: #2ecc71;
}

/* ---- Step 3: Finish ---- */
.finish-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-12);
  align-items: center;
  min-height: calc(100vh - 280px);
}

.finish-preview {
  align-self: center;
  width: 100%;
  max-width: 450px;
}

.finish-preview-layers {
  position: relative;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

.finish-preview-layers img {
  position: absolute;
  width: 90%;
  height: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.finish-preview-layers .layer-base {
  z-index: 1;
}

.finish-preview-layers .layer-accent {
  z-index: 2;
}

.finish-preview-layers .layer-bg {
  z-index: 0;
}

.finish-preview-layers .layer-regalo {
  z-index: 3;
}

.finish-options {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.color-section {
  margin-bottom: var(--space-8);
}

.color-section-label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-gold);
  margin-bottom: var(--space-4);
}

/* Extras */
.extras-section {
  margin-top: var(--space-4);
  margin-bottom: var(--space-8);
}

.extras-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
}

.extra-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-faint);
}

.extra-option-content {
  flex: 1;
}

.extra-option-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-1);
}

.extra-option-name {
  font-weight: 600;
  font-size: var(--text-base);
}

.extra-option-price {
  color: var(--color-accent-gold);
  font-weight: 600;
  font-size: var(--text-sm);
}

.extra-option-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.extra-info-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.extra-info-btn:hover {
  border-color: var(--color-accent-gold);
  color: var(--color-accent-gold);
}

.name-input-wrapper {
  margin-top: var(--space-3);
  display: none;
  position: relative;
}

.name-input-wrapper.visible {
  display: block;
}

.name-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}

.name-input:focus {
  outline: none;
  border-color: var(--color-accent-gold);
}

.name-count {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ---- Step 4: Checkout ---- */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr;
  gap: var(--space-12);
  align-items: start;
  align-content: center;
  min-height: calc(100vh - 280px);
}

.checkout-preview {
  align-self: start;
  margin-top: 150px;
}

.checkout-preview-image {
  width: 100%;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.checkout-preview-image .finish-preview-layers {
  width: 100%;
  max-width: 450px;
  transform: scaleX(-1);
}

/* Mercado Pago Brick styling */
#cardPaymentBrick_container {
  width: 100%;
  margin-top: var(--space-4);
}

/* Summary card */
.summary-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-faint);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
}

.summary-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-item-label {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
}

.summary-item-value {
  font-weight: 600;
  font-size: var(--text-base);
}

#summaryExtras {
  text-align: right;
}

.summary-divider {
  height: 1px;
  background: var(--color-bg-subtle);
  margin: var(--space-4) 0;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xl);
  font-weight: 700;
}

.summary-total-amount {
  color: var(--color-accent-gold);
  font-size: var(--text-2xl);
}

/* Checkout form */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.checkout-form h3 {
  font-size: var(--text-xl);
  font-weight: 700;
}

/* ---- Step Initial / Revealed State ---- */

/* === Geometry initial state === */
.step-initial .shape-selector-grid {
  grid-template-columns: 1fr;
  min-height: calc(100vh - 280px);
  align-items: center;
  justify-items: center;
}

.step-initial .shape-preview-section {
  display: none;
}

.step-initial .shape-stats-panel {
  text-align: center;
  align-items: center;
  max-width: 500px;
}

.step-initial .shape-selection-right {
  justify-content: center;
}

.step-initial .stats-header,
.step-initial .stats-description,
.step-initial .stats-ratings,
.step-initial .stats-gauge,
.step-initial .stats-price,
.step-initial .shape-stats-panel .btn-continue-inline {
  display: none;
}

/* === Material initial state === */
.step-initial .material-layout {
  grid-template-columns: 1fr;
  min-height: calc(100vh - 280px);
  align-items: center;
  justify-items: center;
}

.step-initial .material-preview-column {
  display: none;
}

.step-initial .material-details {
  text-align: center;
  align-items: center;
  max-width: 500px;
}

.step-initial .material-thumbnails-horizontal {
  justify-content: center;
  flex-wrap: nowrap;
}

/* Suave / Firme split indicators */
.material-indicator {
  display: block;
  height: 80px;
  width: auto;
  margin: 0 auto var(--space-4);
  opacity: 0.9;
  filter: brightness(0) saturate(100%) invert(68%) sepia(55%) saturate(1210%) hue-rotate(10deg) brightness(94%) contrast(92%);
}

.material-indicator-suave {
  margin-top: -20px;
  margin-bottom: var(--space-6);
  opacity: 1;
}

.step-revealed .material-indicator {
  display: none;
}

.step-initial .material-header-row,
.step-initial .material-name,
.step-initial .material-description,
.step-initial .material-ratings,
.step-initial .material-price,
.step-initial .material-nav-controls,
.step-initial .material-details .btn-continue-inline {
  display: none;
}

/* === Finish initial state === */
.step-initial .finish-layout {
  grid-template-columns: 1fr;
  min-height: calc(100vh - 280px);
  align-items: center;
  justify-items: center;
}

.step-initial .finish-preview {
  display: none;
}

.step-initial .finish-options {
  text-align: center;
  align-items: center;
  max-width: 500px;
}

.step-initial .extras-section,
.step-initial .logo-color-section,
.step-initial .finish-options .btn-continue-inline {
  display: none !important;
}

/* Finish phase 1: only base color visible, accent hidden */
.step-initial.finish-phase-1 .accent-color-section {
  display: none;
}

/* Finish phase 2: accent row revealed */
.step-initial.finish-phase-2 .accent-color-section {
  display: block;
  animation: fadeIn 0.5s ease;
}

/* === Fading transition === */
.step-fading .shape-stats-panel,
.step-fading .material-details,
.step-fading .finish-options {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* === Revealed state === */
.step-revealed .shape-selector-grid,
.step-revealed .material-layout,
.step-revealed .finish-layout {
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .shape-selector-grid,
  .material-layout,
  .finish-layout,
  .checkout-layout {
    gap: var(--space-8);
  }
}

@media (max-width: 991px) {
  .wizard-content {
    padding: 100px var(--space-4) 140px;
  }

  .shape-selector-grid,
  .material-layout,
  .finish-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .shape-preview-section,
  .material-preview-column,
  .finish-preview,
  .checkout-preview {
    position: relative;
    top: 0;
    margin-bottom: var(--space-4);
  }

  .finish-preview-layers {
    width: 100% !important;
    max-width: 270px !important;
    height: 360px !important; /* Force explicit height to prevent flex aspect-ratio collapse when all children are absolute */
    margin: 55px auto 45px !important;
  }

  .finish-options {
    align-items: center;
    text-align: center;
  }

}

/* ---- Shape & Color Picker Selection Disabling ---- */
.btn-continue-inline.disabled-red {
  background: #e74c3c !important;
  color: #fff !important;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

.btn-continue-inline.disabled-red:hover {
  transform: none !important;
  box-shadow: none !important;
}

.color-picker .color-ball.disabled-grey {
  opacity: 0.15;
  filter: grayscale(100%);
  cursor: not-allowed;
  border: 1px dashed var(--color-border-subtle);
  transform: none !important;
}

/* Layer stacking z-indexes */
.finish-preview-layers .layer-base {
  z-index: 1;
}
.finish-preview-layers .layer-texture {
  z-index: 2;
}
.finish-preview-layers .layer-accent-design,
.finish-preview-layers .layer-accent {
  z-index: 3;
}
.finish-preview-layers .layer-accent-name {
  z-index: 4;
}
.finish-preview-layers .layer-regalo {
  z-index: 5;
}

.btn-continue-inline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

/* Logo Color Toggle Switch */
.logo-color-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
  animation: fadeIn 0.4s ease;
}

.logo-color-toggle-wrapper {
  display: flex;
  align-items: center;
}

.logo-toggle-switch {
  position: relative;
  display: inline-block;
  width: 200px;
  height: 42px;
  cursor: pointer;
  user-select: none;
}

.logo-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.logo-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px;
  overflow: hidden;
}

.slider-knob {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: 94px;
  background: var(--color-accent-gold);
  border-radius: calc(var(--radius-md) - 2px);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 1;
}

.logo-toggle-switch input:checked + .logo-toggle-slider .slider-knob {
  transform: translateX(100px); /* Moves knob exactly to the right side alignment */
}

.slider-label {
  position: relative;
  width: 50%;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  z-index: 2;
  transition: color 0.3s ease;
  line-height: 36px;
}

.slider-label.label-acento {
  color: var(--color-bg-primary); /* Active by default */
}

.slider-label.label-base {
  color: var(--color-text-muted);
}
.step-fading .shape-stats-panel,
.step-fading .material-details,
.step-fading .finish-options {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* === Revealed state === */
.step-revealed .shape-selector-grid,
.step-revealed .material-layout,
.step-revealed .finish-layout {
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .shape-selector-grid,
  .material-layout,
  .finish-layout,
  .checkout-layout {
    gap: var(--space-8);
  }
}

@media (max-width: 991px) {
  .wizard-content {
    padding: 100px var(--space-4) 140px;
  }

  .shape-selector-grid,
  .material-layout,
  .finish-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .shape-preview-section,
  .material-preview-column,
  .finish-preview,
  .checkout-preview {
    position: relative;
    top: 0;
    margin-bottom: var(--space-4);
  }

  .finish-preview-layers {
    width: 100% !important;
    max-width: 270px !important;
    height: 360px !important; /* Force explicit height to prevent flex aspect-ratio collapse when all children are absolute */
    margin: 55px auto 45px !important;
  }

  .finish-options {
    align-items: center;
    text-align: center;
  }

}

/* ---- Shape & Color Picker Selection Disabling ---- */
.btn-continue-inline.disabled-red {
  background: #e74c3c !important;
  color: #fff !important;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

.btn-continue-inline.disabled-red:hover {
  transform: none !important;
  box-shadow: none !important;
}

.color-picker .color-ball.disabled-grey {
  opacity: 0.15;
  filter: grayscale(100%);
  cursor: not-allowed;
  border: 1px dashed var(--color-border-subtle);
  transform: none !important;
}

/* Layer stacking z-indexes */
.finish-preview-layers .layer-base {
  z-index: 1;
}
.finish-preview-layers .layer-texture {
  z-index: 2;
}
.finish-preview-layers .layer-accent-design,
.finish-preview-layers .layer-accent {
  z-index: 3;
}
.finish-preview-layers .layer-accent-name {
  z-index: 4;
}
.finish-preview-layers .layer-regalo {
  z-index: 5;
}

.btn-continue-inline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

/* Logo Color Toggle Switch */
.logo-color-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
  animation: fadeIn 0.4s ease;
}

.logo-color-toggle-wrapper {
  display: flex;
  align-items: center;
}

.logo-toggle-switch {
  position: relative;
  display: inline-block;
  width: 200px;
  height: 42px;
  cursor: pointer;
  user-select: none;
}

.logo-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.logo-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px;
  overflow: hidden;
}

.slider-knob {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: 94px;
  background: var(--color-accent-gold);
  border-radius: calc(var(--radius-md) - 2px);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 1;
}

.logo-toggle-switch input:checked + .logo-toggle-slider .slider-knob {
  transform: translateX(100px); /* Moves knob exactly to the right side alignment */
}

.slider-label {
  position: relative;
  width: 50%;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  z-index: 2;
  transition: color 0.3s ease;
  line-height: 36px;
}

.slider-label.label-acento {
  color: var(--color-bg-primary); /* Active by default */
}

.slider-label.label-base {
  color: var(--color-text-muted);
}

.logo-toggle-switch input:checked + .logo-toggle-slider .label-acento {
  color: var(--color-text-muted);
}

.logo-toggle-switch input:checked + .logo-toggle-slider .label-base {
  color: var(--color-bg-primary); /* Active when checked */
}

/* ==========================================================================
   Accordion Customizer (Unified Step 1-3)
   ========================================================================== */

.customizer-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-8);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center; /* Center dashboard vertically in display! */
  min-height: calc(100vh - 180px); /* Center layout cleanly in viewport */
}

.customizer-preview-column {
  position: sticky;
  top: 100px;
  height: calc(100vh - 200px); /* Center vertically in the viewport! */
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.customizer-preview-wrapper {
  display: none;
  width: 100%;
  height: 100%;
}

.customizer-preview-wrapper.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

.customizer-tabs-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
}

.customizer-tab {
  background-color: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

.customizer-tab.expanded {
  border-color: rgba(197, 160, 89, 0.45);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  background-color: rgba(255, 255, 255, 0.015);
}

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 20px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.01), transparent);
  transition: background 0.3s ease;
}

.tab-header:hover {
  background: linear-gradient(to right, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

.tab-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.tab-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-accent-gold);
  opacity: 0.85;
}

.tab-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.tab-selection {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-accent-gold);
  background-color: rgba(197, 160, 89, 0.1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-left: auto;
  margin-right: var(--space-4);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.customizer-tab:not(.expanded) .tab-selection:not(:empty) {
  opacity: 1;
  transform: scale(1);
}

.tab-chevron {
  font-size: 11px;
  color: var(--color-text-muted);
  transition: transform 0.3s ease, color 0.3s ease;
}

.customizer-tab.expanded .tab-chevron {
  transform: rotate(180deg);
  color: var(--color-accent-gold);
}

.tab-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 20px;
  transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease, padding 0.3s ease;
}

.customizer-tab.expanded .tab-content {
  max-height: 1200px;
  opacity: 1;
  padding: 0 20px 20px 20px;
}

/* Locked State */
.customizer-tab.locked {
  opacity: 0.25;
  filter: grayscale(100%);
  cursor: not-allowed;
}

.customizer-tab.locked .tab-header {
  pointer-events: none;
}

/* Center the initial states of the tabs */
#customizerStep.step-initial .customizer-layout {
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: center;
}

#customizerStep.step-initial .customizer-preview-column {
  display: none !important; /* Hide preview column completely in initial state! */
}

#customizerStep.step-initial .customizer-tabs-column {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

.customizer-preview-wrapper {
  display: none;
  width: 100%;
  height: 100%;
}

.customizer-preview-wrapper.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  animation: fadeIn 0.5s ease;
}

/* Make shape stats panels and other containers fit tabs cleanly */
.customizer-tab .shape-stats-panel,
.customizer-tab .material-details,
.customizer-tab .finish-options {
  padding: 0;
  max-width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* Stretch children (like ratings) to full available tab width */
}

.customizer-tab .shape-stats-panel .step-title-right,
.customizer-tab .material-details .step-title-right,
.customizer-tab .finish-options .step-title-right {
  display: none; /* Hide titles inside active tab content because header has it! */
}

/* Hide Option Cards / Thumbnails in Revealed States */
.step-revealed .shape-selection-right {
  display: none !important;
}

.step-revealed .material-thumbnails-horizontal,
.step-revealed .material-indicator {
  display: none !important;
}

/* Full Width Stretched Gauges */
.stats-ratings,
.material-ratings {
  width: 100% !important;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: stretch !important;
}

.stat-bar {
  width: 100% !important;
  display: flex;
  flex-direction: column;
  align-items: stretch !important;
}

.stat-fill-container {
  width: 100% !important;
}

/* Center Circular Dial Needle Gauge */
.stats-gauge {
  width: 100% !important;
  display: flex;
  flex-direction: column;
  align-items: center !important;
  justify-content: center !important;
  margin-top: var(--space-6);
  margin-bottom: var(--space-4);
}

.gauge-labels {
  justify-content: space-between;
  width: 120px;
}

/* Sleek Premium Inline Navigation Arrows & Alignment */
.selection-arrow-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 0.5rem; /* Halved padding/gap between tab header and selection name */
  margin-bottom: 1.75rem; /* Added the saved space below the arrows instead */
  gap: var(--space-2);
}

.selection-arrow-nav .material-name,
.selection-arrow-nav .stats-name {
  margin-bottom: 0 !important;
}

.inline-arrows-container {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: 0; /* Align with the heading */
}

/* Prevent Color Selection Options from wrapping into second line and spread evenly */
.customizer-tab .color-ball {
  width: 58px !important;
  height: 58px !important;
}

.customizer-tab .color-ball:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.35) !important; /* Elegant subtle grey ring on hover */
}

.customizer-tab .color-picker {
  width: 100% !important;
  display: flex !important;
  justify-content: space-evenly !important; /* Center and spread out equally so it looks intentional */
  flex-wrap: nowrap !important; /* strictly prevent wrapping to a second line */
  gap: 0 !important; /* space-evenly handles spacing perfectly */
}

.nav-arrow-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 57px; /* 50% larger (38px * 1.5) */
  height: 45px; /* 50% larger (30px * 1.5) */
  border-radius: 8px; /* Proportionally scaled rounded corners */
  border: 1.5px solid var(--color-border-subtle); /* Thicker border to match larger size */
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
  font-size: var(--text-xl); /* Larger font to match larger size */
  font-weight: bold;
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
  line-height: 1;
  padding-bottom: 3px; /* optical vertical alignment */
}

/* Wrap hover styling in media query to prevent sticky hover on touch devices */
@media (hover: hover) {
  .nav-arrow-inline:hover {
    background: var(--color-accent-gold);
    border-color: var(--color-accent-gold);
    color: var(--color-bg-primary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    transform: scale(1.08);
  }
}

/* Touch active state works perfectly on mobile without sticking */
.nav-arrow-inline:active {
  background: var(--color-accent-gold);
  border-color: var(--color-accent-gold);
  color: var(--color-bg-primary);
  transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 1100px) {
  .customizer-layout {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .customizer-preview-column {
    position: relative;
    top: 0;
    min-height: auto;
    height: auto;
    margin-bottom: var(--space-2);
  }
}

/* Mobile responsive selector button stacking */
@media (max-width: 768px) {
  /* Eliminate scrolling on mobile for initial states of tabs 1, 2, and 3 */
  .step-initial .wizard-content {
    padding-top: 80px !important;
    padding-bottom: 20px !important;
    justify-content: center !important;
  }

  .step-initial .customizer-layout {
    min-height: auto !important;
    height: auto !important;
  }

  .step-initial .shape-selection-right {
    flex-direction: column !important;
    width: 100% !important;
    align-items: stretch !important;
    gap: var(--space-3) !important;
    margin-bottom: var(--space-4) !important;
  }
  .step-initial .shape-btn {
    width: 100% !important;
    text-align: center !important;
  }
  
  .step-initial .material-details {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: var(--space-4) !important;
    width: 100% !important;
    min-height: 400px !important; /* Force enclosure height to accommodate the 380px tall flanking indicators and enlarged buttons stack */
  }

  .step-initial .material-thumbnails-horizontal {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    max-width: 240px !important;
    width: 100% !important;
    align-items: stretch !important;
    gap: var(--space-4) !important; /* Larger gap for taller mobile stack */
    margin-bottom: 0 !important;
    order: 2 !important;
  }
  .step-initial .material-thumbnail {
    width: 100% !important;
    text-align: center !important;
    padding: 24px var(--space-6) !important; /* Twice as big vertically for extreme premium touch target */
    font-size: 1.15rem !important; /* Enlarged high-visibility mobile font */
    font-weight: 600 !important;
  }

  .step-initial .material-indicator {
    transform: rotate(90deg) !important; /* Rotate by 90 degrees to make the horizontal graphics vertical */
    width: 380px !important; /* Serves as the vertical height in rotated state */
    height: 68px !important; /* Serves as the horizontal thickness in rotated state */
    margin: 0 -156px !important; /* Shrink horizontal layout footprint to ~68px to eliminate overlap */
    opacity: 0.9 !important;
    filter: brightness(0) saturate(100%) invert(68%) sepia(55%) saturate(1210%) hue-rotate(10deg) brightness(94%) contrast(92%) !important;
    flex-shrink: 0 !important;
  }

  .step-initial .material-indicator-suave {
    order: 1 !important; /* Place Suave on the left */
  }

  .step-initial .material-indicator-firme {
    order: 3 !important; /* Place Firme on the right */
  }

  /* Move condensed past tabs above the preview image, and active expanded tab below it on mobile (only in detailed/expanded states) */
  #customizerStep:not(.step-initial) .customizer-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--space-4) !important;
  }

  #customizerStep:not(.step-initial) .customizer-tabs-column {
    display: contents !important; /* Promotes tabs to direct children of customizer-layout */
  }

  .customizer-tab:not(.expanded) {
    order: 1 !important; /* Place condensed past tabs at the very top */
  }

  .customizer-preview-column {
    order: 2 !important; /* Place preview image column in the middle */
  }

  .customizer-tab.expanded {
    order: 3 !important; /* Place expanded tab content at the bottom */
  }

  /* Position selection arrows next to selection name on mobile */
  .selection-arrow-nav {
    flex-direction: row !important;
    align-items: center !important;
    gap: var(--space-4) !important;
    justify-content: flex-start !important;
    margin-bottom: 1.5rem !important;
  }

  /* Hide redundant preview column navigation arrows below the image on mobile */
  .shape-nav-controls,
  .material-nav-controls {
    display: none !important;
  }

  /* Explicit sizing on mobile to prevent flex aspect-ratio collapse when all children are absolute */
  .finish-preview-layers {
    width: 100% !important;
    max-width: 270px !important;
    height: 360px !important; 
    margin: 55px auto 45px !important;
  }

  .checkout-preview {
    margin-top: 0 !important;
  }

  .checkout-preview-image {
    padding-top: 50px !important;
    padding-bottom: 50px !important;
  }

  .checkout-preview-image .finish-preview-layers {
    width: 100% !important;
    max-width: 270px !important;
    height: 360px !important;
    margin: 0 auto !important;
  }
}

