/* ==========================================================================
   Base Colors and Design System Tokens
   ========================================================================== */
:root {
  /* HSL curated dark-mode color scheme matching VZA.CL */
  --bg-gradient-start: #0a0a0c;
  --bg-gradient-end: #030304;
  --card-bg: rgba(245, 245, 243, 0.04);
  --card-border: rgba(245, 245, 243, 0.08);
  --card-highlight: rgba(245, 245, 243, 0.12);
  
  /* Primary and Secondary Neon Accents - Gold matching VZA.CL */
  --accent-cyan: #e3a32b;
  --accent-cyan-glow: rgba(227, 163, 43, 0.35);
  --accent-violet: #e3a32b;
  --accent-violet-glow: rgba(227, 163, 43, 0.35);
  --accent-rose: #ff5a46;
  --accent-rose-glow: rgba(255, 90, 70, 0.25);

  /* Neutrals matching VZA.CL */
  --text-primary: #f5f5f3;
  --text-secondary: #a5a5a2;
  --text-muted: #60605d;
  
  /* Layout constraints */
  --safe-padding-top: env(safe-area-inset-top, 0px);
  --safe-padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 50% 30%, var(--bg-gradient-start), var(--bg-gradient-end));
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Typography headers */
h1, h2, h3, .logo-area h1, .clp-value, .total-value, .calc-input-value, .calc-output-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

/* ==========================================================================
   App Shell & Containers
   ========================================================================== */
.app-container {
  width: 100%;
  max-width: 480px; /* Mobile constraint */
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(10, 15, 30, 0.4);
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* App Header */
.app-header {
  height: calc(60px + var(--safe-padding-top));
  padding-top: var(--safe-padding-top);
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  background-color: rgba(10, 15, 28, 0.85);
  z-index: 100;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  color: #000;
}

.logo-icon i {
  width: 18px;
  height: 18px;
  stroke-width: 2.5px;
}

.logo-area h1 {
  font-size: 1.15rem;
  background: linear-gradient(135deg, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.rates-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot.green {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.status-text {
  color: var(--text-secondary);
  font-weight: 500;
}

.icon-btn-small {
  background: none;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 2px;
  transition: transform 0.2s, color 0.2s;
}

.icon-btn-small:active {
  transform: rotate(180deg);
  color: var(--accent-cyan);
}

.icon-btn-small i {
  width: 12px;
  height: 12px;
}

/* Content Area */
.app-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   Screen Router & Animations
   ========================================================================== */
.app-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  z-index: 10;
}

/* ==========================================================================
   SCREEN 1: CAMERA SCANNER DESIGN
   ========================================================================== */
.scanner-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
}

#camera-feed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 5;
}

/* Scanner Header overlay */
.scanner-header {
  padding: 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.currency-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.currency-selector-wrapper label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.glass-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  backdrop-filter: blur(8px);
  font-weight: 600;
}

.to-clp-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.to-clp-badge i {
  width: 12px;
  height: 12px;
  color: var(--accent-cyan);
}

/* Targeting Reticle Box */
.reticle-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.reticle-box {
  width: 280px;
  height: 100px;
  position: relative;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6); /* Darkens region outside frame */
  transition: box-shadow 0.3s;
}

.reticle-box.scanning {
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
}

/* Focus corners */
.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: rgba(255, 255, 255, 0.8);
  border-style: solid;
  pointer-events: none;
  transition: border-color 0.3s;
}

.reticle-box.scanning .corner {
  border-color: var(--accent-cyan);
}

.top-left {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 12px;
}

.top-right {
  top: 0;
  right: 0;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 12px;
}

.bottom-left {
  bottom: 0;
  left: 0;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 12px;
}

.bottom-right {
  bottom: 0;
  right: 0;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 12px;
}

/* Laser scan animation line */
.scan-laser {
  position: absolute;
  top: 0;
  left: 4%;
  width: 92%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--accent-cyan), transparent);
  box-shadow: 0 0 8px var(--accent-cyan);
  opacity: 0;
  pointer-events: none;
}

