.grocery-hero {
  min-height: 620px;
  background: var(--yellow);
}

.grocery-hero::before {
  opacity: 0.1;
}

.grocery-hero h1 span {
  color: var(--paper);
}

.grocery-hero-art {
  isolation: isolate;
}

.grocery-basket-card {
  position: relative;
  overflow: hidden;
}

.grocery-character {
  width: 84%;
  height: 84%;
  object-fit: contain;
}

.grocery-bubble {
  z-index: 2;
  width: 112px;
  font-family: "Yarden", Arial, sans-serif;
  font-size: 1.08rem;
}

.grocery-unit { top: 8%; right: 0; transform: rotate(7deg); }
.grocery-delivery { right: 0; bottom: 7%; transform: rotate(-8deg); }
.grocery-stock { bottom: 13%; left: -3%; transform: rotate(6deg); }

.grocery-star {
  left: -5%;
  width: 50px;
}

.grocery-plans {
  display: flex;
  flex-direction: column;
  padding-top: 58px;
  background: var(--yellow);
  scroll-margin-top: 96px;
}

.grocery-plans .plans-heading {
  order: 1;
  margin-bottom: 30px;
}

.grocery-plans .plans-heading h2 {
  font-size: clamp(3rem, 5.4vw, 5.1rem);
}

.grocery-plans .plan-grid {
  order: 3;
  width: 100%;
  margin-top: 86px;
}

.live-comparison {
  width: min(1180px, calc(100% - 44px));
  margin: 24px auto 36px;
  scroll-margin-top: 112px;
  padding: clamp(24px, 4vw, 52px);
  border: 5px solid var(--ink);
  border-radius: 48px;
  box-shadow: 14px 16px 0 var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.live-comparison-heading,
.basket-breakdown-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.live-comparison-heading {
  padding-bottom: 24px;
  border-bottom: 3px solid var(--ink);
}

.live-comparison-heading p,
.basket-breakdown-title p {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 5px;
  font-size: 0.92rem;
  font-weight: 800;
}

.live-comparison-heading h2 {
  margin: 0;
  font-family: "Yarden", Arial, sans-serif;
  font-size: clamp(2.15rem, 4vw, 4rem);
  line-height: 0.95;
}

.live-pulse {
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #6fd669;
  box-shadow: 0 0 0 5px rgba(111, 214, 105, 0.22);
  animation: grocery-live-pulse 2.4s ease-in-out infinite;
}

@keyframes grocery-live-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(111, 214, 105, 0.18); }
  50% { box-shadow: 0 0 0 9px rgba(111, 214, 105, 0); }
}

.live-updated {
  max-width: 310px;
  font-size: 0.9rem;
  text-align: left;
}

.live-loading,
.live-error {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: right;
}

.live-loading[hidden],
.live-error[hidden],
.live-results[hidden] {
  display: none;
}

.live-loading strong,
.live-error strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.live-loading span:not(.loading-coin),
.live-error p {
  margin: 0;
  opacity: 0.7;
}

.loading-coin {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 4px solid var(--ink);
  border-radius: 50%;
  box-shadow: 7px 7px 0 var(--ink);
  background: var(--yellow);
  font-family: "Yarden", Arial, sans-serif;
  font-size: 2.1rem;
  animation: grocery-coin-spin 2.8s linear infinite;
}

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

.winner-card {
  margin: 30px 0 22px;
  padding: clamp(24px, 4vw, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 4px solid var(--ink);
  border-radius: 36px;
  box-shadow: 10px 11px 0 var(--ink);
  background: var(--yellow);
}

.winner-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 7px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.82rem;
  font-weight: 800;
}

.winner-copy h2 {
  margin: 0;
  font-family: "Yarden", Arial, sans-serif;
  font-size: clamp(3rem, 6vw, 6rem);
  line-height: 0.9;
}

.winner-brand,
.chain-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.winner-logo-frame,
.retailer-logo-frame,
.online-retailer-logo {
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border: 3px solid var(--ink);
  background: #fff;
}

.winner-logo-frame {
  width: 88px;
  height: 88px;
  border-radius: 24px;
}

.winner-logo-frame[hidden] {
  display: none;
}

