.shopping-page {
  --paper: var(--customer-paper);
  --card: var(--customer-card);
  --line: var(--customer-line);
  --ink: var(--customer-ink);
  --muted: var(--customer-muted);
  --accent: var(--customer-action);
  --shop-stone: #f6f4f2;
  background: var(--paper);
  color: var(--ink);
}

.shopping-page .site-header { padding-block: 12px; }
.shopping-page .shop-navigation { gap: 4px; }
.shopping-page .shop-navigation a {
  gap: 7px;
  padding: 6px 10px;
  border-radius: 14px;
  color: var(--ink);
  font-weight: 650;
}
.shopping-page .shop-navigation a[aria-current] {
  border: 0;
  background: var(--customer-blush);
  color: var(--accent);
  font-weight: 750;
}
.shop-nav-icon {
  flex: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.market-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.market-heading h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 900;
  color: var(--ink);
}

.market-heading .button { gap: 8px; font-size: 14px; border-radius: 26px; background: var(--customer-coral); color: white; border-color: var(--customer-coral); }

.shop-jump {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}

.shop-jump a {
  position: relative;
  isolation: isolate;
  display: block;
  min-width: 0;
  min-height: clamp(178px, 20vw, 248px);
  overflow: hidden;
  padding: clamp(13px, 2vw, 24px);
  border-radius: var(--customer-photo-radius);
  color: white;
  text-decoration: none;
}

.shop-jump img {
  position: absolute;
  inset: auto 4px 4px auto;
  z-index: -1;
  width: 70%;
  height: 74%;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
}

.shop-jump .market-product-link { background: var(--customer-green); }
.shop-jump .market-product-link img { inset: auto 5% 5% auto; width: 53%; height: 90%; }
.shop-jump .market-produce-link { background: var(--customer-gold); color: #271c0a; }
.shop-jump .market-recipe-link { background: var(--customer-grape); }
.market-tile-copy { display: grid; justify-items: start; gap: 7px; line-height: 1.2; }
.market-tile-copy strong { font-size: clamp(18px, 2.4vw, 29px); font-weight: 900; }
.market-tile-copy small { padding: 5px 8px; border-radius: 20px; background: white; color: #2a2220; font-size: 11px; font-weight: 750; }
.shop-jump .market-product-link strong { max-width: 54%; font-size: clamp(24px, 4vw, 41px); }
.shop-jump a:focus-visible { outline-offset: -5px; }
@media (hover: hover) { .shop-jump a:hover { filter: brightness(.95); } }

.shopping-page .account-strip {
  margin: 0 0 24px;
  padding: 10px 16px;
  border-color: var(--line);
  background: var(--card);
  border-radius: 15px;
}

.shopping-page .account-strip .button { font-size: 13px; border-radius: 24px; }
.shopping-page .panel { border-radius: var(--customer-radius); }
.shopping-page :is(.sauce-market, .pantry-market) { padding-inline: 0; border: 0; }
.shopping-page .primary { border-radius: 24px; }
.shopping-page .primary:not(:disabled):hover { background: var(--customer-action-hover); }
.shopping-page #page-notice:empty { display: none; }
.shopping-page #catalog-retry { margin-bottom: 16px; }
.shopping-page .layout > * { min-width: 0; }
.shopping-page .section-heading h2 { margin-bottom: 0; }
.shopping-page .layout h2 { scroll-margin-top: 24px; }
.shopping-page .shopping-feedback {
  position: fixed;
  z-index: 15;
  inset: auto 20px 20px auto;
  max-width: min(370px, calc(100vw - 40px));
  margin: 0;
}

.shopping-page .ingredient-grid { margin-top: 22px; }
.shopping-page .ingredient-card { border-radius: 16px; }
.shopping-page .ingredient-photo { background: var(--shop-stone); }
.shopping-page .ingredient-card .ingredient-photo:has(.source-app) img { padding: 10px; }
.shopping-page .ingredient-caption { color: var(--muted); }
.shopping-page .source-app { background: var(--customer-blush); }
.shopping-page .ingredient-actions .external-buy { border-radius: 24px; }

.shopping-page .sauce-market .catalog-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  margin-top: 18px;
}

.shopping-page .sauce-market .product {
  min-width: 0;
  overflow: hidden;
  padding: 0 12px 12px;
  background: var(--card);
}

.shopping-page .catalog-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% + 24px);
  aspect-ratio: 1.1;
  margin: 0 -12px 12px;
  padding: 10px;
  background: #f2f6f2;
  overflow: hidden;
}

