:root {
  color-scheme: dark;
  --ink: #f7f9ff;
  --muted: #a7afc3;
  --surface: #111827;
  --surface-2: #192235;
  --line: rgba(255, 255, 255, .11);
  --lime: #c9ff4a;
  --cyan: #62e8ff;
  --danger: #ff5f78;
  --radius: 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 15%, rgba(98, 232, 255, .09), transparent 26%),
    radial-gradient(circle at 82% 80%, rgba(201, 255, 74, .08), transparent 26%),
    #090e19;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(390px, 640px) minmax(220px, 290px);
  justify-content: center;
  gap: clamp(16px, 3vw, 52px);
  width: 100%;
  height: 100dvh;
  padding: 18px clamp(18px, 4vw, 70px);
}

.feed-shell {
  position: relative;
  min-width: 0;
  height: calc(100dvh - 36px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 35px 100px rgba(0, 0, 0, .48);
}

.side-panel {
  align-self: center;
  min-width: 0;
}

.brand, .mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.brand strong, .mobile-brand strong { color: var(--lime); }

.brand__mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(#ff5368 0 45%, #101827 45% 55%, #f6f8ff 55%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1);
}

.brand__mark::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  background: #101827;
}

.brand__mark i {
  position: relative;
  width: 10px;
  height: 10px;
  border: 3px solid #101827;
  border-radius: 50%;
  background: #fff;
}