.reticle-box.scanning .scan-laser {
  animation: scanLine 2s infinite ease-in-out;
  opacity: 1;
}

@keyframes scanLine {
  0% { top: 5%; }
  50% { top: 90%; }
  100% { top: 5%; }
}

.scan-hint {
  position: absolute;
  bottom: -32px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Scanner control bar */
.scanner-controls {
  padding: 24px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.circle-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background-color 0.2s, transform 0.1s;
}

.circle-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.2);
}

.circle-btn i {
  width: 20px;
  height: 20px;
}

/* Main glowing trigger scan button */
.action-scan-btn {
  position: relative;
  height: 56px;
  padding-left: 24px;
  padding-right: 24px;
  border-radius: 28px;
  border: none;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  color: #000;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.35);
  overflow: hidden;
  transition: transform 0.1s, box-shadow 0.2s;
}

.action-scan-btn:active {
  transform: scale(0.96);
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.2);
}

.action-scan-btn i {
  width: 20px;
  height: 20px;
  stroke-width: 2.5px;
}

/* ==========================================================================
   Modals, Results Card & Loaders
   ========================================================================== */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
}

/* Scanning Feedback overlay modal */
.result-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 15, 0.7);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  box-sizing: border-box;
}

.result-card-content {
  width: 100%;
  padding: 20px;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
  transform: translateY(20px);
  animation: slideUp 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@keyframes slideUp {
  to { transform: translateY(0); }
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-header h3 {
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: -0.2px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ocr-debug-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

#preprocessed-canvas-view {
  width: 100%;
  height: 70px;
  border-radius: 8px;
  background-color: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  object-fit: contain;
}

.scan-result-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-field label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.input-editable-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 14px;
}

.currency-symbol {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-cyan);
  margin-right: 10px;
}

.editable-price-input {
  background: none;
  border: none;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  width: 100%;
  outline: none;
}

/* Target conversion representation */
.conversion-result {
  background: linear-gradient(135deg, rgba(127, 0, 255, 0.15), rgba(0, 242, 254, 0.05));
  border: 1px solid rgba(127, 0, 255, 0.2);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conversion-result .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.clp-value-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.clp-symbol {
  font-size: 1.2rem;
  color: var(--accent-violet);
  font-weight: 700;
}

.clp-value {
  font-size: 2rem;
  color: #fff;
  line-height: 1;
}

.clp-code {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Modal Actions Buttons */
.result-actions {
  display: flex;
  gap: 12px;
}

.btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent-violet), hsl(265, 80%, 55%));
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-violet-glow);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Loader Overlay */
.loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 260px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 242, 254, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-cyan);
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loader-status-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(to right, var(--accent-cyan), var(--accent-violet));
  border-radius: 3px;
  transition: width 0.15s ease-out;
}

/* Hidden Utility class */
.hidden {
  display: none !important;
}

/* ==========================================================================
   SCREEN 2: CALCULATOR DESIGN
   ========================================================================== */
.calculator-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}

/* Display */
.calc-display-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 130px;
}

.calc-source-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.minimal-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
}

.calc-input-value {
  font-size: 2.2rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.5px;
  text-align: right;
  word-break: break-all;
  max-width: 80%;
  overflow: hidden;
}

.calc-target-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.calc-clp-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.calc-output-value {
  font-size: 1.6rem;
  color: var(--accent-violet);
  font-weight: 700;
}

/* Keypad Grid layout */
.calc-keypad-panel {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.keypad-btn {
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, transform 0.05s;
}

.keypad-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.1);
}

.keypad-btn.action-key {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.keypad-btn.action-key:active {
  background: rgba(255, 255, 255, 0.08);
}

.keypad-btn.double-width {
  grid-column: span 1; /* reset if needed, we'll keep standard buttons or define below */
}

/* Special button styles */
.double-width {
  grid-column: span 1;
}

.primary-action-key {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--accent-violet), hsl(265, 80%, 55%)) !important;
  color: #fff !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 4px 12px var(--accent-violet-glow);
  display: flex;
  gap: 6px;
}