.winner-logo-frame img,
.retailer-logo,
.online-retailer-logo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.winner-logo-frame img {
  padding: 8px;
  max-height: 82px;
}

.retailer-logo {
  max-height: 34px;
}

.online-retailer-logo img {
  max-height: 54px;
}

.winner-copy p {
  margin: 12px 0 0;
  font-weight: 700;
}

.winner-price {
  min-width: 220px;
  text-align: left;
}

.winner-price strong,
.winner-price span {
  display: block;
}

.winner-price strong {
  white-space: nowrap;
  font-family: "Yarden", Arial, sans-serif;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 1;
}

.winner-price span {
  margin-top: 6px;
  font-weight: 700;
}

.grocery-alternatives h2 { margin: 30px 0 0; font-size: clamp(1.5rem, 3vw, 2.25rem); }

.chain-ranking {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 10px 0 38px;
}

.chain-card {
  min-height: 154px;
  padding: 20px;
  display: grid;
  align-content: start;
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: #fffdf7;
}

.chain-shop-link {
  justify-self: start;
  margin-top: 12px;
  padding: 10px 18px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 5px 0 var(--ink);
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.chain-shop-link:hover,
.chain-shop-link:focus-visible {
  transform: translateY(2px);
  box-shadow: 2px 3px 0 var(--ink);
}

.winner-shop-link {
  display: inline-block;
  margin-top: 18px;
}

.winner-shop-link[hidden] {
  display: none;
}

.chain-place {
  width: max-content;
  padding: 4px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.72rem;
  font-weight: 800;
}

.chain-brand {
  margin-top: 12px;
}

.retailer-logo-frame {
  width: 58px;
  height: 46px;
  padding: 4px;
  border-width: 2px;
  border-radius: 13px;
}

.chain-name {
  font-size: 1.35rem;
}

.chain-detail {
  margin-top: 3px;
  font-size: 0.78rem;
  opacity: 0.65;
}

.chain-total {
  margin-top: 13px;
  font-size: 1.45rem;
}

.basket-breakdown {
  padding-top: 12px;
}

.basket-breakdown-title {
  margin-bottom: 18px;
}

.basket-breakdown-title h2 {
  margin: 0;
  font-family: "Yarden", Arial, sans-serif;
  font-size: clamp(2rem, 3.5vw, 3.4rem);
}

.basket-breakdown-title > span {
  max-width: 210px;
  font-size: 0.82rem;
  text-align: left;
  opacity: 0.65;
}

.basket-table-head,
.basket-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(90px, 0.45fr) minmax(220px, 1.5fr) minmax(90px, 0.45fr);
  align-items: center;
  gap: 20px;
}

.basket-table-head {
  padding: 13px 16px;
  border-bottom: 3px solid var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  opacity: 0.65;
}

.basket-row {
  min-height: 76px;
  padding: 14px 16px;
  border-bottom: 2px dashed rgba(0, 0, 0, 0.32);
}

.basket-product {
  font-size: 1.08rem;
}

.basket-quantity,
.basket-selected {
  font-size: 0.9rem;
}

.basket-selected {
  min-width: 0;
}

.basket-anchor {
  display: block;
  line-height: 1.35;
}

.basket-alternatives {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  font-size: 0.76rem;
  line-height: 1.35;
  opacity: 0.72;
}

.basket-alternative {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.basket-alternative.is-missing {
  opacity: 0.68;
  font-style: italic;
}

.basket-price {
  font-size: 1.12rem;
  text-align: left;
}

.comparison-method {
  margin-top: 30px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: rgba(254, 212, 63, 0.18);
}

.comparison-method strong {
  font-size: 1.05rem;
}

.comparison-method p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.online-retailers {
  width: 100%;
  margin-top: 92px;
  padding: clamp(24px, 4vw, 48px);
  border: 5px solid var(--ink);
  border-radius: 46px;
  box-shadow: 13px 14px 0 var(--ink);
  background: var(--paper);
}

.online-retailers-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  align-items: end;
  gap: 12px 34px;
  margin-bottom: 28px;
}

.online-retailers-heading p {
  grid-column: 1;
  margin: 0;
  font-weight: 800;
}

