/* Sjekkmat — Handle (forbruker) v2 */

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #f8f9fa;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: white; border-bottom: 1px solid #eee;
}
.logo { font-size: 20px; font-weight: 800; color: #1a1a1a; text-decoration: none; }
.tagline { font-size: 14px; color: #888; }

.main { max-width: 540px; margin: 0 auto; padding: 24px 20px; }

/* ─── Search ─────────────────────────── */
.search-section h1 { font-size: 28px; font-weight: 700; margin-bottom: 16px; text-align: center; line-height: 1.2; }
.search-wrap { position: relative; }
.search-wrap input {
  width: 100%; padding: 18px 20px; font-size: 18px;
  font-family: 'Inter', sans-serif; border: 2px solid #ddd;
  border-radius: 16px; outline: none; background: white; transition: border-color 0.2s;
}
.search-wrap input::placeholder { color: #bbb; }
.search-wrap input:focus { border-color: #2563eb; }

.results {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: white; border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  max-height: 400px; overflow-y: auto; z-index: 100;
}
.results.open { display: block; }
.result-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; cursor: pointer; border-bottom: 1px solid #f0f0f0; transition: background 0.1s;
}
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: #f5f7ff; }
.result-item:active { background: #eef1ff; }
.result-item img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: #f5f5f5; }
.result-item .no-img { width: 48px; height: 48px; border-radius: 8px; background: #f0f0f0; }
.result-name { font-size: 16px; font-weight: 500; line-height: 1.3; }
.result-brand { font-size: 13px; color: #999; }

/* ─── List ───────────────────────────── */
.list-section { margin-top: 32px; }
.list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.list-header h2 { font-size: 18px; font-weight: 700; }
.list-header h2 span { font-weight: 400; color: #999; }
.list-actions { display: flex; gap: 8px; }

.share-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: none;
  background: #2563eb; color: white; font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.share-btn:hover { background: #1d4ed8; }
.share-btn svg { flex-shrink: 0; }

.clear-btn {
  padding: 8px 14px; border-radius: 10px; border: 1px solid #ddd;
  background: white; color: #999; font-family: 'Inter', sans-serif;
  font-size: 14px; cursor: pointer; transition: all 0.15s;
}
.clear-btn:hover { border-color: #e53; color: #e53; }

.items { display: flex; flex-direction: column; gap: 8px; }

.item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: white; border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  cursor: pointer; user-select: none; transition: all 0.2s;
}
.item:active { transform: scale(0.98); }
.item img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: #f5f5f5; }
.item-info { flex: 1; min-width: 0; }
.item-name { font-size: 15px; font-weight: 500; }

.item-check {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #ddd;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 14px; color: white; transition: all 0.2s;
}
.item-check.checked { background: #16a34a; border-color: #16a34a; }
.item-done { opacity: 0.45; }
.item-done .item-name { text-decoration: line-through; }

.item-remove {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: #fee; color: #e53; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.item-remove:hover { background: #fdd; }

.item-price { font-size: 14px; font-weight: 600; color: #16a34a; margin-top: 2px; }
.item-price.loading { color: #bbb; font-weight: 400; }
.item-chain { font-weight: 400; color: #999; font-size: 13px; }
.item-prices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.item-price-chip {
  font-size: 12px; padding: 2px 8px; border-radius: 10px;
  background: #f0f7f0; color: #16a34a; font-weight: 500;
}
.item-price-chip .item-chain { font-size: 11px; }

/* ─── Progress ───────────────────────── */
.progress-bar {
  height: 6px; background: #eee; border-radius: 3px;
  margin-bottom: 16px; overflow: hidden; position: relative;
}
.progress-fill { height: 100%; background: #16a34a; border-radius: 3px; transition: width 0.3s ease; }
.progress-done {
  position: absolute; top: 12px; left: 0; right: 0;
  text-align: center; font-size: 14px; font-weight: 600; color: #16a34a;
}

/* ─── Answer ─────────────────────────── */
.answer-section { margin-top: 32px; }
.answer-card { border-radius: 20px; overflow: hidden; }
.answer-best { background: #16a34a; color: white; padding: 28px 24px; text-align: center; }
.answer-best-label { font-size: 14px; font-weight: 500; opacity: 0.85; margin-bottom: 4px; }
.answer-best-chain { font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.answer-best-price { font-size: 24px; font-weight: 600; }
.answer-best-savings {
  margin-top: 8px; font-size: 15px; font-weight: 500;
  background: rgba(255,255,255,0.2); display: inline-block;
  padding: 4px 14px; border-radius: 20px;
}
.answer-others { background: white; padding: 16px 24px; }
.answer-chain {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid #f0f0f0;
}
.answer-chain:last-child { border-bottom: none; }
.answer-chain-name { font-size: 16px; font-weight: 600; }
.answer-chain-meta { font-size: 13px; color: #999; }
.answer-chain-price { font-size: 18px; font-weight: 700; text-align: right; }
.answer-chain-diff { font-size: 13px; color: #dc2626; font-weight: 500; }
.answer-note {
  text-align: center; padding: 16px; font-size: 13px; color: #999;
  background: white; border-top: 1px solid #f0f0f0;
}

/* ─── Toast ──────────────────────────── */
.toast {
  position: fixed; bottom: -60px; left: 50%; transform: translateX(-50%);
  background: #1a1a1a; color: white; padding: 12px 24px;
  border-radius: 12px; font-size: 14px; font-weight: 500;
  transition: bottom 0.3s ease; z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.toast.show { bottom: 24px; }

@media (max-width: 480px) {
  .search-section h1 { font-size: 24px; }
  .search-wrap input { font-size: 16px; padding: 16px 18px; }
  .answer-best-chain { font-size: 28px; }
  .list-header { flex-wrap: wrap; gap: 8px; }
}


/* ─── Header ─── */
.header { display: none; }
.header-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #1a1a1a; }
.header-logo-img { width: 28px; height: 28px; }
.header-logo-text { font-family: 'Noto Serif', serif; font-weight: 700; font-size: 18px; color: #1a1a1a; }
.header-beta { font-size: 10px; font-weight: 600; color: white; background: #059669; padding: 2px 6px; border-radius: 4px; }

/* ─── Answer Tabs ─── */
.answer-tabs { display: flex; gap: 4px; background: #f0f0f0; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.answer-tab { flex: 1; padding: 10px 12px; border: none; background: none; border-radius: 8px; font-size: 13px; font-weight: 500; color: #888; cursor: pointer; transition: all 0.15s; text-align: center; font-family: 'Inter', sans-serif; }
.answer-tab.active { background: white; color: #1a1a1a; box-shadow: 0 1px 3px rgba(0,0,0,0.1); font-weight: 600; }
.tab-badge { background: #dcfce7; color: #059669; font-size: 11px; padding: 2px 6px; border-radius: 8px; font-weight: 700; margin-left: 4px; }

/* ─── Smart Shopping ─── */
.smart-summary { background: linear-gradient(135deg, #059669, #10b981); color: white; border-radius: 14px; padding: 20px; margin-bottom: 12px; text-align: center; }
.smart-summary-price { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.smart-summary-label { font-size: 13px; opacity: 0.8; margin-top: 2px; }
.smart-savings-badge { display: inline-block; background: rgba(255,255,255,0.2); padding: 4px 14px; border-radius: 20px; font-size: 14px; font-weight: 700; margin-top: 8px; }

.smart-store { background: white; border-radius: 12px; border: 1px solid #e5e5e5; margin-bottom: 10px; overflow: hidden; }
.smart-store-header { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.smart-store-header span { font-size: 12px; color: #888; }
.smart-item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; }
.smart-item-img { width: 28px; height: 28px; object-fit: contain; border-radius: 4px; }
.smart-item-noimg { width: 28px; height: 28px; border-radius: 4px; background: #f0f0f0; }
.smart-item-name { flex: 1; font-size: 13px; color: #555; }
.smart-item-price { font-weight: 600; font-size: 13px; color: #059669; }

/* ─── Heading font ─── */
h1, h2 { font-family: 'Noto Serif', serif; }


/* ─── Design accents ─── */
.search-section h1 { color: #1a1a1a; }
.search-wrap input:focus { border-color: #059669; box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1); outline: none; }
.list-header h2 { color: #1a1a1a; }
.share-btn { background: #059669; color: white; border: none; padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.share-btn:hover { background: #047857; }
.share-btn svg { stroke: white; }
.item-check.checked { background: #059669; color: white; }
.progress-fill { background: linear-gradient(90deg, #059669, #10b981) !important; }
.item-price { color: #059669; }


/* ─── Glede & varme ─── */
body { background: linear-gradient(180deg, #ecfdf5 0%, #f0fdf4 40%, #f8fafc 100%) !important; min-height: 100vh; }


.search-section h1 { font-size: 28px; letter-spacing: -0.5px; }
.search-wrap input { background: white; border: 2px solid #e5e7eb; border-radius: 14px; font-size: 16px; }
.search-wrap input:focus { border-color: #059669; box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.08); }

.item { background: white; border-radius: 12px; margin-bottom: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); transition: transform 0.1s; }
.item:active { transform: scale(0.99); }

.answer-tabs { background: rgba(5, 150, 105, 0.08); }
.answer-tab.active { background: white; }

.answer-best { background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%); border-radius: 16px; }
.smart-summary { background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%); border-radius: 16px; }

.smart-store { border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.answer-chain { background: white; border-radius: 10px; margin-bottom: 4px; }

.progress-bar { border-radius: 8px; overflow: hidden; background: rgba(5, 150, 105, 0.1); }

.toast { background: #059669; border-radius: 12px; }

/* ─── Page Logo (inline) ─── */
.page-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; justify-content: center; margin-bottom: 8px; }
.page-logo-img { width: 26px; height: 26px; }
.page-logo-text { font-family: 'Noto Serif', serif; font-weight: 700; font-size: 17px; color: #1a1a1a; }

/* ─── Quick Suggestions ─── */
.quick-suggestions { text-align: center; margin-top: 16px; }
.quick-label { font-size: 13px; color: #888; margin-bottom: 10px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.quick-chip { background: white; border: 1.5px solid #e5e7eb; border-radius: 20px; padding: 8px 16px; font-size: 14px; cursor: pointer; transition: all 0.15s; font-family: 'Inter', sans-serif; color: #333; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.quick-chip:hover { border-color: #059669; background: #ecfdf5; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(5,150,105,0.12); }
.quick-chip:active { transform: scale(0.97); }

.quick-hint { font-size: 13px; color: #059669; margin-top: 14px; opacity: 0.7; }

/* ─── Search results hint ─── */
.results-hint { padding: 8px 16px; font-size: 12px; color: #059669; background: #ecfdf5; text-align: center; font-weight: 500; border-bottom: 1px solid #e5e7eb; }
.result-item { cursor: pointer; transition: background 0.1s; }
.result-item:hover { background: #f0fdf4; }
.result-item::after { content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; background: #059669; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; opacity: 0.8; }
.result-item { position: relative; padding-right: 52px !important; }

/* ─── Lagt til feedback ─── */
.result-added { background: #ecfdf5 !important; pointer-events: none; }
.result-added::after { content: '✓' !important; background: #059669 !important; opacity: 1 !important; }
.result-added .result-name::after { content: ' — lagt til!'; color: #059669; font-weight: 500; font-size: 13px; }

/* ─── Footer ─── */
.handle-footer { text-align: center; padding: 24px 16px 32px; font-size: 13px; color: #999; }
.handle-footer a { color: #059669; text-decoration: none; font-weight: 500; }
.handle-footer a:hover { text-decoration: underline; }
.footer-sep { margin: 0 8px; opacity: 0.4; }
.footer-meta { color: #bbb; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 20px; font-weight: 700; color: #111; margin: 0 0 8px; }
.empty-desc { font-size: 15px; color: #666; line-height: 1.5; margin: 0 0 20px; max-width: 360px; margin-left: auto; margin-right: auto; }
.empty-actions { margin-bottom: 16px; }
.empty-btn { display: inline-block; padding: 12px 24px; background: var(--accent, #2563eb); color: white; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 15px; }
.empty-btn:hover { opacity: 0.9; }
.empty-hint { font-size: 13px; color: #999; margin: 0; }
