/* PrecioVivo — original design system for supermarket price tracker */
:root {
  --c-bg: #fbf7f1;
  --c-surface: #ffffff;
  --c-ink: #1a2330;
  --c-ink-2: #4a5468;
  --c-ink-3: #8892a3;
  --c-line: #ebe6dd;
  --c-line-2: #f1ede5;
  --c-primary: #1b9a5f;       /* fresh produce green */
  --c-primary-deep: #126b41;
  --c-primary-soft: #def4e7;
  --c-accent: #ff6b3d;        /* ripe tangerine */
  --c-accent-soft: #ffe4d8;
  --c-yellow: #ffc845;
  --c-yellow-soft: #fff3cf;
  --c-berry: #d4385e;
  --c-berry-soft: #ffe1ea;
  --c-navy: #142340;
  --c-navy-soft: #e6ebf5;
  --c-mint: #6fd6b2;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --shadow-1: 0 1px 2px rgba(20,35,64,0.06), 0 4px 14px rgba(20,35,64,0.05);
  --shadow-2: 0 10px 30px rgba(20,35,64,0.12);
  --shadow-pop: 0 20px 50px rgba(27,154,95,0.28);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Manrope', 'Helvetica Neue', system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at -10% -10%, #fff3e6 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 110%, #e1f3e8 0%, transparent 55%),
    #f4ede0;
  color: var(--c-ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Phone stage — responsive */
.stage {
  position: fixed; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}
.device {
  width: min(420px, 100%);
  max-width: 420px;
  height: min(900px, 100%);
  max-height: 100vh;
  border-radius: 44px;
  background: #0d1424;
  padding: 12px;
  box-shadow: 0 30px 80px rgba(20,35,64,0.25), 0 0 0 1px rgba(255,255,255,0.04) inset;
  position: relative;
  flex-shrink: 0;
}
.device-screen {
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 34px;
  overflow: hidden;
  background: var(--c-bg);
  position: relative;
  display: flex;
  flex-direction: column;
}
.notch {
  position: absolute;
  top: 16px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 28px;
  background: #0d1424; border-radius: 20px;
  z-index: 50;
}
@media (max-width: 480px) {
  .stage { padding: 0; }
  .device { width: 100%; height: 100%; border-radius: 0; padding: 0; box-shadow: none; background: var(--c-bg); }
  .device-screen { border-radius: 0; }
  .notch { display: none; }
}

/* Status bar */
.status-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 28px;
  padding-top: 8px;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  z-index: 10;
}
.status-bar .right { display: flex; gap: 6px; align-items: center; }

/* Screen container */
.screen {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

/* Tab bar */
.tab-bar {
  height: 76px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--c-line);
  display: flex;
  align-items: stretch;
  padding: 6px 8px 14px;
  position: relative;
  z-index: 10;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--c-ink-3);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  transition: color .15s;
}
.tab.active { color: var(--c-primary); }
.tab .tab-ico { width: 26px; height: 26px; display: grid; place-items: center; }
.tab-capture {
  position: relative;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-deep) 100%);
  color: white !important;
  width: 60px; height: 60px;
  border-radius: 30px;
  margin-top: -22px;
  align-self: center;
  box-shadow: var(--shadow-pop);
  flex: 0 0 60px;
  display: grid; place-items: center;
}

/* Typography */
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 28px; font-weight: 800; line-height: 1.1; }
h2 { font-size: 22px; font-weight: 800; line-height: 1.15; }
h3 { font-size: 17px; font-weight: 700; }
h4 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--c-ink-3); }
.tiny { font-size: 11px; }
.small { font-size: 13px; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-ink-3); }
.money { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; font-weight: 800; }
.struck { text-decoration: line-through; color: var(--c-ink-3); font-weight: 600; }

/* Buttons */
.btn {
  height: 52px;
  border-radius: 26px;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  transition: transform .12s ease, box-shadow .15s ease, background .15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--c-primary); color: white; box-shadow: 0 8px 22px rgba(27,154,95,0.32); }
.btn-primary:hover { background: var(--c-primary-deep); }
.btn-dark { background: var(--c-ink); color: white; }
.btn-ghost { background: transparent; color: var(--c-ink); border: 1.5px solid var(--c-line); }
.btn-accent { background: var(--c-accent); color: white; box-shadow: 0 8px 22px rgba(255,107,61,0.34); }
.btn-block { width: 100%; }
.btn-sm { height: 38px; border-radius: 19px; font-size: 13px; padding: 0 16px; }

