/* styles.css — DealRadar. Dunkles Radar-Theme (grüner Akzent).
 * Shop-Karten-Regeln portiert aus notebook-web/report.css, Schublade aus notebook-web. */

:root {
  --bg: #0a141c;
  --bg-2: #0e1f29;
  --panel: #102530;
  --panel-2: #15323f;
  --border: #1d4a44;
  --text: #e9f6f1;
  --muted: #8fb3ab;
  --accent: #28e0a0;       /* Radar-Grün */
  --accent-2: #1bb381;
  --danger: #ef5350;
  --fav: #ff5a8a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 62px;
  --drawer-w: 280px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Trebuchet MS", sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--accent); }

/* ============ Splash ============ */
#splash {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background: radial-gradient(120% 80% at 50% 20%, #14323a 0%, var(--bg) 70%);
  transition: opacity .45s ease; padding: var(--safe-top) 16px var(--safe-bot);
}
#splash.hide { opacity: 0; pointer-events: none; }
.splash-img {
  width: min(72vw, 300px); aspect-ratio: 1/1; object-fit: cover;
  border-radius: 28px; border: 3px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.splash-name {
  font-size: 27px; font-weight: 800; letter-spacing: .3px; margin: 0;
}
.splash-name span { color: var(--accent); }
.splash-sub { color: var(--muted); font-size: 13px; margin: -10px 0 0; }
.splash-spin {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ App-Shell ============ */
.app { display: none; }
body.authed .app { display: block; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-top) + 10px) 14px 10px;
  background: rgba(12,26,31,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; }
.topbar .brand img { width: 28px; height: 28px; border-radius: 8px; }
.topbar .brand span { color: var(--accent); }
.topbar .spacer { flex: 1; }
.icon-btn {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
  width: 38px; height: 38px; border-radius: 11px; font-size: 17px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:active { transform: scale(.94); }

/* NICHT sticky: zwei sticky-Leisten auf top:0 (Topbar + Toolbar) würden sich
   überlagern und das Suchfeld hinter der opaken Topbar verstecken. */
.toolbar {
  display: flex; gap: 9px; align-items: center;
  padding: 11px 14px;
}
.lang-sel {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 11px; padding: 7px 9px; font-size: 13px; outline: none; max-width: 42vw;
}
.lang-sel:focus { border-color: var(--accent); }
.tab-title { font-size: 20px; font-weight: 800; margin: 14px 14px 2px; }
.tab-sub { color: var(--muted); font-size: 13px; margin: 0 14px 6px; }
.shop-search, .shop-sort {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 11px; padding: 9px 12px; font-size: 14px; outline: none;
}
.shop-search { flex: 1 1 auto; min-width: 0; }
.shop-search:focus, .shop-sort:focus { border-color: var(--accent); }

/* ============ Inhalt / Grid ============ */
.content { padding: 0 14px calc(var(--tabbar-h) + var(--safe-bot) + 24px); }
.shop-grid {
  display: grid; gap: 13px;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
}
@media (min-width: 720px) { .shop-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }

.empty {
  text-align: center; color: var(--muted); padding: 60px 20px;
}
.empty-icon { font-size: 44px; opacity: .6; }

/* ---- Shop-Karte (portiert aus report.css, angepasst) ---- */
.shop-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: 15px;
  overflow: hidden; transition: transform .12s, border-color .12s, box-shadow .12s;
}
.shop-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.shop-badges {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
}
.shop-badge {
  font-size: 11px; font-weight: 800;
  color: #04121c; background: var(--accent); padding: 3px 9px; border-radius: 999px;
}
.shop-badge--drop { background: #ffb020; }
.shop-price-was { text-decoration: line-through; color: var(--muted); font-weight: 600; font-size: .8em; }
.card-acts { position: absolute; top: 7px; right: 7px; z-index: 3; display: flex; gap: 6px; }
.card-act {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px;
  border: none; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(6,16,20,.62); color: #fff; backdrop-filter: blur(3px);
}
.card-act:active { transform: scale(.9); }
.card-fav.is-on { background: rgba(255,90,138,.92); }
.card-excl:hover { background: rgba(239,83,80,.9); }
.card-restore { background: rgba(28,194,212,.85); color: #04121c; }

.shop-thumb {
  width: 100%; aspect-ratio: 4/3; background: var(--bg-2);
  position: relative; overflow: hidden; align-items: center; justify-content: center; display: flex;
  cursor: pointer; text-decoration: none;
}
.shop-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.shop-thumb-ph { font-size: 30px; opacity: .5; }
.shop-info { display: flex; flex-direction: column; gap: 6px; padding: 11px 12px 13px; }
.shop-title { margin: 0; font-size: 14.5px; line-height: 1.25; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-title a { color: var(--text); text-decoration: none; }
.shop-title a:hover { color: var(--accent); }
.shop-price { font-size: 16px; font-weight: 800; color: var(--accent); }
.shop-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.shop-chip {
  font-size: 11px; padding: 2px 7px; border-radius: 7px;
  background: var(--bg-2); color: var(--muted); border: 1px solid var(--border);
}
.shop-chip--source { color: var(--text); border-color: var(--accent); }
.shop-chip--spec b { color: var(--text); font-weight: 700; }
.shop-note { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.shop-cta {
  margin-top: 4px; align-self: flex-start; font-size: 13px; font-weight: 700;
  color: var(--accent); text-decoration: none;
}

/* ============ Bottom-Tab-Nav ============ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-bot)); padding-bottom: var(--safe-bot);
  background: rgba(12,26,31,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.tab-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; position: relative; padding-top: 6px;
}
.tab-btn .ti { font-size: 20px; line-height: 1; }
.tab-btn.is-active { color: var(--accent); }
.tab-btn.is-active .ti { transform: translateY(-1px); }
.tab-count {
  position: absolute; top: 3px; left: 50%; margin-left: 6px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: #04121c; font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.tab-count.zero { display: none; }
.tab-btn[data-tab="excluded"] .tab-count { background: var(--danger); color: #fff; }
.tab-btn[data-tab="fav"] .tab-count { background: var(--fav); color: #fff; }

/* ============ Detailseite ============ */
body.detail-open { overflow: hidden; }
.detail {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--safe-bot) + 24px);
}
.dt-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: rgba(12,26,31,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.dt-back {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 11px; padding: 8px 14px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.dt-back:active { transform: scale(.96); }
/* Galerie: horizontal wischbar, alle Bilder */
.dt-gallery {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 12px 14px; -webkit-overflow-scrolling: touch;
}
.dt-shot {
  flex: 0 0 88%; scroll-snap-align: center; aspect-ratio: 4/3;
  background: var(--bg-2); border-radius: 14px; overflow: hidden; border: 1px solid var(--border);
}
.dt-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dt-noimg { color: var(--muted); text-align: center; padding: 30px; }
.dt-body { max-width: 760px; margin: 0 auto; padding: 6px 16px 0; }
.dt-title { font-size: 22px; line-height: 1.25; margin: 6px 0 8px; }
.dt-price { font-size: 22px; font-weight: 800; color: var(--accent); margin-bottom: 10px; }
.dt-chips { margin-bottom: 14px; }
.dt-h { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin: 18px 0 6px; }
.dt-desc { font-size: 15px; line-height: 1.55; color: var(--text); white-space: normal; }
.dt-open {
  display: inline-block; margin: 22px 0 0; padding: 12px 18px;
  background: var(--accent); color: #04121c; border-radius: 12px;
  font-weight: 800; text-decoration: none;
}
.dt-open:active { transform: scale(.98); }
@media (min-width: 720px) { .dt-shot { flex-basis: 420px; } }

/* ============ Schublade (Suchen-Navigation, Notebook-Idee) ============ */
.topbar #menuBtn { margin-right: 2px; }
.search-name {
  margin: 14px 14px 2px; font-size: 20px; font-weight: 800; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.search-name::after { content: "▾"; color: var(--accent); font-size: 15px; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 120; width: var(--drawer-w);
  max-width: 86vw; background: var(--bg-2); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform .22s ease;
  display: flex; flex-direction: column; padding-top: var(--safe-top);
  overflow-y: auto;
}
body.nav-open .sidebar { transform: translateX(0); }
.sidebar-head {
  display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.sidebar-head .brand { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 9px; }
.sidebar-head .brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand span { color: var(--accent); }
.searchnav { flex: 1; padding: 8px 0; }
.nav-group-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  padding: 12px 16px 4px;
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 16px; cursor: pointer; border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--panel); }
.nav-item.is-active { background: var(--panel); border-left-color: var(--accent); }
.nav-item .ni-name { font-size: 15px; font-weight: 600; }
.nav-item .ni-count {
  font-size: 11px; font-weight: 800; color: #04121c; background: var(--accent);
  border-radius: 999px; min-width: 20px; height: 19px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-foot { padding: 12px 16px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }
.scrim {
  position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
body.nav-open .scrim { opacity: 1; pointer-events: auto; }
