@import './tiles.css';

/* Wizard SmartButtons — basado en front/css/smart-buttons.css (4 columnas) */

.sb-grid--wizard,
.sb-loading {
  --sb-cols: 4;
  --sb-gap: 10px;
  --sb-gaps-x: calc((var(--sb-cols) - 1) * var(--sb-gap));
}

.sb-grid--wizard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
  grid-auto-flow: dense;
  gap: var(--sb-gap);
  width: 100%;
  container-type: inline-size;
}

.sb-grid--wizard .sb-tile {
  border: none;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 10px 10px 12px;
  cursor: pointer;
  overflow: hidden;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.sb-grid--wizard .sb-tile:active {
  transform: scale(0.91);
  filter: brightness(0.78);
}

@keyframes sb-flip {
  0%   { transform: perspective(600px) rotateY(0deg); filter: brightness(1); }
  40%  { transform: perspective(600px) rotateY(-14deg); filter: brightness(1.1); }
  100% { transform: perspective(600px) rotateY(0deg); filter: brightness(1); }
}

.sb-grid--wizard .sb-tile.sb-flipping {
  animation: sb-flip 0.18s ease-out;
  pointer-events: none;
}

.sb-grid--wizard .sb-tile.sb-tile--selected {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 0 0 5px rgba(0, 120, 215, 0.55);
  filter: brightness(1.08);
}

.sb-grid--wizard .sb-tile i {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
}

.sb-grid--wizard .sb-tile span {
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  line-height: 1.2;
}

.sb-grid--wizard .sb-1x1 {
  grid-column: span 1;
  grid-row: span 1;
  aspect-ratio: 1;
}

.sb-grid--wizard .sb-2x1 {
  grid-column: span 2;
  grid-row: span 1;
  flex-direction: column;
  aspect-ratio: 2 / 1;
  min-height: calc((100cqw - var(--sb-gaps-x)) / var(--sb-cols));
  min-width: 0;
  box-sizing: border-box;
}

.sb-grid--wizard .sb-2x1 i { font-size: 1.2rem; }
.sb-grid--wizard .sb-2x1 span { font-size: 0.62rem; }

.sb-grid--wizard .sb-2x2 {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: 1;
}

.sb-grid--wizard .sb-2x2 i { font-size: 1.5rem; }
.sb-grid--wizard .sb-2x2 span { font-size: 0.72rem; }

.sb-grid--wizard .sb-3x1 {
  grid-column: 1 / -1;
  grid-row: span 1;
  flex-direction: row;
  gap: 18px;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 18px;
  aspect-ratio: auto;
  min-height: calc((100cqw - var(--sb-gaps-x)) / var(--sb-cols));
  width: 100%;
  box-sizing: border-box;
}

.sb-grid--wizard .sb-3x1 i {
  font-size: 1.4rem;
  margin-bottom: 0;
  min-width: 1.4rem;
}

.sb-grid--wizard .sb-3x1 span {
  font-size: 0.78rem;
  letter-spacing: 0.6px;
  font-weight: 700;
}

.sb-loading {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: var(--sb-gap);
  width: 100%;
  container-type: inline-size;
}

.sb-loading-tile {
  border-radius: 4px;
  background: var(--mp-border-light);
  aspect-ratio: 1;
  animation: sb-pulse 1.4s ease-in-out infinite;
}

.sb-loading-tile:nth-child(1) {
  grid-column: 1 / -1;
  aspect-ratio: 4 / 1;
  min-height: calc((100cqw - var(--sb-gaps-x)) / var(--sb-cols));
}

.sb-loading-tile:nth-child(2) { grid-column: span 2; grid-row: span 2; }
.sb-loading-tile:nth-child(5) { grid-column: span 2; aspect-ratio: 2 / 1; }

@keyframes sb-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.12; }
}

/* Wizard chrome */
.wizard-nav {
  position: relative;
  margin-bottom: 20px;
  padding: 0 40px;
}

.wizard-back {
  position: absolute;
  left: 0;
  top: -4px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--mp-border);
  background: var(--mp-surface);
  color: var(--mp-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-dots {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 12px;
}

.wizard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mp-border);
  transition: all 0.3s ease;
}

.wizard-dot--done {
  background: #34c759;
  box-shadow: 0 0 10px rgba(52, 199, 89, 0.3);
}

.wizard-dot--active {
  background: #007aff;
  box-shadow: 0 0 15px rgba(0, 122, 255, 0.5);
  transform: scale(1.4);
}

.wizard-step-label {
  text-align: center;
  margin: 12px 0 0;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  opacity: 0.35;
  text-transform: uppercase;
}

.wizard-step-title {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 16px;
  opacity: 0.85;
}

.populares-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.btn-pop {
  background: var(--mp-surface);
  border: 1px solid var(--mp-border-light);
  border-radius: 4px;
  padding: 12px;
  color: var(--mp-text);
  font-weight: 600;
  text-align: center;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-pop:active {
  background: var(--mp-surface-2);
}

.wizard-confirm-card {
  padding: 14px;
  border-radius: 8px;
  background: var(--mp-surface);
  border: 1px solid var(--mp-border-light);
  box-shadow: var(--mp-card-shadow);
}

.wizard-summary-block {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--mp-border-light);
  font-size: 0.8rem;
  line-height: 1.45;
}

.wizard-summary-monto {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--mp-accent-gasto);
  margin: 4px 0 8px;
}

.wizard-summary-grid {
  display: grid;
  gap: 3px;
}

.wizard-summary-grid span.dim {
  opacity: 0.45;
}

.btn-wizard-next {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 6px;
  background: var(--mp-accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  margin-top: 20px;
}

.btn-wizard-next:disabled {
  opacity: 0.5;
}