.online-retailers-heading h2 {
  grid-column: 1;
  margin: 0;
  font-family: "Yarden", Arial, sans-serif;
  font-size: clamp(2.7rem, 5vw, 5rem);
  line-height: 0.9;
}

.online-retailers-heading > span {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 0.9rem;
  line-height: 1.55;
}

.online-retailer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.online-retailer-card {
  min-height: 170px;
  padding: 16px;
  display: grid;
  grid-template-rows: 74px auto auto;
  gap: 8px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: #fffdf7;
  color: var(--ink);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.online-retailer-card.is-live {
  box-shadow: 5px 6px 0 var(--ink);
  background: rgba(254, 212, 63, 0.28);
}

.online-retailer-card:hover,
.online-retailer-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 6px 7px 0 var(--ink);
}

.online-retailer-logo {
  width: 100%;
  height: 74px;
  padding: 7px;
  border-width: 2px;
  border-radius: 14px;
}

.online-retailer-logo.is-victory {
  background: #d71920;
}

.online-retailer-card strong {
  font-size: 1.08rem;
}

.online-retailer-card small {
  font-size: 0.75rem;
  line-height: 1.35;
  opacity: 0.68;
}

@media (max-width: 980px) {
  .grocery-hero { min-height: auto; }
  .grocery-basket-card { width: min(64vw, 310px); }
  .grocery-unit { right: 10%; }
  .grocery-delivery { right: 8%; }
  .grocery-stock { left: 7%; }
  .grocery-star { left: 2%; }
  .chain-ranking { grid-template-columns: 1fr; }
  .chain-card { min-height: 0; }
}

@media (max-width: 620px) {
  .grocery-hero {
    gap: 24px;
    padding-bottom: 48px;
  }

  .grocery-hero-art {
    min-height: 270px;
  }

  .grocery-basket-card {
    width: min(58vw, 250px);
    border-radius: 48px 48px 70px 70px;
  }

  .grocery-bubble {
    width: 90px;
    height: 64px;
    font-size: 0.92rem;
  }

  .grocery-plans .plan-grid {
    margin-top: 64px;
  }

  .live-comparison {
    width: calc(100% - 28px);
    margin-top: 16px;
    scroll-margin-top: 74px;
    padding: 14px;
    border-width: 4px;
    border-radius: 30px;
    box-shadow: 8px 9px 0 var(--ink);
  }

  .live-comparison-heading,
  .winner-card,
  .basket-breakdown-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .live-updated,
  .winner-price,
  .basket-breakdown-title > span {
    max-width: none;
    text-align: right;
  }

  .live-comparison-heading { gap: 8px; padding-bottom: 12px; }

  .winner-card {
    gap: 8px;
    margin-top: 14px;
    padding: 16px;
    border-radius: 28px;
    box-shadow: 7px 8px 0 var(--ink);
  }

  .winner-price { min-width: 0; }
  .chain-ranking { margin-bottom: 42px; }
  .basket-table-head { display: none; }

  .basket-row {
    grid-template-columns: 1fr auto;
    gap: 4px 14px;
    padding: 16px 8px;
  }

  .basket-product { grid-column: 1; grid-row: 1; }
  .basket-price { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .basket-quantity { grid-column: 1; grid-row: 2; }
  .basket-selected { grid-column: 1 / -1; grid-row: 3; margin-top: 7px; font-size: 0.8rem; }
  .basket-alternative { white-space: normal; }

  .comparison-method {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px;
  }

  .winner-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .winner-logo-frame {
    width: 72px;
    height: 72px;
    border-radius: 20px;
  }

  .online-retailers {
    margin-top: 72px;
    padding: 24px 16px;
    border-width: 4px;
    border-radius: 30px;
    box-shadow: 8px 9px 0 var(--ink);
  }

  .online-retailers-heading {
    grid-template-columns: 1fr;
  }

  .online-retailers-heading p,
  .online-retailers-heading h2,
  .online-retailers-heading > span {
    grid-column: 1;
    grid-row: auto;
  }

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

  .online-retailer-card {
    min-height: 158px;
    padding: 12px;
  }

}

@media (max-width: 420px) {
  .online-retailer-grid {
    grid-template-columns: 1fr;
  }
}
