/* match.css */
#step-match {
  background: var(--color-negro);
  overflow: hidden;
}

/* ── Quiz container ── */
.match__quiz {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
}

/* Internal progress bar (5 quiz steps, separate from global nav) */
.match__progress {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-6) var(--space-4);
}

.match__prog-seg {
  flex: 1;
  height: 2px;
  background: rgba(200, 184, 154, 0.2);
  transition: background var(--transition-fast);
}

.match__prog-seg.is-done,
.match__prog-seg.is-current {
  background: var(--color-oro);
}

/* ── Single question ── */
.match__question {
  display: none;
  flex-direction: column;
  flex: 1;
  position: relative;
  overflow: hidden;
  animation: fadeUp 350ms ease forwards;
}

.match__question.is-active {
  display: flex;
}

/* Background image per question — changes on option select */
.match__q-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  opacity: 0;
  transition: opacity 400ms ease;
  background: var(--color-negro);
}

.match__q-bg.is-visible {
  opacity: 1;
}

.match__q-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(13, 13, 11, 0.9)  0%,
    rgba(13, 13, 11, 0.5)  50%,
    rgba(13, 13, 11, 0.3)  100%
  );
}

.match__q-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-6);
  gap: var(--space-4);
}

.match__q-footer {
  position: relative;
  z-index: 2;
  padding: var(--space-3) var(--space-6);
  padding-bottom: calc(var(--space-4) + 28px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.match__q-footer.is-visible {
  opacity: 1;
  pointer-events: auto;
}

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

.match__q-num {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-oro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.match__q-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-crema);
}

.match__options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--space-8);
}

.match__opt {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--color-crema);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 300;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}

.match__opt:active,
.match__opt.is-selected {
  border-color: var(--color-oro);
  background: rgba(168, 147, 90, 0.1);
  color: var(--color-crema);
}

/* ── Results: fullscreen carousel ── */
.match__reveal {
  display: none;
  flex-direction: column;
  flex: 1;
  position: relative;
  overflow: hidden;
}

.match__reveal.is-active {
  display: flex;
}

/* Carousel */
.match__carousel {
  flex: 1;
  display: flex;
  transition: transform 350ms ease;
  will-change: transform;
  padding-left: var(--space-4);
  gap: var(--space-3);
}

.match__slide {
  flex: 0 0 calc(100% - var(--space-8) - var(--space-3));
  width: calc(100% - var(--space-8) - var(--space-3));
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: var(--glass-radius);
  overflow: hidden;
  cursor: pointer;
}

.match__slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
}

.match__slide-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(13, 13, 11, 0.9) 0%,
    rgba(13, 13, 11, 0.3) 40%,
    rgba(13, 13, 11, 0.05) 100%
  );
}

.match__slide-badge {
  position: absolute;
  top: var(--space-5);
  left: var(--space-5);
  padding: var(--space-3) var(--space-5);
  background: var(--color-oro);
  color: var(--color-negro);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 3;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.match__slide-info {
  position: relative;
  z-index: 2;
  margin: var(--space-4);
  padding: var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.match__slide-nombre {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.1;
  color: var(--color-crema);
}

.match__slide-meta {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: var(--color-oro);
  letter-spacing: 0.04em;
}

.match__slide-desc {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 300;
  line-height: 1.45;
  color: var(--color-arena);
  margin-top: var(--space-1);
}

.match__slide-tap {
  font-family: var(--font-body);
  font-size: 0.6rem;
  color: var(--color-oro);
  text-align: center;
  margin-top: var(--space-2);
  opacity: 0.7;
}

/* Nav arrows */
.match__nav-float {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--color-crema);
  font-size: var(--text-xl);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.match__nav-float:active {
  border-color: var(--color-oro);
  color: var(--color-oro);
}

.match__nav-float--prev { left: var(--space-2); }
.match__nav-float--next { right: var(--space-2); }

.match__nav-float.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Dots */
.match__reveal-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  position: relative;
  z-index: 3;
}

.match__reveal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-arena);
  opacity: 0.3;
  transition: opacity var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
}

.match__reveal-dot.is-active {
  opacity: 1;
  background: var(--color-oro);
}