.eyebrow {
  margin: 64px 0 15px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

.side-panel h1 {
  max-width: 280px;
  margin: 0;
  font-size: clamp(30px, 3vw, 50px);
  line-height: .98;
  letter-spacing: -.055em;
}

.side-copy {
  max-width: 280px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.side-stats {
  display: flex;
  gap: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.side-stats div { display: grid; gap: 3px; }
.side-stats strong { font-size: 25px; }
.side-stats span { color: var(--muted); font-size: 12px; }

.keyboard-tip {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 38px;
  color: #778198;
  font-size: 11px;
}

kbd {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, .04);
}

.topbar {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px 18px 10px;
  background: linear-gradient(180deg, rgba(7, 12, 22, .94), rgba(7, 12, 22, .62) 72%, transparent);
  pointer-events: none;
}

.topbar > * { pointer-events: auto; }
.mobile-brand { display: none; }

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  background: rgba(15, 22, 36, .82);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  backdrop-filter: blur(16px);
}

.search:focus-within { border-color: rgba(201, 255, 74, .7); box-shadow: 0 0 0 3px rgba(201, 255, 74, .12); }
.search svg { width: 20px; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.8; }
.search input { width: 100%; border: 0; outline: 0; color: #fff; background: transparent; font-size: 14px; }
.search input::placeholder { color: #a1a9b9; }
.search input::-webkit-search-cancel-button { display: none; }

.clear-search {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, .09);
  cursor: pointer;
}

.clear-search[hidden] { display: none; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.store-filters {
  display: flex;
  flex: 1;
  gap: 7px;
  min-width: 0;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.store-filters::-webkit-scrollbar { display: none; }

.filter-chip, .sort-control select {
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  color: #e8ebf4;
  background: rgba(14, 20, 33, .76);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.filter-chip { padding: 0 12px; }
.filter-chip.is-active { border-color: var(--lime); color: #0a111d; background: var(--lime); }
.sort-control select { max-width: 108px; padding: 0 27px 0 11px; outline: 0; }

.feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}

.feed::-webkit-scrollbar { display: none; }
.cards { display: contents; }

.offer-card {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 560px;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #131a27;
  isolation: isolate;
}

.offer-card__image {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.015);
  transition: transform .7s ease;
}

.offer-card.is-current .offer-card__image { transform: scale(1.045); }

.offer-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 8, 16, .05) 22%, rgba(4, 8, 16, .24) 52%, rgba(4, 8, 16, .95) 92%),
    linear-gradient(90deg, rgba(4, 8, 16, .25), transparent 50%);
}

.offer-badges {
  position: absolute;
  top: 126px;
  left: 20px;
  display: flex;
  gap: 8px;
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  color: #0a111d;
  background: var(--lime);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  box-shadow: 0 8px 25px rgba(0, 0, 0, .18);
}

.badge--demo { color: #fff; background: rgba(16, 25, 42, .75); backdrop-filter: blur(10px); }

.offer-content {
  align-self: flex-end;
  width: calc(100% - 82px);
  padding: 30px 0 32px 22px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
}

.offer-store {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 750;
}

.store-dot {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  color: #111827;
  background: #fff;
  font-size: 12px;
  font-weight: 950;
  text-shadow: none;
}

.store-dot.amazon { color: #111; background: #ffb830; }
.store-dot.ml { color: #26356b; background: #ffe600; }
.store-dot.shopee { color: #fff; background: #ee4d2d; }

.offer-title {
  max-width: 475px;
  margin: 0 0 13px;
  font-size: clamp(22px, 3.2vw, 33px);
  line-height: 1.04;
  letter-spacing: -.04em;
}

.offer-price-line { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.offer-price { color: var(--lime); font-size: clamp(27px, 4vw, 38px); font-weight: 900; letter-spacing: -.04em; }
.offer-old-price { color: #c0c6d3; font-size: 13px; text-decoration: line-through; }
.offer-meta { display: flex; gap: 12px; margin: 7px 0 17px; color: #d9deea; font-size: 11px; }
.offer-meta span { display: flex; align-items: center; gap: 5px; }
.offer-meta span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); }

.store-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 190px;
  height: 48px;
  padding: 0 18px;
  border-radius: 15px;
  color: #0a111d;
  background: #fff;
  text-decoration: none;
  text-shadow: none;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 12px 35px rgba(0, 0, 0, .24);
  transition: transform .18s ease, background .18s ease;
}

.store-cta:hover { transform: translateY(-2px); background: var(--lime); }
.store-cta svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.action-rail {
  position: absolute;
  right: 16px;
  bottom: 32px;
  display: grid;
  gap: 16px;
  justify-items: center;
}

.action-wrap { display: grid; justify-items: center; gap: 5px; }
.action-wrap small { max-width: 58px; color: #f4f6fa; font-size: 9px; text-align: center; text-shadow: 0 2px 8px #000; }

.action-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  color: #fff;
  background: rgba(16, 24, 39, .58);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: transform .18s ease, background .18s ease;
}

.action-button:hover { transform: scale(1.07); background: rgba(27, 39, 61, .86); }
.action-button svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.action-button.is-favorite { color: var(--danger); background: #fff; }
.action-button.is-favorite svg { fill: currentColor; }
.action-button--whatsapp { color: #08140d; background: #54e883; border-color: transparent; }

.feed-sentinel { height: 1px; scroll-snap-align: none; }

.loading-card {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-content: center;
  grid-auto-flow: column;
  gap: 7px;
  background: #111827;
}

.loading-card[hidden] { display: none; }
.loading-card span { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); animation: bounce .8s infinite alternate; }
.loading-card span:nth-child(2) { animation-delay: .16s; }
.loading-card span:nth-child(3) { animation-delay: .32s; }
@keyframes bounce { to { transform: translateY(-10px); opacity: .45; } }

.empty-state {
  position: absolute;
  z-index: 15;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 30px;
  text-align: center;
  background: var(--surface);
}

.empty-state[hidden] { display: none; }
.empty-state__icon { display: grid; place-items: center; width: 68px; height: 68px; border: 2px dashed var(--lime); border-radius: 50%; color: var(--lime); font-size: 28px; font-weight: 900; }
.empty-state h2 { margin: 18px 0 5px; }
.empty-state p { max-width: 300px; color: var(--muted); font-size: 13px; }
.empty-state button { margin-top: 12px; padding: 12px 18px; border: 0; border-radius: 12px; color: #101827; background: var(--lime); font-weight: 800; cursor: pointer; }

.toast {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 22px;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #fff;
  background: rgba(12, 18, 30, .94);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: .2s ease;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.status-card, .stores-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(17, 24, 39, .58);
  backdrop-filter: blur(12px);
}

.status-card { padding: 20px; }
.live-line { color: var(--lime); font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.live-line span { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.status-card h2 { margin: 16px 0 12px; font-size: 20px; line-height: 1.16; letter-spacing: -.035em; }
.status-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.stores-card { margin-top: 14px; padding: 20px; }
.stores-card > p { margin: 0 0 15px; color: #7f899d; font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.stores-card > div { display: grid; grid-template-columns: 30px 1fr; align-items: center; column-gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.stores-card strong { font-size: 12px; }
.stores-card small { grid-column: 2; color: #7f899d; font-size: 9px; }
.stores-card small.is-ready { color: var(--lime); }
.disclaimer { margin: 15px 4px; color: #667188; font-size: 9px; line-height: 1.55; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: minmax(180px, 240px) minmax(390px, 590px); }
  .side-panel--right { display: none; }
}

@media (max-width: 760px) {
  .app-shell { display: block; height: 100dvh; padding: 0; }
  .side-panel { display: none; }
  .feed-shell { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .mobile-brand { display: flex; margin-bottom: 10px; font-size: 14px; }
  .mobile-brand .brand__mark { width: 27px; height: 27px; flex-basis: 27px; border-width: 2px; }
  .topbar { padding: max(10px, env(safe-area-inset-top)) 12px 8px; }
  .search { height: 43px; border-radius: 14px; }
  .filter-row { margin-top: 7px; }
  .filter-chip { padding: 0 11px; }
  .sort-control { display: none; }
  .offer-card { min-height: 100dvh; }
  .offer-badges { top: 155px; left: 16px; }
  .offer-content { width: calc(100% - 72px); padding: 24px 0 calc(22px + env(safe-area-inset-bottom)) 17px; }
  .offer-title { font-size: clamp(23px, 7.5vw, 31px); }
  .offer-price { font-size: 31px; }
  .action-rail { right: 12px; bottom: calc(24px + env(safe-area-inset-bottom)); gap: 13px; }
  .action-button { width: 45px; height: 45px; }
  .store-cta { height: 46px; }
}

@media (max-height: 660px) and (max-width: 760px) {
  .mobile-brand { display: none; }
  .offer-badges { top: 106px; }
  .offer-content { padding-bottom: 17px; }
  .offer-title { margin-bottom: 7px; font-size: 21px; }
  .offer-meta { margin: 4px 0 10px; }
  .action-rail { bottom: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
