:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-strong: #eef2f7;
  --text: #101820;
  --muted: #617080;
  --line: rgba(16, 24, 32, 0.12);
  --primary: #0f7bff;
  --primary-strong: #005fd1;
  --accent: #ffb000;
  --good: #16a36a;
  --danger: #e33d3d;
  --shadow: 0 20px 60px rgba(24, 36, 54, 0.14);
}

.theme-dark {
  color-scheme: dark;
  --bg: #0d1117;
  --surface: #151b23;
  --surface-strong: #202a36;
  --text: #f4f7fb;
  --muted: #aab6c4;
  --line: rgba(244, 247, 251, 0.13);
  --primary: #4da1ff;
  --primary-strong: #76b8ff;
  --accent: #ffd166;
  --good: #35d18f;
  --danger: #ff6b6b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--bg) 92%, transparent), color-mix(in srgb, var(--surface-strong) 80%, transparent)),
    url("https://images.unsplash.com/photo-1518005020951-eccb494ad742?auto=format&fit=crop&w=1800&q=80") center/cover;
  opacity: 0.9;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.72;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 5vw, 64px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar .theme-toggle {
  width: auto;
  min-width: 42px;
  padding: 0 12px;
  gap: 8px;
}

.brand,
.nav,
.actions,
.hero-actions,
.store-comparison {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 0.82rem;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 28%, transparent);
}

.nav {
  gap: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.actions {
  gap: 10px;
}

.icon-button,
.close-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 1.15rem;
}

.ghost-button,
.secondary-button,
.primary-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 18px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 850;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 24%, transparent);
}

.primary-button:hover {
  background: var(--primary-strong);
}

.ghost-button,
.secondary-button {
  background: var(--surface);
  color: var(--text);
}

.hero {
  min-height: calc(100vh - 75px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
  align-items: end;
  gap: 32px;
  padding: clamp(58px, 8vw, 112px) clamp(18px, 5vw, 64px) 44px;
}

.hero-copy {
  max-width: 860px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 900px;
  margin-bottom: 20px;
  font-size: clamp(3rem, 8vw, 7.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4.6vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.28rem;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.26rem);
  line-height: 1.6;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.deal-spotlight {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.deal-spotlight img {
  display: block;
  width: 100%;
  height: 310px;
  object-fit: cover;
}

.spotlight-info {
  padding: 22px;
}

.badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
  font-weight: 850;
  font-size: 0.85rem;
}

.store-comparison {
  flex-wrap: wrap;
  gap: 8px;
}

.store-comparison span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.store-comparison strong,
.discount {
  color: var(--good);
}

.section,
.catalog-hero,
.catalog-layout {
  padding: 74px clamp(18px, 5vw, 64px);
}

.section {
  background: var(--bg);
}

.section-heading {
  margin-bottom: 26px;
}

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

.store-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.info-card,
.store-card,
.category-card,
.deal-card,
.sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 32px color-mix(in srgb, var(--text) 7%, transparent);
}

.info-card,
.store-card,
.category-card {
  padding: 24px;
}

.info-card strong,
.sidebar strong {
  display: block;
  margin: 8px 0 12px;
  font-size: 1.55rem;
}

.info-card p,
.store-card p,
.category-card p,
.sidebar p,
.deal-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.category-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.category-card .primary-button {
  width: max-content;
  margin-top: auto;
}

.accent {
  background: var(--text);
  color: var(--bg);
}

.accent p,
.accent .small-label {
  color: color-mix(in srgb, var(--bg) 72%, transparent);
}

.small-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.store-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--primary);
  font-weight: 950;
}

.catalog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: 28px;
  align-items: end;
}

.catalog-tools {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  padding-top: 0;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 22px;
}

.sidebar .primary-button {
  width: 100%;
  margin-top: 18px;
}

.result-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 850;
}

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

.deal-card {
  overflow: hidden;
  min-height: 440px;
  display: flex;
  flex-direction: column;
}

.deal-card img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: var(--surface-strong);
}

.deal-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

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

.deal-meta {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.deal-card h3 {
  margin-bottom: 8px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 16px 0;
}

.price {
  font-size: 1.4rem;
  font-weight: 950;
}

.old-price {
  color: var(--muted);
  text-decoration: line-through;
}

.deal-footer {
  margin-top: auto;
}

.deal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.compact-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.save-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0 12px;
  font-weight: 850;
}

.save-button.active {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  color: var(--text);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 5vw, 64px) 96px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 20px 40px rgba(37, 211, 102, 0.36);
  transition: transform 0.2s ease;
}

.whatsapp-float:hover {
  transform: translateY(-4px) scale(1.03);
}

.whatsapp-float svg {
  width: 34px;
  height: 34px;
  fill: white;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
}

.modal.open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}

.auth-dialog {
  position: relative;
  width: min(100%, 440px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-dialog h2 {
  margin-right: 38px;
  font-size: 1.55rem;
  line-height: 1.15;
}

.compare-dialog {
  width: min(100%, 620px);
}

.compare-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compare-row.best {
  border-color: color-mix(in srgb, var(--good) 60%, var(--line));
}

.compare-row strong,
.compare-row span {
  display: block;
}

.compare-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.4rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 22px 0 18px;
  padding: 5px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.tab.active {
  background: var(--primary);
  color: white;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 850;
}

.register-only {
  display: none;
}

.register-mode .register-only {
  display: grid;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.92rem;
}

.wide-button {
  width: 100%;
}

@media (max-width: 1120px) {
  .deal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .nav {
    display: none;
  }

  .hero,
  .catalog-hero,
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .account-grid,
  .category-grid,
  .deal-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 10px;
  }

  .brand span:last-child {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: 54px;
  }

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

  .deal-actions,
  .compare-row {
    grid-template-columns: 1fr;
  }

  .result-bar,
  .footer {
    flex-direction: column;
  }

  .whatsapp-float {
    right: 18px;
    bottom: 18px;
    width: 58px;
    height: 58px;
  }
}
