:root {
  color-scheme: light;
  --bg: #f2f5f1;
  --ink: #111512;
  --muted: #657067;
  --panel: #ffffff;
  --line: #d9dfd7;
  --soft: #eef4eb;
  --accent: #0f7b63;
  --accent-strong: #095f4c;
  --orange: #d97706;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(33, 45, 38, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(120deg, rgba(15, 123, 99, 0.11), transparent 34%),
    linear-gradient(300deg, rgba(217, 119, 6, 0.10), transparent 30%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.search-surface {
  min-height: min(720px, calc(100vh - 24px));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 38px;
  padding: 2px 0 42px;
}

.brand-row,
.hero-grid,
.results-head,
.input-row,
.quick-row,
.price-row,
.meta-row {
  display: flex;
}

.brand-row {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.extension-link,
.amazon-back {
  color: inherit;
  text-decoration: none;
}

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

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.extension-link,
.amazon-back {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.68);
  color: #2c342f;
  font-size: 14px;
  font-weight: 800;
}

.hero-grid {
  align-items: center;
  justify-content: space-between;
  gap: 34px;
}

.hero-copy {
  flex: 1 1 520px;
  min-width: 0;
}

.eyebrow,
.section-label,
.hint,
.state,
.product-meta,
.meta-row {
  color: var(--muted);
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 710px;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 0.94;
}

.lede {
  max-width: 570px;
  margin-top: 18px;
  color: #3f4942;
  font-size: 20px;
}

.search-box {
  flex: 1 1 470px;
  max-width: 550px;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(17, 21, 18, 0.09);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.search-box label {
  font-size: 13px;
  font-weight: 900;
}

.input-row {
  min-height: 56px;
  gap: 8px;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 123, 99, 0.14);
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.input-row button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 118px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
}

.input-row button:hover {
  background: var(--accent-strong);
}

.quick-row {
  flex-wrap: wrap;
  gap: 8px;
}

.quick-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 0 11px;
  background: var(--soft);
  color: #26302a;
  font-size: 13px;
}

.hint {
  min-height: 24px;
  font-size: 14px;
}

.results-panel {
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
}

.results-head {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.results-head h2 {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
}

.state {
  min-height: 230px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  border: 1px dashed #c7d0c4;
  border-radius: 8px;
  background: rgba(238, 244, 235, 0.66);
  padding: 28px;
  text-align: center;
}

.state-visual {
  position: relative;
  width: 190px;
  height: 118px;
}

.state-visual span {
  position: absolute;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(33, 45, 38, 0.1);
}

.state-visual span:nth-child(1) {
  inset: 20px 72px 4px 0;
}

.state-visual span:nth-child(2) {
  inset: 0 36px 26px 38px;
}

.state-visual span:nth-child(3) {
  inset: 32px 0 14px 82px;
}

.loader {
  width: 38px;
  height: 38px;
  border: 4px solid #d5ddd2;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.error-state {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff3f0;
  color: var(--red);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  padding: 8px 0 18px;
  overflow: hidden;
}

.result-column {
  display: grid;
  gap: 14px;
  min-width: 0;
  transform: translate3d(0, var(--elastic-y, 0px), 0);
  transition: transform 0.18s ease-out;
  will-change: transform;
}

.result-column:nth-child(odd) {
  padding-top: 28px;
}

.result-column:nth-child(4n + 2) {
  padding-top: 56px;
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-image {
  aspect-ratio: 1 / 1;
  display: block;
  width: 100%;
  object-fit: cover;
  background: var(--soft);
}

.product-body {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.product-body h3 {
  display: -webkit-box;
  min-height: 44px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.price-row,
.meta-row {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.price {
  color: var(--orange);
  font-size: 20px;
  font-weight: 950;
}

.original-price {
  color: var(--muted);
  font-size: 13px;
  text-decoration: line-through;
}

.meta-row {
  min-height: 22px;
  font-size: 13px;
}

.product-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.product-link:hover {
  background: #2a312d;
}

@media (prefers-reduced-motion: reduce) {
  .result-column {
    transform: none !important;
    transition: none;
  }
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .hero-grid {
    display: grid;
  }

  .search-box {
    max-width: none;
  }

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

  .result-column:nth-child(4n + 2) {
    padding-top: 0;
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 24px, 1180px);
    padding-top: 14px;
  }

  .search-surface {
    min-height: auto;
    gap: 26px;
    padding-bottom: 28px;
  }

  .input-row {
    display: grid;
    min-height: 0;
  }

  .input-row input,
  .input-row button {
    min-height: 52px;
  }

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

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

@media (max-width: 430px) {
  h1 {
    font-size: 42px;
  }

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

  .result-column {
    padding-top: 0 !important;
  }
}
