:root {
  color-scheme: light;
  --ink: #13171f;
  --muted: #656b76;
  --subtle: #8a909a;
  --line: #dfe2e7;
  --surface: #ffffff;
  --page: #f5f6f8;
  --accent: #b9f227;
  --accent-ink: #172000;
  --save: #067647;
  --save-bg: #eaf8ef;
  --danger: #b42318;
  --radius: 1.25rem;
  --shadow: 0 1rem 2.5rem rgba(19, 23, 31, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 20rem;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(19, 23, 31, 0.35);
  outline-offset: 3px;
}

.site-header,
main,
footer {
  width: min(100% - 2rem, 75rem);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.25rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  border-radius: 0.55rem;
  background: var(--ink);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 850;
}

.header-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(17rem, 0.65fr);
  gap: clamp(2rem, 8vw, 8rem);
  align-items: end;
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
}

.eyebrow {
  margin: 0 0 1.15rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.65rem, 6vw, 5.8rem);
  font-weight: 790;
  letter-spacing: -0.068em;
  line-height: 0.94;
}

.intro-copy > p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.freshness {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.35rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
}

.freshness-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 99px;
  background: var(--save);
  box-shadow: 0 0 0 4px rgba(6, 118, 71, 0.1);
}

.deals-section {
  padding-bottom: 5rem;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--ink);
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 1.5rem;
}

.deal-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 0 rgba(19, 23, 31, 0);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.deal-card:not(.skeleton):hover {
  transform: translateY(-3px);
  border-color: #c8ccd3;
  box-shadow: var(--shadow);
}

.deal-card.out-of-stock {
  opacity: 0.78;
}

.image-wrap {
  position: relative;
  display: grid;
  aspect-ratio: 1.2;
  place-items: center;
  overflow: hidden;
  background: #edeff2;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.deal-card:not(.out-of-stock):hover .product-image {
  transform: scale(1.025);
}

.image-fallback {
  display: grid;
  width: 5.25rem;
  height: 6.2rem;
  place-items: center;
  border: 0.42rem solid var(--ink);
  border-radius: 1.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.image-fallback::before,
.image-fallback::after {
  position: absolute;
  width: 2rem;
  height: 1.6rem;
  border-radius: 0.3rem;
  background: var(--ink);
  content: "";
}

.image-fallback::before {
  top: calc(50% - 4.65rem);
}

.image-fallback::after {
  bottom: calc(50% - 4.65rem);
}

.stock-pill {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 1;
  padding: 0.42rem 0.65rem;
  border: 1px solid rgba(19, 23, 31, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 750;
  backdrop-filter: blur(8px);
}

.stock-pill.unavailable {
  color: var(--danger);
}

.card-body {
  display: flex;
  min-height: 18.5rem;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem;
}

.retailer {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.deal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 690;
  letter-spacing: -0.018em;
  line-height: 1.4;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  align-items: baseline;
  margin-top: 1.3rem;
}

.current-price {
  font-size: 2rem;
  font-weight: 820;
  letter-spacing: -0.055em;
  line-height: 1;
}

.regular-price {
  color: var(--subtle);
  font-size: 0.9rem;
  text-decoration: line-through;
}

.savings {
  align-self: flex-start;
  margin: 0.85rem 0 0;
  padding: 0.42rem 0.62rem;
  border-radius: 0.55rem;
  background: var(--save-bg);
  color: var(--save);
  font-size: 0.77rem;
  font-weight: 800;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin-top: auto;
  padding-top: 1.5rem;
}

.checked-time {
  margin: 0;
  color: var(--subtle);
  font-size: 0.72rem;
  line-height: 1.35;
}

.deal-button,
.retry-button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.8rem;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.deal-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: center;
  padding: 0 0.95rem;
}

.deal-button::after {
  content: "↗";
  font-size: 1rem;
}

.deal-button[aria-disabled="true"] {
  cursor: not-allowed;
  background: #eceef1;
  color: var(--muted);
}

.deal-button[aria-disabled="true"]::after {
  content: none;
}

.message-panel {
  margin-top: 1.5rem;
  padding: 3.5rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
}

.message-panel h2 {
  margin: 0;
  font-size: 1.4rem;
}

.message-panel p {
  max-width: 35rem;
  margin: 0.75rem auto 0;
  color: var(--muted);
  line-height: 1.6;
}

.retry-button {
  margin-top: 1.25rem;
  padding: 0 1.1rem;
  cursor: pointer;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 0.72rem;
  line-height: 1.5;
}

footer p {
  margin: 0;
}

.skeleton {
  min-height: 31rem;
  padding: 1rem;
  pointer-events: none;
}

.skeleton-image,
.skeleton-line {
  border-radius: 0.65rem;
  background: linear-gradient(90deg, #eceef1 25%, #f7f8f9 50%, #eceef1 75%);
  background-size: 200% 100%;
  animation: loading 1.4s infinite linear;
}

.skeleton-image {
  aspect-ratio: 1.2;
}

.skeleton-line {
  height: 0.9rem;
  margin-top: 1rem;
}

.skeleton-line-short {
  width: 38%;
  margin-top: 1.4rem;
}

.skeleton-line-price {
  width: 55%;
  height: 2rem;
  margin-top: 1.6rem;
}

@keyframes loading {
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 56rem) {
  .intro {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .intro-copy {
    max-width: 37rem;
  }

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

@media (max-width: 38rem) {
  .site-header,
  main,
  footer {
    width: min(100% - 1.25rem, 75rem);
  }

  .site-header {
    min-height: 4.5rem;
  }

  .header-note {
    display: none;
  }

  .intro {
    padding: 3rem 0 2.75rem;
  }

  h1 {
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

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

  .card-body {
    min-height: 17rem;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
