/* ── Rabattradar Design System ────────────────────────────── */

/* Self-hosted fonts — eliminates Google Fonts round-trips */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url('/static/fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url('/static/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --brand:        #E8420A;
  --brand-50:     #FFF4EE;
  --brand-100:    #FFE4D1;
  --brand-600:    #C43408;
  --navy:         #0D1B2A;
  --savings:      #22C55E;
  --savings-text: #15803D;
  --savings-light:#F0FDF4;
  --neutral-50:   #FAFAF8;
  --neutral-100:  #F3F1EE;
  --neutral-200:  #E8E5E0;
  --neutral-300:  #D4D0CA;
  --neutral-400:  #A8A39B;
  --neutral-500:  #7D786F;
  --neutral-600:  #5C5750;
  --neutral-700:  #3D3A34;
  --neutral-800:  #1F1D19;
  --shadow-card:  0 2px 8px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 20px rgba(0,0,0,0.10), 0 0 1px rgba(0,0,0,0.08);
  --shadow-orange:0 4px 24px rgba(232,66,10,0.22);
}

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

html { font-size: 16px; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--neutral-50);
  color: var(--neutral-800);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  min-height: 100vh;
}

/* ── Max-width mobile shell ─────────────────────────────────── */
.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--neutral-50);
  position: relative;
}

/* ── Typography ─────────────────────────────────────────────── */
.font-display { font-family: 'Bricolage Grotesque', Georgia, serif; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 14px 24px;
  background: var(--brand); color: #fff;
  border: none; border-radius: 999px;
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-orange);
  transition: background 150ms, box-shadow 150ms;
}
.btn-primary:hover { background: var(--brand-600); }
.btn-primary:active { background: #9D2A07; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 12px 24px;
  background: #fff; color: var(--neutral-700);
  border: 1.5px solid var(--neutral-200); border-radius: 999px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: border-color 150ms, background 150ms;
}
.btn-outline:hover { border-color: var(--neutral-400); background: var(--neutral-100); }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: none;
  color: var(--neutral-500); cursor: pointer;
  transition: background 150ms, color 150ms;
}
.btn-icon:hover { background: var(--neutral-100); color: var(--neutral-800); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1.5px solid var(--neutral-200);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.deal-card {
  background: #fff;
  border: 1.5px solid var(--neutral-200);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 150ms;
}
.deal-card:hover { box-shadow: var(--shadow-hover); }

/* ── List item ──────────────────────────────────────────────── */
.list-item {
  background: #fff;
  border: 1.5px solid var(--neutral-200);
  border-left: 4px solid var(--neutral-300);
  border-radius: 12px;
  overflow: hidden;
  transition: border-left-color 150ms;
}
.list-item.has-deal { border-left-color: var(--savings); }

/* ── Chips ──────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border-radius: 999px;
  border: 1.5px solid var(--neutral-200);
  background: #fff; color: var(--neutral-600);
  font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.chip:hover { border-color: var(--neutral-400); }
.chip-active {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
.chip-active:hover { background: #1a2f47; border-color: #1a2f47; }

/* ── Tag chips (small preference chips) ────────────────────── */
.tag-chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  border: 1.5px solid var(--neutral-200);
  background: #fff; color: var(--neutral-600);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.tag-chip.selected {
  background: var(--brand-50); color: var(--brand); border-color: var(--brand-100);
}

/* ── Input ──────────────────────────────────────────────────── */
.input-field {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--neutral-200); border-radius: 12px;
  background: #fff; color: var(--neutral-800);
  font-family: 'DM Sans', sans-serif; font-size: 15px;
  outline: none; transition: border-color 150ms, box-shadow 150ms;
}
.input-field::placeholder { color: var(--neutral-400); }
.input-field:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232,66,10,0.12);
}