/* Bottom area: dots + CTA */
.match__reveal-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  flex-shrink: 0;
  z-index: 5;
}

.match__reveal-wa {
  text-decoration: none;
  text-align: center;
  display: flex;
  font-size: var(--text-xs);
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
}

/* ── Lightbox gallery ── */
.match__lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: #0D0D0B;
  flex-direction: column;
}

.match__lightbox.is-open {
  display: flex;
}

.match__lightbox-close {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 22;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--color-crema);
  font-size: var(--text-lg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.match__lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 22;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--color-crema);
  font-size: var(--text-xl);
  cursor: pointer;
  transition: border-color var(--transition-fast), opacity var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.match__lightbox-arrow:active {
  border-color: var(--color-oro);
  color: var(--color-oro);
}

.match__lightbox-prev { left: var(--space-3); }
.match__lightbox-next { right: var(--space-3); }

.match__lightbox-arrow.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.match__lightbox-track {
  flex: 1;
  display: flex;
  transition: transform 350ms ease;
  will-change: transform;
  overflow: visible;
}

.match__lightbox-slide img {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: var(--glass-radius);
  transition: transform 300ms ease;
  cursor: zoom-in;
}

.match__lightbox-slide img.is-zoomed {
  transform: scale(2.5);
  cursor: zoom-out;
}

.match__lightbox-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  position: relative;
}


/* Lightbox message cards */
.lightbox__msg {
  position: absolute;
  z-index: 2;
  padding: var(--space-4) var(--space-5);
  background: rgba(13, 13, 11, 0.85);
  border: 1px solid rgba(200, 184, 154, 0.2);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  font-style: italic;
  line-height: 1.2;
  color: #fff;
  max-width: 220px;
}

.lightbox__msg--top-right {
  top: var(--space-8);
  right: var(--space-4);
}

.lightbox__msg--bottom-left {
  bottom: var(--space-8);
  left: var(--space-4);
}

.match__lightbox-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
}

.match__lightbox-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-arena);
  opacity: 0.3;
}

.match__lightbox-dot.is-active {
  opacity: 1;
  background: var(--color-oro);
}

@media (min-width: 768px) {
  .match__slide-nombre { font-size: var(--text-xl); }
  .match__slide-info { margin: var(--space-6); padding: var(--space-5); }
}

/* Swatch selector (visual style picker) */
.match__options--swatches {
  flex-direction: row;
  gap: var(--space-4);
  justify-content: center;
  padding-bottom: var(--space-4);
}

.match__swatch {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.match__swatch:active,
.match__swatch.is-selected {
  border-color: var(--color-oro);
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(168, 147, 90, 0.3);
}

/* Swipe hint — floating on image */
.match__swipe-hint {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: var(--space-2) var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--color-arena);
  white-space: nowrap;
  animation: swipeHintPulse 2s ease-in-out infinite;
  pointer-events: none;
}

.match__swipe-arrow {
  display: inline-block;
  color: var(--color-oro);
  animation: swipeArrowBounce 1.5s ease-in-out infinite;
}

@keyframes swipeHintPulse {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

@keyframes swipeArrowBounce {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(3px); }
}

/* Footer */
.match__reveal-footer {
  padding: var(--space-2) var(--space-6);
  padding-bottom: calc(var(--space-3) + 28px);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  position: relative;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.match__reveal-footer .btn-continuar {
  min-height: 40px;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-xs);
}

.match__reveal-footer .btn-volver {
  min-height: 36px;
  padding: var(--space-2) var(--space-4);
  font-size: 0.65rem;
}

.match__reveal-footer.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Transition loading */
.match__loading {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-4);
}

.match__loading.is-active { display: flex; }

.match__loading-text {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-style: italic;
  color: var(--color-arena);
  opacity: 0;
  animation: pulseIn 1.5s ease forwards;
}

@keyframes pulseIn {
  0%   { opacity: 0; transform: scale(0.97); }
  40%  { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}

@media (min-width: 768px) {
  .match__q-text { font-size: var(--text-4xl); }
  .match__slide-nombre { font-size: var(--text-3xl); }
  .match__slide-info { margin: 0 var(--space-8); margin-bottom: var(--space-8); padding: var(--space-8); }
}
