:root {
  color-scheme: light;
  --ink: #221d22;
  --muted: #6e6570;
  --line: #dfd8de;
  --paper: #fffafa;
  --surface: #ffffff;
  --rose: #ba365b;
  --coral: #e06c5b;
  --moss: #637d56;
  --teal: #387d82;
  --gold: #c68c2e;
  --shadow: 0 18px 45px rgba(46, 31, 41, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(34, 29, 34, 0.08);
  background: rgba(255, 250, 250, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 0.76rem;
  letter-spacing: 0;
}

nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 3vw, 32px);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}

.icon-button {
  display: inline-grid;
  min-width: 42px;
  height: 42px;
  grid-auto-flow: column;
  place-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.hero {
  position: relative;
  min-height: clamp(520px, 72vh, 760px);
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(34, 29, 34, 0.84), rgba(34, 29, 34, 0.38) 48%, rgba(34, 29, 34, 0.12)),
    linear-gradient(0deg, rgba(255, 250, 250, 0.95), rgba(255, 250, 250, 0) 34%);
}

.hero-content {
  position: relative;
  width: min(760px, calc(100% - 36px));
  margin: 0 0 clamp(76px, 13vh, 128px) clamp(18px, 7vw, 92px);
  color: white;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffd8df;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 24px;
  font-size: clamp(2.5rem, 5.6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.search-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  width: min(660px, 100%);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.search-panel input {
  min-width: 0;
  border: 0;
  padding: 14px 16px;
  background: transparent;
  color: var(--ink);
  outline: 0;
}

.search-panel button,
.copy-button {
  border: 0;
  border-radius: 7px;
  background: var(--rose);
  color: white;
  font-weight: 800;
  padding: 0 18px;
}

.quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.quick-stats span {
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(34, 29, 34, 0.28);
  backdrop-filter: blur(10px);
}

.toolbar,
.content-grid,
.brand-strip {
  width: min(1180px, calc(100% - 36px));
  margin-inline: auto;
}

.toolbar {
  display: grid;
  gap: 18px;
  padding: 28px 0 18px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-tabs button,
.text-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
  padding: 0 14px;
  white-space: nowrap;
}

.category-tabs button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.controls-row label,
.range-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.toggle {
  grid-auto-flow: column;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.content-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: start;
  gap: 24px;
  padding-bottom: 34px;
}

.deal-sidebar,
.results-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(46, 31, 41, 0.08);
}

.deal-sidebar {
  position: sticky;
  top: 88px;
  padding: 20px;
}

.deal-sidebar h2 {
  font-size: 1.1rem;
}

.range-label {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-top: 18px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--rose);
}

.preference-list {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.preference-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 650;
}

.spotlight {
  border-radius: 8px;
  background: #f5eef1;
  padding: 16px;
}

.spotlight span {
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.spotlight strong {
  display: block;
  margin: 8px 0;
}

.spotlight p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.results-panel {
  min-width: 0;
  padding: 22px;
}

.results-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.results-heading h2,
.brand-strip h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.deal-card {
  display: grid;
  gap: 12px;
  min-height: 360px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.deal-top,
.meta-row,
.coupon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.category {
  border-radius: 999px;
  background: #eef5f4;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  padding: 6px 10px;
}

.save-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--rose);
  font-size: 1.1rem;
}

.save-button.saved {
  background: var(--rose);
  color: white;
}

.deal-card h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.brand-line,
.description,
.expires,
.empty-state {
  color: var(--muted);
  line-height: 1.5;
}

.brand-line {
  margin-bottom: 0;
  font-weight: 750;
}

.discount {
  color: var(--rose);
  font-size: 1.6rem;
  font-weight: 900;
}

.price {
  color: var(--moss);
  font-weight: 850;
}

.description {
  margin-bottom: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span {
  border-radius: 999px;
  background: #f8f3e9;
  color: #805e19;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 5px 8px;
}

.coupon-row,
.shop-link {
  margin-top: auto;
}

.coupon-row {
  border: 1px dashed #cfc2c9;
  border-radius: 8px;
  padding: 8px;
}

code {
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  min-height: 34px;
}

.shop-link {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 850;
}

.expires {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.brand-strip,
.trust-strip {
  display: grid;
  grid-template-columns: minmax(240px, 0.6fr) 1fr;
  gap: 24px;
  align-items: center;
  padding: 28px 0 56px;
}

.brand-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.brand-pill {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 850;
}

.trust-strip {
  grid-template-columns: 1fr auto auto auto;
  margin-bottom: 44px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.trust-strip div {
  display: grid;
  gap: 4px;
}

.trust-strip span,
.trust-strip a {
  color: var(--muted);
  font-weight: 700;
}

.legal-page {
  width: min(840px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(48px, 9vw, 86px) 0;
}

.legal-page h1 {
  color: var(--ink);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}

.legal-page section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.legal-page h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.legal-page p {
  color: var(--muted);
  line-height: 1.7;
}

.saved-item a {
  display: inline-block;
  margin-top: 10px;
  color: var(--rose);
  font-weight: 850;
}

.saved-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(390px, 100%);
  height: 100dvh;
  padding: 20px;
  background: white;
  box-shadow: -20px 0 50px rgba(34, 29, 34, 0.18);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.saved-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.saved-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.saved-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.saved-item strong {
  display: block;
}

.saved-item span {
  color: var(--rose);
  font-weight: 850;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(34, 29, 34, 0.38);
}

@media (max-width: 980px) {
  .content-grid,
  .brand-strip,
  .trust-strip {
    grid-template-columns: 1fr;
  }

  .deal-sidebar {
    position: static;
  }

  .deal-grid,
  .brand-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  nav {
    display: none;
  }

  .hero {
    min-height: 620px;
  }

  .hero-content {
    margin: 0 auto 78px;
  }

  .search-panel {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .search-panel button {
    min-height: 44px;
  }

  .controls-row,
  .controls-row label:not(.toggle),
  .controls-row select {
    width: 100%;
  }

  .deal-grid,
  .brand-list {
    grid-template-columns: 1fr;
  }

  .results-heading {
    align-items: start;
    flex-direction: column;
  }
}