/* ── Bottom nav ─────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: 64px; background: #fff;
  border-top: 1.5px solid var(--neutral-200);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}

.nav-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 16px; border-radius: 12px;
  color: var(--neutral-400); text-decoration: none;
  font-size: 11px; font-weight: 500;
  transition: color 150ms, background 150ms;
  min-width: 56px;
}
.nav-tab:hover { color: var(--neutral-700); background: var(--neutral-100); }
.nav-tab.active { color: var(--brand); }
.nav-tab svg { width: 22px; height: 22px; }

/* ── Savings banner ─────────────────────────────────────────── */
.savings-banner {
  background: var(--savings-light);
  border-bottom: 1.5px solid #BBF7D0;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Deal badge ─────────────────────────────────────────────── */
.deal-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand);
  font-size: 11px; font-weight: 700;
}

/* ── Chain dot ──────────────────────────────────────────────── */
.chain-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}

/* ── Basket badge (bottom nav count) ───────────────────────── */
.basket-badge {
  position: absolute; top: 4px; right: calc(50% - 18px);
  min-width: 16px; height: 16px; border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Plan stop card ─────────────────────────────────────────── */
.stop-card {
  background: #fff;
  border: 1.5px solid var(--neutral-200);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.stop-card-header {
  padding: 14px 16px;
  border-bottom: 1.5px solid var(--neutral-100);
  display: flex; align-items: center; gap: 10px;
}
.stop-number {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}

/* ── Stat pill ──────────────────────────────────────────────── */
.stat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 13px; font-weight: 500;
}

/* ── Hero section (home page) ───────────────────────────────── */
.hero {
  background: linear-gradient(145deg, #0D1B2A 0%, #1a3a5c 100%);
  padding: 48px 24px 32px;
  color: #fff;
}

/* ── Qty stepper ────────────────────────────────────────────── */
.qty-stepper {
  display: flex; align-items: center; gap: 8px;
}
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--neutral-100); border: 1.5px solid var(--neutral-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; cursor: pointer; color: var(--neutral-700);
  transition: background 150ms;
}
.qty-btn:hover { background: var(--neutral-200); }
.qty-value {
  font-size: 15px; font-weight: 600; min-width: 24px; text-align: center;
}

/* ── Unit price pill ────────────────────────────────────────── */
.unit-price {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  background: var(--neutral-100); color: var(--neutral-600);
  font-size: 11px; font-weight: 500; font-family: 'DM Sans', sans-serif;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff;
  padding: 10px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  z-index: 400; pointer-events: none;
  animation: toast-in 250ms ease, toast-out 250ms ease 2s forwards;
}
@keyframes toast-in  { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; } }

/* ── Onboarding (dark bg) ───────────────────────────────────── */
.onboarding-bg {
  background: linear-gradient(160deg, #0D1B2A 0%, #0a3a5c 100%);
  min-height: 100vh; color: #fff;
}

/* ── Utils ──────────────────────────────────────────────────── */
.pb-nav { padding-bottom: 80px; }
.divider { height: 1px; background: var(--neutral-100); }
.scrollable-x { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.scrollable-x::-webkit-scrollbar { display: none; }

/* ── Responsive: desktop left-sidebar nav (≥ 768 px) ─────────── */
@media (min-width: 768px) {
  /* Content area shifts right to make room for the nav sidebar */
  .app-shell {
    max-width: none;
    margin: 0 0 0 220px;
  }

  /* Bottom bar → fixed left sidebar */
  .bottom-nav {
    left: 0;
    top: 0;
    bottom: 0;
    transform: none;
    width: 220px;
    max-width: 220px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 28px 0;
    border-top: none;
    border-right: 1.5px solid var(--neutral-200);
    box-shadow: 2px 0 12px rgba(0,0,0,0.04);
  }

  /* Tabs become horizontal rows with a left-border active indicator */
  .nav-tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 0;
    min-width: auto;
    font-size: 14px;
    border-left: 3px solid transparent;
    position: relative;
  }
  .nav-tab:hover {
    background: var(--neutral-100);
    border-left-color: var(--neutral-300);
  }
  .nav-tab.active {
    color: var(--brand);
    background: var(--brand-50);
    border-left-color: var(--brand);
  }
  .nav-tab svg { width: 20px; height: 20px; flex-shrink: 0; }

  /* Basket badge: anchor to icon edge in horizontal layout */
  .basket-badge {
    top: 8px;
    left: 30px;
    right: auto;
  }

  /* Bottom padding no longer needed; small bottom margin instead */
  .pb-nav { padding-bottom: 24px; }
}
