/* ==========================================================
   VOLEC EXPRESS - PREMIUM DESIGN SYSTEM
   Inspirado en Material 3, Clean UI & Mobile-First Excellence
   ========================================================== */

:root {
  /* Paleta Oficial VOLEC */
  --primario: #1565C0;
  --primario-dark: #0D47A1;
  --primario-light: #E3F2FD;
  --primario-border: #90CAF9;
  --acento: #4CAF50;
  --acento-dark: #2E7D32;
  --acento-light: #E8F5E9;
  --naranja: #FF6500;
  --naranja-light: #FFF3E0;
  --rojo: #E53935;
  --rojo-light: #FFEBEE;
  
  --bg-body: #F4F7FB;
  --bg-card: #FFFFFF;
  --text-main: #1A202C;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px rgba(21, 101, 192, 0.12);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}

/* Contenedor Principal */
.app-container {
  width: 100%;
  max-width: 520px;
  padding: 14px;
  margin: 0 auto;
  flex: 1;
}

@media (min-width: 768px) {
  body {
    background: linear-gradient(180deg, #EDF2F7 0%, #E2E8F0 100%);
    padding: 24px 0;
  }
  .app-container {
    max-width: 560px;
    padding: 0 16px;
  }
}

/* ==========================================================
   CABECERA ELEGANTE
   ========================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primario) 0%, var(--primario-dark) 100%);
  color: #FFFFFF;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(21, 101, 192, 0.25);
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primario-dark);
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.brand-info span {
  font-size: 0.72rem;
  color: var(--naranja);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.header-actions {
  display: flex;
  gap: 6px;
}

.btn-header-pill {
  background: var(--primario-light);
  border: 1px solid var(--primario-border);
  color: var(--primario);
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-header-pill:hover {
  background: #BBDEFB;
}

/* ==========================================================
   STEPPER VISUAL MODERNO CON BARRA DE PROGRESO
   ========================================================== */
.stepper-container {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #E2E8F0;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--primario) 0%, var(--acento) 100%);
  border-radius: var(--radius-pill);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.steps-list {
  display: flex;
  justify-content: space-between;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  flex: 1;
}

.step-node-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F1F5F9;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  border: 2px solid #CBD5E1;
  transition: all 0.25s;
}

.step-node.active .step-node-icon {
  background: var(--primario);
  color: #FFFFFF;
  border-color: var(--primario);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.2);
}

.step-node.completed .step-node-icon {
  background: var(--acento);
  color: #FFFFFF;
  border-color: var(--acento);
}

.step-node-text {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94A3B8;
}

.step-node.active .step-node-text {
  color: var(--primario-dark);
  font-weight: 800;
}

/* ==========================================================
   TARJETAS Y SECCIONES
   ========================================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.icon-bubble {
  width: 36px;
  height: 36px;
  background: var(--primario-light);
  color: var(--primario);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.card-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--primario-dark);
}

.card-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.45;
}

/* ==========================================================
   INPUTS DE TEXTO Y CONTROLES
   ========================================================== */
.input-group {
  margin-bottom: 14px;
}

.input-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: #475569;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.input-control {
  width: 100%;
  padding: 13px 15px;
  font-size: 16px;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  font-family: inherit;
  color: var(--text-main);
  background: #FFFFFF;
  transition: all 0.2s;
  outline: none;
}

.input-control:focus {
  border-color: var(--primario);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

/* ==========================================================
   BOTONES DE SELECCIÓN TÁCTIL (GRID CARDS)
   ========================================================== */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.option-card {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 12px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  transition: all 0.2s;
  user-select: none;
}

.option-card:hover {
  border-color: var(--primario-border);
  background: #F1F5F9;
}

.option-card.selected {
  background: var(--primario-light);
  border-color: var(--primario);
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.15);
}

.option-card-icon {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.option-card-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
}

.option-card.selected .option-card-title {
  color: var(--primario-dark);
}

.option-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================
   ITEMS DINÁMICOS CON CONTADOR (+ / -)
   ========================================================== */
.item-card {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.item-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--primario-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-remove-item {
  background: var(--rojo-light);
  color: var(--rojo);
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-remove-item:hover {
  background: #FFCDD2;
}

/* Control de Cantidad con Botones + y - */
.qty-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  overflow: hidden;
  height: 48px;
}

.qty-btn {
  width: 36px;
  height: 100%;
  background: #F1F5F9;
  border: none;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primario);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.qty-btn:hover {
  background: #E2E8F0;
}

.qty-input {
  width: 44px;
  height: 100%;
  border: none;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  outline: none;
}

.btn-add-item {
  background: var(--primario-light);
  color: var(--primario);
  border: 1.5px dashed var(--primario-border);
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  margin-bottom: 14px;
  min-height: 46px;
}

.btn-add-item:hover {
  background: #BBDEFB;
}

/* ==========================================================
   BOTONES PRINCIPALES Y SECUNDARIOS
   ========================================================== */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primario) 0%, var(--primario-dark) 100%);
  color: #FFFFFF;
  border: none;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.35);
  transition: all 0.2s;
  min-height: 50px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(21, 101, 192, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #FFFFFF;
  color: var(--primario);
  border: 1.5px solid var(--primario);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  min-height: 50px;
}

.btn-secondary:hover {
  background: var(--primario-light);
}

/* ==========================================================
   PANTALLA DE RESULTADO FINAL (CASILLERO)
   ========================================================== */
.ticket-hero-box {
  background: linear-gradient(135deg, #F0F7FF 0%, #E3F2FD 100%);
  border: 2px solid var(--primario-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 12px 0 16px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.1);
}

.ticket-num-badge {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--primario);
  letter-spacing: 2px;
  margin-top: 4px;
  line-height: 1.1;
}

.locker-copy-card {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  transition: border-color 0.2s;
}

.locker-copy-card:hover {
  border-color: var(--primario-border);
}

.locker-copy-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748B;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.locker-copy-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primario-dark);
  word-break: break-word;
}

.btn-copy-mini {
  background: var(--primario-light);
  color: var(--primario);
  border: 1px solid var(--primario-border);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-copy-mini:hover {
  background: #BBDEFB;
}

/* ==========================================================
   MODAL DE REGLAS & TARIFAS
   ========================================================== */
.rules-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 9999;
}

.rules-modal-overlay.active {
  display: flex;
}

.rules-modal-content {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 16px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.rules-tab-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #F1F5F9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.btn-rule-tab {
  border: none;
  background: transparent;
  padding: 9px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #64748B;
  cursor: pointer;
}

.btn-rule-tab.active {
  background: #FFFFFF;
  color: var(--primario);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rule-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 0.84rem;
}

.rule-item-row:last-child {
  border-bottom: none;
}

.rule-item-price {
  font-weight: 800;
  color: var(--primario);
  background: var(--primario-light);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0F172A;
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 0.74rem;
}