/* Inputs */
.field {
  display: flex; flex-direction: column; gap: 8px;
}
.field-label { font-size: 12px; font-weight: 700; color: var(--c-ink-2); letter-spacing: 0.04em; }
.input {
  height: 54px;
  background: white;
  border: 1.5px solid var(--c-line);
  border-radius: 16px;
  padding: 0 18px;
  font-size: 15px;
  font-family: inherit;
  color: var(--c-ink);
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-soft); }
.input-icon { position: relative; }
.input-icon .input { padding-left: 50px; }
.input-icon .ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--c-ink-3); }

/* Cards */
.card {
  background: white;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-1);
}
.card-tight { padding: 14px; }
.card-pad { padding: 18px; }

/* Chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: 15px;
  background: var(--c-line-2);
  font-size: 12px; font-weight: 700;
  color: var(--c-ink-2);
  border: none; cursor: pointer; font-family: inherit;
}
.chip.active { background: var(--c-ink); color: white; }
.chip.green { background: var(--c-primary-soft); color: var(--c-primary-deep); }
.chip.accent { background: var(--c-accent-soft); color: #b54420; }
.chip.yellow { background: var(--c-yellow-soft); color: #8a6300; }
.chip.berry { background: var(--c-berry-soft); color: var(--c-berry); }

/* Discount badge */
.discount-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-accent);
  color: white; font-weight: 800;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 12px;
  letter-spacing: -0.01em;
}

