:root {
  --bg-deep: #0a0e1a;
  --bg-elev: #131826;
  --bg-card: #1a2030;
  --border: #2a3142;
  --accent: #f06b00;
  --accent-bright: #ff7e1a;
  --accent-glow: rgba(240, 107, 0, 0.4);
  --success: #00d97e;
  --text: #f3f4f6;
  --text-mute: #9ca3af;
  --text-dim: #6b7280;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: radial-gradient(ellipse at top, #1a1f30 0%, #0a0e1a 60%);
}

/* Device frame — looks like a kiosk screen */
.device-frame {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (min-width: 700px) {
  .device-frame {
    height: 90vh;
    min-height: 720px;
    max-height: 920px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow), 0 0 0 12px #1a1f2e, 0 0 0 14px #2a3142;
    border: 1px solid #1a1f2e;
  }
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-glow);
}
.brand-name {
  font-size: 17px;
}
.topbar-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-mute);
}
.status-online { color: var(--success); }

/* Bottombar */
.bottombar {
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* Screens */
.screen-stage {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 22px;
  animation: fadeSlide 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.screen.active { display: flex; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.screen-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.screen-header h2 {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.btn-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-back:hover { background: var(--border); }

/* CTAs */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px 24px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: -0.01em;
}
.cta-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(240, 107, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.05) inset;
}
.cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(240, 107, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.08) inset;
}
.cta-primary:active { transform: translateY(0); }
.cta-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.cta-secondary:hover { background: var(--border); }
.cta-huge {
  padding: 22px 28px;
  font-size: 19px;
  font-weight: 700;
  margin: 32px 0 24px;
}

/* Attract screen */
.attract-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 0;
  position: relative;
}
.attract-pulse {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.2; }
}
.attract-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, #d4d8e2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  z-index: 1;
}
.attract-sub {
  color: var(--text-mute);
  font-size: 15px;
  max-width: 280px;
  position: relative;
  z-index: 1;
}
.attract-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
}
.feat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
}
.feat-icon { font-size: 22px; }

/* Catalog */
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-mute);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
  font-family: inherit;
}
.filter-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-bottom: 100px;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.product-emoji {
  font-size: 38px;
  text-align: center;
  margin-bottom: 4px;
}
.product-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}
.product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-bright);
}
.product-stock {
  font-size: 11px;
  color: var(--text-dim);
}
.product-card.in-cart { border-color: var(--accent); }
.product-card.in-cart::after {
  content: attr(data-qty);
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.cart-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}
.cart-count {
  background: var(--accent);
  color: white;
  font-size: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.fab {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 44px);
  max-width: 376px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(240, 107, 0, 0.45);
  z-index: 100;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translateX(-50%); opacity: 1; }
}

/* Cart screen */
.cart-list { flex: 1; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 10px;
}
.cart-item-emoji { font-size: 32px; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.cart-item-price { font-size: 13px; color: var(--text-mute); }
.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-deep);
  border-radius: 8px;
  padding: 4px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover { background: var(--border); }
.qty-num { min-width: 24px; text-align: center; font-weight: 600; }

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  color: var(--text-mute);
}

.cart-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  font-size: 18px;
}
.total-row strong { font-size: 28px; color: var(--accent-bright); }

/* Payment */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.pay-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition: all 0.18s;
}
.pay-card-active {
  border-color: var(--accent);
  background: rgba(240, 107, 0, 0.08);
}
.pay-card:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pay-icon { font-size: 36px; }
.pay-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.pay-card p { font-size: 12px; color: var(--text-mute); }

.amount-display {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--border);
}
.amount-label { color: var(--text-mute); font-size: 13px; }
.amount-value { font-size: 36px; font-weight: 800; color: var(--accent-bright); letter-spacing: -0.02em; }

/* NIT */
.nit-prompt { display: flex; flex-direction: column; gap: 16px; }
.nit-prompt > p { font-size: 16px; text-align: center; color: var(--text-mute); }
.nit-input-wrap {
  display: flex;
  gap: 8px;
}
#nitInput {
  flex: 1;
  padding: 16px 18px;
  font-size: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  letter-spacing: 0.1em;
}
#nitInput:focus { outline: none; border-color: var(--accent); }
.btn-search {
  padding: 16px 22px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.nit-result {
  background: rgba(0, 217, 126, 0.1);
  border: 1px solid var(--success);
  padding: 14px 16px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nit-name { font-weight: 600; }
.btn-clear {
  background: transparent;
  border: 1px solid var(--success);
  color: var(--success);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.nit-divider {
  position: relative;
  text-align: center;
  margin: 8px 0;
  color: var(--text-dim);
  font-size: 12px;
}
.nit-divider::before, .nit-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}
.nit-divider::before { left: 0; }
.nit-divider::after { right: 0; }
.amount-mini {
  text-align: center;
  margin-top: auto;
  padding-top: 16px;
  font-size: 14px;
  color: var(--text-mute);
}
.amount-mini span { color: var(--accent-bright); font-weight: 700; }

/* Processing */
.processing-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
}
.spinner {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-stage h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.processing-stage p { color: var(--text-mute); font-size: 14px; }
.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}
.step {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: left;
  font-size: 13px;
  color: var(--text-mute);
  transition: all 0.3s;
  opacity: 0.5;
}
.step.active {
  background: rgba(240, 107, 0, 0.1);
  border-color: var(--accent);
  color: var(--text);
  opacity: 1;
}
.step.done {
  background: rgba(0, 217, 126, 0.1);
  border-color: var(--success);
  color: var(--text);
  opacity: 1;
}
.step.done::before { content: '✓ '; color: var(--success); font-weight: 700; }

/* Success */
.success-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}
.checkmark {
  width: 80px;
  height: 80px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 700;
  box-shadow: 0 0 0 12px rgba(0, 217, 126, 0.15);
  animation: pop 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pop {
  from { transform: scale(0); }
  60% { transform: scale(1.15); }
  to { transform: scale(1); }
}
.success-stage h2 { font-size: 26px; letter-spacing: -0.02em; }
.success-sub { color: var(--text-mute); }

.receipt-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
}
.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 12px;
}
.receipt-status {
  background: var(--success);
  color: white;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.qr-placeholder {
  width: 120px;
  height: 120px;
  background: white;
  margin: 0 auto 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.qr-pattern {
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%),
    linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  border: 2px solid #000;
}
.receipt-details {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.receipt-details > div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}
.receipt-details span:first-child { color: var(--text-mute); }
.receipt-details code {
  font-family: 'Inter', monospace;
  font-size: 11px;
  color: var(--text);
}

/* Goodbye */
.goodbye-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}
.goodbye-icon { font-size: 80px; animation: wave 1s ease-in-out infinite alternate; }
@keyframes wave {
  from { transform: rotate(-10deg); }
  to { transform: rotate(20deg); }
}
.goodbye-stage h1 { font-size: 28px; letter-spacing: -0.02em; }
.goodbye-stage p { color: var(--text-mute); }