.shopping-page .sauce-market .product-image {
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  object-fit: contain;
}

.shopping-page .catalog-photo:has(.product-image + .product-image) .product-image { width: 50%; }
.shopping-page .catalog-photo:has([src$="/km-market-vip.webp"]) { padding: 0; }
.shopping-page .catalog-photo [src$="/km-market-vip.webp"] { object-fit: cover; }
.shopping-page .sauce-market .product h3 { line-height: 1.35; overflow-wrap: anywhere; }
.shopping-page .product:nth-child(2) .catalog-photo { background: #fbf2ed; }
.shopping-page .product:nth-child(3) .catalog-photo { background: #f4f0f8; }
.shopping-page .sauce-market .product :is(button, a) {
  border-radius: 20px;
  padding-inline: 6px;
  font-size: 12px;
  white-space: normal;
  word-break: keep-all;
}
.wholesale-link { margin-top: 10px; }

.shopping-page .pantry-grid { gap: 20px 14px; }
.shopping-page .pantry-buy {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.shopping-page .pantry-buy .ingredient-photo { aspect-ratio: 1.12; border-radius: 0; }
.shopping-page .pantry-buy h3 { margin: 10px 11px 0; }
.shopping-page .pantry-cta { margin: 0 11px 5px; }
.shopping-page .pantry-buy:hover { border-color: var(--accent); }
.shopping-page .pantry-buy:hover h3 { text-decoration: none; }
.shopping-page .pantry-cta { text-decoration: none; font-weight: 750; }

@media (max-width: 900px) {
  .shopping-page .layout { grid-template-columns: minmax(0, 1fr) 305px; gap: 20px; }
  .shopping-page .sauce-market .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 819px) {
  .shopping-page {
    --shop-nav-height: 60px;
    --shop-dock-bottom: calc(8px + env(safe-area-inset-bottom));
    --shop-checkout-bottom: calc(var(--shop-nav-height) + var(--shop-dock-bottom) + 6px);
  }
  .shopping-page .site-header {
    flex-direction: row;
    align-items: center;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  }
  .shopping-page .shop-navigation {
    position: fixed;
    inset: auto 12px var(--shop-dock-bottom);
    z-index: 11;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: auto;
    height: var(--shop-nav-height);
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background: var(--card);
    box-shadow: 0 5px 18px #2119171c;
  }
  .shopping-page .shop-navigation a {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 4px 2px;
    border-radius: 26px;
    line-height: 1.2;
    text-align: center;
    font-size: 10px;
  }
  .shopping-page .shop-navigation a:focus-visible { outline-offset: -3px; }
  .shopping-page .mobile-checkout-summary {
    position: fixed;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    inset: auto 12px var(--shop-checkout-bottom);
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 5px 18px #21191714;
  }
  .shopping-page .mobile-checkout-summary small { display: block; font-size: 10px; }
  .shopping-page .mobile-checkout-summary strong { display: block; font-size: 20px; line-height: 1.3; }
  .shopping-page .mobile-checkout-summary .button { flex: none; font-size: 13px; }
  .shopping-page footer { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .shopping-page:has(.mobile-checkout-summary:not([hidden])) footer { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .shopping-page .layout { grid-template-columns: minmax(0, 1fr); }
  .shop-jump { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .shop-jump a { min-height: clamp(126px, 37vw, 166px); padding: 13px; }
  .shop-jump .market-product-link { grid-column: 1 / -1; min-height: clamp(164px, 48vw, 224px); padding: 19px; }
  .shopping-page .pantry-grid { gap: 12px; }
  .shopping-page .shopping-feedback { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .shopping-page:has(.mobile-checkout-summary:not([hidden])) .shopping-feedback { bottom: calc(134px + env(safe-area-inset-bottom)); }
}

@media (max-width: 360px) {
  .shopping-page .sauce-market .product h3 { font-size: 14px; }
}