/* Product image placeholder */
.product-img {
  background:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.04) 0 8px, rgba(0,0,0,0) 8px 16px),
    linear-gradient(135deg, #f3ede0 0%, #ece4d2 100%);
  border-radius: 14px;
  display: grid; place-items: center;
  color: var(--c-ink-3);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  position: relative;
  overflow: hidden;
}
.product-img.green { background: linear-gradient(135deg, #def4e7 0%, #b9e7cf 100%); color: #126b41; }
.product-img.orange { background: linear-gradient(135deg, #ffe4d8 0%, #ffcfb7 100%); color: #b54420; }
.product-img.yellow { background: linear-gradient(135deg, #fff3cf 0%, #ffe190 100%); color: #8a6300; }
.product-img.berry { background: linear-gradient(135deg, #ffe1ea 0%, #ffc3d4 100%); color: var(--c-berry); }
.product-img.navy { background: linear-gradient(135deg, #e6ebf5 0%, #c4d0e8 100%); color: var(--c-navy); }
.product-img.mint { background: linear-gradient(135deg, #d9f5ea 0%, #abe5cd 100%); color: #0e6a48; }

/* Header */
.app-header {
  padding: 6px 22px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), var(--c-yellow));
  display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 14px;
  box-shadow: 0 4px 12px rgba(255,107,61,0.25);
}

/* Animations */
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(0.6); } 60% { transform: scale(1.06); } 100% { opacity: 1; transform: scale(1); } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-ring { 0% { transform: scale(0.6); opacity: 0.6; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes drift { 0% { transform: translate(0,0); } 50% { transform: translate(6px,-8px); } 100% { transform: translate(0,0); } }
@keyframes shine { 0% { transform: translateX(-120%); } 100% { transform: translateX(220%); } }
@keyframes confetti-fall { 0% { transform: translateY(-30px) rotate(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(420px) rotate(540deg); opacity: 0; } }
@keyframes check-draw { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
@keyframes ring-grow { from { stroke-dashoffset: 320; } to { stroke-dashoffset: 0; } }
@keyframes orbit { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.fade-in { animation: fade-in .35s ease both; }
.pop-in { animation: pop-in .55s cubic-bezier(.2,.9,.3,1.2) both; }

/* Modal */
.modal-back {
  position: absolute; inset: 0;
  background: rgba(13,20,36,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .22s ease both;
}
.modal-sheet {
  background: white;
  width: 100%;
  border-radius: 28px 28px 0 0;
  padding: 24px 22px 28px;
  animation: slide-up .35s cubic-bezier(.2,.9,.3,1) both;
  max-height: 90%;
  overflow-y: auto;
  scrollbar-width: none;
}
.modal-sheet::-webkit-scrollbar { display: none; }
.modal-grabber { width: 44px; height: 4px; background: #d8d0c2; border-radius: 2px; margin: 0 auto 16px; }

/* Center modal */
.modal-center {
  position: absolute; inset: 0;
  background: rgba(13,20,36,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: grid; place-items: center;
  animation: fade-in .22s ease both;
  padding: 24px;
}
.modal-card {
  background: white;
  width: 100%;
  max-width: 340px;
  border-radius: 28px;
  padding: 28px 22px 22px;
  text-align: center;
  animation: pop-in .45s cubic-bezier(.2,.9,.3,1.2) both;
}

/* Confetti */
.confetti-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti-bit {
  position: absolute; top: -20px;
  width: 8px; height: 14px; border-radius: 2px;
  animation: confetti-fall 1.6s ease-in forwards;
}

/* Searching pulse rings */
.pulse-rings { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.pulse-rings .ring {
  position: absolute; inset: 0;
  border: 2px solid var(--c-primary);
  border-radius: 50%;
  animation: pulse-ring 2.2s ease-out infinite;
}
.pulse-rings .ring.r2 { animation-delay: 0.55s; }
.pulse-rings .ring.r3 { animation-delay: 1.1s; }
.pulse-rings .ring.r4 { animation-delay: 1.65s; }
.pulse-rings .core {
  position: absolute; inset: 50%;
  width: 90px; height: 90px;
  margin: -45px 0 0 -45px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-deep));
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: var(--shadow-pop);
  color: white;
}
.orbit-store {
  position: absolute; width: 44px; height: 44px;
  border-radius: 14px; background: white;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(20,35,64,0.15);
  font-weight: 800; font-size: 11px;
  border: 1px solid var(--c-line);
}

/* Map pin */
.map-pin {
  position: absolute;
  width: 38px; height: 38px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--c-primary);
  display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(27,154,95,0.35);
}
.map-pin > * { transform: rotate(45deg); color: white; font-weight: 800; font-size: 13px; }

/* Bar */
.bar-track { height: 8px; background: var(--c-line-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--c-accent), var(--c-yellow)); border-radius: 4px; }

/* Shine animation for capture button */
.shine-box {
  position: relative;
  overflow: hidden;
}
.shine-box::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.55) 50%, transparent 65%);
  animation: shine 2.4s infinite;
}

/* Custom scroll for horizontal lists */
.h-scroll {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding: 4px 22px 4px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.h-scroll::-webkit-scrollbar { display: none; }
.h-scroll > * { scroll-snap-align: start; flex-shrink: 0; }

/* Container */
.section { padding: 14px 22px; }
.section-tight { padding: 8px 22px; }

.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.stack { display: flex; flex-direction: column; }
.stack-2 { gap: 8px; } .stack-3 { gap: 12px; } .stack-4 { gap: 16px; }

/* Toggle */
.toggle {
  width: 44px; height: 26px; border-radius: 13px;
  background: var(--c-line); position: relative;
  cursor: pointer; transition: background .15s;
  border: none; padding: 0;
}
.toggle.on { background: var(--c-primary); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: white; transition: transform .18s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle.on::after { transform: translateX(18px); }

/* Checkbox */
.checkbox {
  width: 26px; height: 26px;
  border: 2px solid var(--c-line);
  border-radius: 9px;
  display: grid; place-items: center;
  cursor: pointer;
  background: white;
  transition: all .15s;
  flex-shrink: 0;
}
.checkbox.checked { background: var(--c-primary); border-color: var(--c-primary); }

/* Tabs underline */
.tabs-underline {
  display: flex; gap: 22px;
  border-bottom: 1px solid var(--c-line);
  padding: 0 22px;
}
.tabs-underline .t {
  background: none; border: none; padding: 14px 2px;
  font-family: inherit; font-weight: 700; font-size: 14px;
  color: var(--c-ink-3); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs-underline .t.active { color: var(--c-ink); border-bottom-color: var(--c-primary); }

/* Splash */
.splash-logo {
  width: 92px; height: 92px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-deep));
  display: grid; place-items: center;
  box-shadow: var(--shadow-pop);
  position: relative;
  overflow: hidden;
}
.splash-logo::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.5), transparent 50%);
}
