/* ============================================================
   Kite.Deals — Stylesheet
   Dark ocean theme · Mobile-first · Zero dependencies
   ============================================================ */

/* ─── Custom Properties ─────────────────────────────────────── */
:root {
  --navy-950: #07101f;
  --navy-900: #0b1422;
  --navy-800: #111e33;
  --navy-700: #182642;
  --navy-600: #1e2f50;
  --border:   #1e3255;
  --border-2: #243b65;
  --text:     #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #5a7099;
  --teal:     #22d3ee;
  --teal-dim: rgba(34, 211, 238, 0.12);
  --teal-glow:rgba(34, 211, 238, 0.25);
  --sky:      #0ea5e9;
  --sky-hover:#0284c7;
  --green:    #34d399;
  --orange:   #fb923c;
  --font:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --r-sm:     8px;
  --r-md:     12px;
  --r-lg:     16px;
  --shadow:   0 4px 20px rgba(0, 0, 0, 0.5);
  --nav-h:    60px;
  --filter-h: 88px;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--navy-900);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
button { font-family: var(--font); }

/* ─── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── Nav ────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(7, 16, 31, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}
.logo__dot { color: var(--teal); }

.forecast-pill {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-dim);
  border: 1px solid var(--teal-glow);
  padding: 5px 13px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  background:
    linear-gradient(170deg,
      var(--navy-950) 0%,
      #0c2d48 40%,
      #08323c 70%,
      #0b2c38 100%);
  padding: 68px 0 60px;
  border-bottom: 1px solid var(--border);
}

.hero__inner { text-align: center; }

.hero__title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.08;
  color: #fff;
  margin-bottom: 14px;
}

.hero__title-br { display: none; }

.hero__sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 36px;
}

/* Search */
.search-wrap {
  max-width: 580px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--navy-800);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.search-box__icon {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 11px;
}

.search-box__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  padding: 16px 0;
  font-family: var(--font);
}

.search-box__input::placeholder { color: var(--text-muted); }

.search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, color 0.15s;
}
.search-clear--visible { opacity: 1; pointer-events: all; }
.search-clear:hover { color: var(--text); }

/* ─── Filters ────────────────────────────────────────────────── */
.filters {
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  background: var(--navy-800);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.filters__row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.filters__row:last-child { margin-bottom: 0; }

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Tab group */
.tab-group {
  display: flex;
  gap: 3px;
  background: var(--navy-700);
  padding: 3px;
  border-radius: var(--r-sm);
}

.tab {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.tab--active {
  background: var(--navy-900);
  color: var(--teal);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Select */
.filter-select {
  background: var(--navy-700);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  font-family: var(--font);
  padding: 6px 28px 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%235a7099' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s;
}
.filter-select:focus { border-color: var(--teal); }

/* Brand pills */
.brand-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy-700);
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.pill:hover { color: var(--text); border-color: var(--border-2); }

.pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Category pills (same shape as brand pills, teal accent when active) */
.pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cat-pill.pill--active {
  background: var(--teal-dim);
  border-color: var(--teal);
  color: var(--teal);
}

/* Dimmed brand pills when they don't apply to current sport/category */
.pill--dim {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* ─── Results section ────────────────────────────────────────── */
.results {
  padding: 32px 0 80px;
}

.results__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

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

.sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Cards grid */
.results__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

/* ─── Product Card ───────────────────────────────────────────── */
.card {
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-2);
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card__brand-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 10px;
  border-radius: 5px;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.card__tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--navy-700);
  color: var(--text-dim);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.card__title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
}

.card__desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.card__listings {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: auto;
}

/* ─── Listing rows ───────────────────────────────────────────── */
.listing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
}

.listing--best {
  background: var(--navy-700);
  border: 1.5px solid rgba(34, 211, 238, 0.18);
}

.listing--other {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
}

.listing--oos {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  opacity: 0.6;
}

.listing__left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.listing__badge {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
}

.listing__retailer {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

.listing__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.listing__price {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  white-space: nowrap;
}

.listing__price--secondary {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.listing__price--oos {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 500;
}

.listing__diff {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
}

.listing__oos-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: nowrap;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--sky);
  color: #fff;
}
.btn--primary:hover { background: var(--sky-hover); color: #fff; }

.btn--secondary {
  background: var(--navy-700);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn--secondary:hover { color: var(--text); border-color: var(--border-2); }

/* ─── No results ─────────────────────────────────────────────── */
.no-results {
  text-align: center;
  padding: 80px 20px;
}

.no-results__msg {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.btn--reset {
  background: var(--navy-800);
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.15s, border-color 0.15s;
}
.btn--reset:hover { color: var(--text); border-color: var(--border-2); }

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
  background: var(--navy-800);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer__logo { font-size: 1.2rem; }

.footer__disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 400px;
  margin-top: 8px;
  line-height: 1.55;
}

.footer__links {
  display: flex;
  gap: 20px;
  padding-top: 3px;
  flex-wrap: wrap;
}

.footer__links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.footer__links a:hover { color: var(--text); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (min-width: 600px) {
  .hero__title-br { display: inline; }
}

@media (max-width: 700px) {
  .hero { padding: 48px 0 44px; }

  .results__grid {
    grid-template-columns: 1fr;
  }

  .filters__row {
    gap: 12px;
  }

  .listing {
    flex-wrap: wrap;
  }
  .listing__right {
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .hero__title { font-size: 1.4rem; }
  .hero__sub   { font-size: 0.95rem; }
  .forecast-pill { display: none; }
  .container { padding: 0 14px; }
  .card { padding: 14px; }

  .listing__price { font-size: 1.1rem; }
  .btn { padding: 6px 11px; font-size: 0.75rem; }
}
