/* Dealkompass — light, minimal, Inter-driven */

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

:root {
  --bg:           #fafafa;
  --bg-elev:      #ffffff;
  --bg-subtle:    #f4f4f5;
  --border:       #e5e7eb;
  --border-hover: #d4d4d8;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-soft:    #94a3b8;
  --accent:       #0f172a;
  --accent-soft:  #eff6ff;
  --primary:      #2563eb;
  --primary-hover:#1d4ed8;
  --success:      #16a34a;
  --danger:       #dc2626;
  --shadow-sm:    0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:       0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg:    0 12px 40px rgba(15, 23, 42, 0.08);
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    18px;
  --max-w:        1200px;
}

html { font-feature-settings: 'cv11', 'ss01', 'ss03'; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header > * { max-width: var(--max-w); }
.site-header { padding: 0.85rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header > .brand, .site-header > .header-nav { max-width: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--accent);
}

.brand-mark { width: 26px; height: 26px; color: var(--primary); }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }

.header-nav { display: flex; gap: 1.4rem; }
.header-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.header-nav a:hover { color: var(--text); }

/* ── Layout ─────────────────────────────────────────────────────────── */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section-head h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.section-sub { color: var(--text-muted); font-size: 0.85rem; }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  padding: 3rem 0 2rem;
  max-width: 720px;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.85rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 1rem;
}

.hero .subhead {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 600px;
}

.hero .updated {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* ── Deal of the Day ───────────────────────────────────────────────── */
.dod-section { margin-top: 1rem; }

.dod-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 320px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.dod-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-hover); }

.dod-card .dod-img {
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.dod-card .dod-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dod-card .dod-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}

.dod-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  padding: 0.3rem 0.65rem;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 99px;
}

.dod-shop { color: var(--text-muted); font-size: 0.85rem; font-weight: 500; }

.dod-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}

.dod-prices {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.dod-price-now { font-size: 2rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.dod-price-old { font-size: 1rem; color: var(--text-soft); text-decoration: line-through; }

.dod-discount {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  background: #ecfdf5;
  color: var(--success);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 6px;
}

.dod-actions { margin-top: 0.5rem; }

.dod-skeleton {
  background: linear-gradient(110deg, var(--bg-subtle) 30%, #fff 50%, var(--bg-subtle) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border: 1px solid var(--border);
}

@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-subtle); }

/* ── Categories ─────────────────────────────────────────────────────── */
.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 0.45rem 0.9rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cat-chip:hover { border-color: var(--border-hover); background: var(--bg-subtle); }

.cat-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.cat-chip .count {
  font-size: 0.72rem;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
}

.cat-chip.active .count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ── Deal grid ──────────────────────────────────────────────────────── */
.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 1.1rem;
}

.deal-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  position: relative;
}

.deal-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.deal-card .img-wrap {
  aspect-ratio: 1 / 1;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  z-index: 0;
}

.deal-card.site-rossmann .img-wrap {
  padding: 0.3rem;
}

.deal-card .img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.deal-card.site-rossmann .img-wrap img {
  width: 100%;
  height: 100%;
}

.deal-card:hover .img-wrap img { transform: scale(1.04); }

.deal-card .card-body {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.deal-card .shop {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.deal-card .title {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.55em;
}

.deal-card .price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.deal-card .price-now {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.deal-card .price-old { font-size: 0.82rem; color: var(--text-soft); text-decoration: line-through; }

.deal-card .badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: var(--success);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  letter-spacing: 0.02em;
  z-index: 2;
}

.deal-card .get-deal {
  margin-top: 0.6rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem;
  border-radius: 7px;
  width: 100%;
  text-align: center;
  transition: background 0.15s ease;
}

.deal-card .get-deal:hover { background: var(--primary-hover); }

/* ── Misc ───────────────────────────────────────────────────────────── */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 2rem auto;
}

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

.deal-grid.loading { min-height: 220px; display: flex; align-items: center; justify-content: center; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.footer-brand { display: flex; align-items: center; gap: 0.65rem; }
.footer-brand .brand-name { color: var(--text); }
.footer-tag { color: var(--text-muted); font-size: 0.85rem; }

.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-nav a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.15s ease;
}
.footer-nav a:hover { color: var(--text); }

.footer-copy { color: var(--text-soft); font-size: 0.78rem; }

/* ── Affiliate notice ──────────────────────────────────────────────── */
.affiliate-notice {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  z-index: 50;
}

/* ── Popup ─────────────────────────────────────────────────────────── */
.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.popup-overlay.open { display: flex; }

.popup-box {
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.18s ease-out;
}

@keyframes pop-in {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.popup-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-size: 1.4rem;
  color: var(--text-soft);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.popup-close:hover { background: var(--bg-subtle); color: var(--text); }

.popup-flag { font-size: 1.6rem; display: block; margin-bottom: 0.5rem; }

.popup-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  line-height: 1.4;
}

.popup-price {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.popup-note { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.25rem; }

.popup-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.popup-countdown-wrap { font-weight: 400; opacity: 0.85; font-size: 0.85rem; }
.popup-affiliate { margin-top: 1rem; font-size: 0.72rem; color: var(--text-soft); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .site-header { padding: 0.75rem 1rem; }
  .header-nav { display: none; }
  main { padding: 1.5rem 1rem 3rem; }
  .hero { padding: 2rem 0 1.5rem; }
  .dod-card { grid-template-columns: 1fr; min-height: 0; }
  .dod-card .dod-img { aspect-ratio: 16 / 10; padding: 1.25rem; }
  .dod-card .dod-body { padding: 1.5rem; }
  .deal-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .deal-card .card-body { padding: 0.7rem 0.75rem 0.85rem; }
  .deal-card .title { font-size: 0.85rem; }
  .deal-card .price-now { font-size: 1rem; }
}

@media (max-width: 420px) {
  .deal-grid { grid-template-columns: 1fr; }
}