.primary-action-key i {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   SCREEN 3: HISTORY & SHOPPING LIST
   ========================================================================== */
.history-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
  overflow: hidden;
}

.grand-total-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.grand-total-card h2 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.total-clp-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.total-symbol {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.total-value {
  font-size: 2.8rem;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.total-code {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.history-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.danger-btn-small {
  margin-top: 4px;
  background: rgba(255, 75, 75, 0.08);
  border: 1px solid rgba(255, 75, 75, 0.2);
  color: var(--accent-rose);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s, transform 0.1s;
}

.danger-btn-small:active {
  transform: scale(0.95);
  background: rgba(255, 75, 75, 0.15);
}

.danger-btn-small i {
  width: 12px;
  height: 12px;
}

/* History Items List */
.items-list-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.items-list-wrapper h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 4px;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

/* Custom Scrollbar for list */
.history-list::-webkit-scrollbar {
  width: 4px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* Empty State Placeholders */
.empty-history-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
  margin-top: auto;
  margin-bottom: auto;
}

.empty-icon {
  width: 48px;
  height: 48px;
  stroke-width: 1.5;
  color: var(--text-muted);
  opacity: 0.6;
}

.empty-history-state p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.empty-history-state span {
  font-size: 0.75rem;
  max-width: 200px;
}

/* History Single Item Row */
.history-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: itemFadeIn 0.3s ease;
}

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

.item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-original-price {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.item-timestamp {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.item-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.item-converted-price {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent-cyan);
}

.item-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

.item-delete-btn:active {
  color: var(--accent-rose);
  background: rgba(255, 75, 75, 0.08);
}

.item-delete-btn i {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Bottom Navigation Bar
   ========================================================================== */
.app-navbar {
  height: calc(65px + var(--safe-padding-bottom));
  padding-bottom: var(--safe-padding-bottom);
  border-top: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  background-color: rgba(10, 15, 28, 0.92);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 100;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-item i {
  width: 20px;
  height: 20px;
  transition: transform 0.2s;
}

.nav-item:active i {
  transform: scale(0.85);
}

.nav-item.active {
  color: var(--accent-cyan);
}

/* Cart badge count helper */
.badge-wrapper {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--accent-violet);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  height: 16px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(10, 15, 28, 0.9);
}

.calc-header-title {
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  margin-bottom: 2px;
}

.calc-header-title span {
  color: var(--accent-gold);
  font-weight: 700;
}

.calc-currency-selector-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.calc-country-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  letter-spacing: 0.5px;
  background: rgba(227, 163, 43, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(227, 163, 43, 0.15);
}

/* Onboarding overlay stylesheet rules */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0a0a0c;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.onboarding-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.onboarding-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
  padding: 32px 24px;
}

.onboarding-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.onboarding-card p {
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  margin-bottom: 24px;
  line-height: 1.4;
}

.onboarding-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.onboarding-header .logo-icon {
  font-size: 2.2rem;
  color: var(--accent-gold);
}

.onboarding-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

.onboarding-selector-field {
  margin-bottom: 28px;
}

.glass-select-large {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e3a32b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
}

.primary-large {
  width: 100%;
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent-gold), #b37d18) !important;
  color: #ffffff !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(227, 163, 43, 0.3);
  transition: all 0.2s ease;
}

.primary-large * {
  color: #ffffff !important;
}

.primary-large:active {
  transform: scale(0.98);
}

/* Company logo in header */
.header-logo-img {
  height: 36px;
  width: 36px;
  object-fit: contain;
  border-radius: 8px;
}

/* Privacy notice in onboarding */
.privacy-notice {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.privacy-notice i {
  color: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 2px;
  width: 16px;
  height: 16px;
}

.privacy-notice p {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.privacy-notice strong {
  color: var(--text-primary);
}

/* Mode toggle button (foreign↔CLP direction switcher) */
.mode-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.mode-toggle-btn:active {
  transform: scale(0.95);
}

.mode-toggle-btn i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent-cyan);
}

.mode-label {
  color: var(--text-primary);
}
