/* Compact shopping surface; shared product and interaction primitives remain in site.css. */
.shop-shell:has(.shop-masthead) { gap: .7rem; padding: 1rem; }
.shop-masthead { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(240px, 2fr) auto; gap: 1rem; align-items: center; padding: .8rem 1rem; border: 1px solid var(--ds-color-line); border-radius: .65rem; background: var(--ds-color-surface); }
.shop-masthead h1 { margin: .15rem 0 0; font: 800 clamp(1.35rem, 2vw, 2rem)/1.15 var(--ds-font-display); }
.shop-shell[data-theme="playful-curator"] .shop-masthead { border-top: 4px solid var(--shop-primary); background: linear-gradient(110deg, var(--ds-color-surface), color-mix(in srgb, var(--theme-accent) 18%, white)); }
.shop-shell[data-theme="robotic-department"] .shop-masthead { border: 1px solid color-mix(in srgb, var(--shop-primary) 42%, var(--ds-color-line)); border-top: 5px solid var(--shop-primary); border-radius: .35rem; background: linear-gradient(110deg, var(--ds-color-surface), color-mix(in srgb, var(--theme-accent) 12%, var(--ds-color-surface))); }
.shop-shell[data-theme="robotic-department"] .shop-masthead h1 { letter-spacing: .035em; text-transform: uppercase; }
.shop-masthead .shop-breadcrumb { margin: 0; font-size: .75rem; }
.shop-masthead .shop-search { position: static; margin: 0; width: 100%; grid-area: auto; }
.shop-masthead .saved-list-link { position: static; margin: 0; white-space: nowrap; grid-area: auto; }
.shop-partner-line { margin: 0; color: var(--ds-color-muted); font-size: .78rem; }
.shop-shell:has(.shop-masthead) .shop-categories { padding: 0; gap: .4rem; overflow-x: auto; flex-wrap: nowrap; }
.shop-shell:has(.shop-masthead) .shop-category-link { flex-shrink: 0; min-height: 44px; padding: .5rem .7rem; border-radius: 1.25rem; font-size: .83rem; }
.shop-shell:has(.shop-masthead) .shop-category-link:not(.is-active):nth-child(3n + 2) { background: color-mix(in srgb, var(--theme-accent) 22%, white); }
.shop-shell:has(.shop-masthead) .shop-category-link:not(.is-active):nth-child(3n + 3) { background: color-mix(in srgb, var(--theme-brand) 8%, white); }
.shop-shell[data-theme="robotic-department"]:has(.shop-masthead) .shop-category-link { border-radius: .3rem; border: 1px solid color-mix(in srgb, var(--shop-primary) 18%, var(--ds-color-line)); }
.shop-shell[data-theme="robotic-department"]:has(.shop-masthead) .shop-category-link:not(.is-active):nth-child(3n + 2),
.shop-shell[data-theme="robotic-department"]:has(.shop-masthead) .shop-category-link:not(.is-active):nth-child(3n + 3) { background: color-mix(in srgb, var(--theme-accent) 11%, var(--ds-color-surface)); }
.shop-shell:has(.shop-masthead) .catalogue-layout { gap: 1rem; grid-template-columns: clamp(14rem, 20vw, 18rem) minmax(0, 1fr); }
.catalogue-departments { padding: 0 .5rem .65rem; border-bottom: 1px solid var(--ds-color-line); }
.catalogue-departments-heading { margin: 0; padding: .35rem .45rem .5rem; font-size: .8rem; font-weight: 800; color: var(--ds-color-muted); }
.catalogue-departments ul { display: grid; gap: .15rem; margin: 0; padding: 0; list-style: none; }
.catalogue-departments a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 38px; padding: .4rem .5rem; border-radius: .4rem; color: var(--ds-color-text); font-size: .85rem; text-decoration: none; }
.catalogue-departments a:hover { background: color-mix(in srgb, var(--theme-accent) 22%, white); }
.catalogue-departments a.is-active { background: color-mix(in srgb, var(--theme-brand) 10%, white); color: var(--shop-primary); font-weight: 800; box-shadow: inset 3px 0 var(--shop-primary); }
.catalogue-departments a:focus-visible { outline: 2px solid var(--shop-primary); outline-offset: 2px; }
.catalogue-department-count { flex-shrink: 0; font-size: .75rem; font-variant-numeric: tabular-nums; }
.shop-shell:has(.shop-masthead) .catalogue-results-header { margin-bottom: .65rem; padding: 0; min-height: 2rem; flex-direction: row; align-items: center; }
.shop-shell:has(.shop-masthead) .catalogue-results-header h2 { font-size: 1.15rem; margin: 0; }
.shop-shell:has(.shop-masthead) .product-grid { gap: .7rem; }
.shop-shell:has(.shop-masthead) .product-card { border-radius: .5rem; box-shadow: none; }
.shop-shell[data-theme="robotic-department"]:has(.shop-masthead) .product-card { border-radius: .25rem; border-color: color-mix(in srgb, var(--shop-primary) 20%, var(--ds-color-line)); }
.shop-shell:has(.shop-masthead) .product-card img { object-fit: contain; background: white; }
.shop-shell:has(.shop-masthead) .product-card-copy { padding: .65rem; }
.catalogue-pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: 1.25rem 0; }
.catalogue-pagination a { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem; border: 1px solid var(--ds-color-line); border-radius: .4rem; color: var(--shop-primary); background: var(--ds-color-surface); font-weight: 700; }
@media (min-width: 768px) {
  /* Give public shop and product pages the wider canvas used by a full shopping layout. */
  body .site-frame:has(.shop-shell) { width: min(calc(100% - 1.5rem), 1440px); }
}
/* The directory gets shoppers into an aisle without a full-screen introduction. */
.wonder-home-market { gap: 1.5rem; }
.wonder-home-market .wonder-home-hero { min-height: 0; grid-template-columns: minmax(0, 1fr); border-radius: 1rem; box-shadow: none; }
.wonder-home-market .wonder-home-hero-copy { padding: clamp(1.25rem, 3vw, 2rem); }
.wonder-home-market .wonder-home-kicker { margin-bottom: .5rem; letter-spacing: .06em; }
.wonder-home-market .wonder-home-hero h1 { font-family: var(--ds-font-display); font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 850; letter-spacing: -.04em; line-height: 1.08; }
.wonder-home-market .wonder-home-lead { margin-top: .75rem; line-height: 1.5; color: #fffdf7; }
.wonder-home-market .wonder-home-actions { margin-top: 1rem; }
.wonder-home-market .wonder-home-secondary-action { color: #fffdf7; }
.wonder-home-market .wonder-home-section-heading { margin-bottom: 1rem; gap: 1rem; }
.wonder-home-market .wonder-home-section-heading h2 { font: 800 clamp(1.4rem, 3vw, 2rem)/1.2 var(--ds-font-display); letter-spacing: -.03em; }
.wonder-home-market .wonder-aisle-card-media { min-height: 280px; }
.wonder-home-market .wonder-aisle-card-copy { padding: 1.5rem; }
.wonder-home-market .wonder-aisle-card h3 { font-family: var(--ds-font-display); font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; }
.wonder-home-partner-note { margin: 0; font-size: .8rem; color: var(--ds-color-muted); }
.wonder-home-option-b { width: 100%; max-width: none; gap: 1rem; }
.wonder-home-welcome { padding: 1rem clamp(1rem, 3vw, 2rem); border-radius: .75rem; background: var(--ds-color-brand, #172554); color: white; border-bottom: 3px solid #ffd43b; }
.wonder-home-welcome .wonder-home-kicker { margin: 0 0 .25rem; color: #ffd43b; }
.wonder-home-welcome h1 { margin: 0; font: 850 clamp(1.75rem, 4vw, 2.7rem)/1.08 var(--ds-font-display); letter-spacing: -.04em; }
.wonder-home-option-b .wonder-home-shops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.wonder-shop-panel { min-width: 0; padding: 1rem; border: 1px solid var(--ds-color-line); border-left: .35rem solid var(--shop-primary); border-radius: .75rem; background: var(--ds-color-surface); box-shadow: 0 .5rem 1.25rem rgb(23 37 84 / 7%); }
.wonder-shop-panel-header { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .7rem; }
.wonder-shop-panel h2 { margin: 0; font: 800 clamp(1.25rem, 2.5vw, 1.75rem)/1.1 var(--ds-font-display); letter-spacing: -.035em; }
.wonder-shop-panel h2 a, .wonder-shop-panel-enter { color: var(--ds-color-text); text-decoration: none; }
.wonder-shop-panel-enter { flex-shrink: 0; font-size: .78rem; font-weight: 800; }
.wonder-shop-categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin-bottom: .75rem; }
.wonder-shop-categories a { padding: .42rem .55rem; border: 1px solid color-mix(in srgb, var(--shop-accent) 35%, var(--ds-color-line)); border-radius: 999px; background: color-mix(in srgb, var(--shop-accent) 10%, white); color: var(--ds-color-text); font-size: .72rem; font-weight: 750; line-height: 1.2; text-decoration: none; }
.wonder-shop-products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.wonder-shop-product { min-width: 0; overflow: hidden; border: 1px solid var(--ds-color-line); border-radius: .5rem; color: var(--ds-color-text); text-decoration: none; }
.wonder-shop-product img { display: block; width: 100%; height: 7rem; object-fit: contain; background: #f7f8fa; }
.wonder-shop-product-copy { display: block; padding: .5rem; }
.wonder-shop-product-title { display: -webkit-box; overflow: hidden; min-height: 2.35em; font-size: .8rem; font-weight: 750; line-height: 1.18; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.wonder-shop-product-price { display: block; margin-top: .35rem; font-size: .85rem; font-weight: 900; }
@media (max-width: 1023px) { .wonder-shop-products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .wonder-home-option-b .wonder-home-shops { grid-template-columns: minmax(0, 1fr); } .wonder-shop-product img { height: 8rem; } }
@media (max-width: 767px) {
  .wonder-home-market .wonder-home-section-heading { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .wonder-home-market .wonder-aisle-card { grid-template-columns: minmax(0, 1fr); }
  .wonder-home-market .wonder-aisle-card-media { min-height: 210px; max-height: 260px; }
  .wonder-home-market .wonder-aisle-card-copy { padding: 1rem; }
}

/* Homepage wide shop rails. Keep this block scoped so catalogue and product layouts can evolve independently. */
.site-frame:has(.wonder-home-option-b) {
  width: calc(100% - clamp(2rem, 4vw, 4rem));
  max-width: none;
}
.wonder-home-option-b { gap: 1rem; }
.wonder-home-option-b .wonder-home-shops { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 1.6vw, 1.5rem); }
.wonder-home-option-b .wonder-shop-panel {
  padding: clamp(1rem, 1.7vw, 1.5rem);
  border: 1px solid var(--ds-color-line);
  border-radius: .85rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--shop-accent) 8%, white), white 8rem);
  box-shadow: 0 .55rem 1.4rem rgb(23 37 84 / 7%);
}
.wonder-home-option-b .wonder-shop-panel-header { align-items: center; margin-bottom: .85rem; }
.wonder-home-option-b .wonder-shop-panel h2 { font-size: clamp(1.45rem, 2vw, 2rem); }
.wonder-home-option-b .wonder-shop-panel h2 a { text-decoration-thickness: .12em; text-decoration-color: color-mix(in srgb, var(--shop-primary) 55%, transparent); text-underline-offset: .18em; }
.wonder-home-option-b .wonder-shop-panel-enter { padding: .45rem .7rem; border-radius: 999px; background: var(--shop-primary); color: #fff; }
.wonder-home-option-b .wonder-shop-categories { display: flex; flex-wrap: wrap; margin-bottom: .9rem; }
.wonder-home-option-b .wonder-shop-rail-shell { position: relative; }
.wonder-home-option-b .wonder-shop-products {
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: clamp(11.8rem, 17.2vw, 15rem);
  gap: .65rem;
  overflow-x: auto;
  padding: .1rem .1rem .65rem;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.wonder-home-option-b .wonder-shop-products:focus-visible { outline: 3px solid var(--shop-primary); outline-offset: 3px; }
.wonder-home-option-b .wonder-shop-product { scroll-snap-align: start; background: #fff; }
.wonder-home-option-b .wonder-shop-product img { height: 12.1rem; }
@media (hover: hover) and (pointer: fine) {
  .wonder-home-option-b .wonder-shop-product { transition: transform 160ms ease, box-shadow 160ms ease; }
  .wonder-home-option-b .wonder-shop-product:hover { transform: translateY(-2px); box-shadow: 0 .45rem 1rem rgb(23 37 84 / 14%); }
}
.wonder-home-option-b .wonder-shop-product:focus-visible { outline: 3px solid var(--shop-primary); outline-offset: 2px; box-shadow: 0 .45rem 1rem rgb(23 37 84 / 14%); }
.wonder-home-option-b .wonder-shop-rail-control {
  position: absolute;
  z-index: 2;
  top: 4.7rem;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ds-color-line);
  border-radius: 50%;
  color: var(--ds-color-text);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 .25rem .8rem rgb(23 37 84 / 18%);
  font: 800 1.65rem/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}
.wonder-home-option-b .wonder-shop-rail-previous { left: -.65rem; }
.wonder-home-option-b .wonder-shop-rail-next { right: -.65rem; }
.wonder-home-option-b .wonder-shop-rail-control:hover { background: var(--shop-primary); color: #fff; }
.wonder-home-option-b .wonder-shop-rail-control:focus-visible { outline: 3px solid var(--shop-primary); outline-offset: 2px; }
@media (min-width: 1800px) {
  .wonder-home-option-b .wonder-home-shops { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .site-frame:has(.wonder-home-option-b) { width: calc(100% - 2rem); }
  .wonder-home-option-b .wonder-home-shops { grid-template-columns: minmax(0, 1fr); }
  .wonder-home-option-b .wonder-shop-products { grid-auto-columns: minmax(11.4rem, 63%); }
  .wonder-home-option-b .wonder-shop-product img { height: 12.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .wonder-home-option-b .wonder-shop-products { scroll-behavior: auto; }
  .wonder-home-option-b .wonder-shop-product { transition: none; }
  .wonder-home-option-b .wonder-shop-product:hover { transform: none; }
}
@media (min-width: 1024px) {
  .shop-shell:has(.shop-masthead) .catalogue-filters > summary { display: block; padding: .8rem; font-weight: 800; }
}
@media (max-width: 1023px) {
  .shop-shell:has(.shop-masthead) .catalogue-layout { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
  .shop-shell:has(.shop-masthead) .catalogue-filters:not([open]) > .catalogue-filter-bar { display: none; }
  .shop-shell:has(.shop-masthead) .catalogue-filters:not([open]) > .catalogue-departments { display: none; }
  .catalogue-departments { padding-top: .25rem; border-bottom: 0; }
  .catalogue-departments ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalogue-departments a { min-height: 44px; }
}
@media (max-width: 767px) {
  .shop-shell:has(.shop-masthead) { padding: .5rem; gap: .55rem; }
  .shop-masthead { grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; padding: .7rem; }
  .shop-masthead .shop-search { grid-row: 2; grid-column: 1 / -1; }
  .shop-masthead .shop-search { grid-template-columns: minmax(0, 1fr) auto; gap: 0; }
  .shop-masthead .shop-search input { grid-area: auto; border-radius: .5rem 0 0 .5rem; padding: .6rem; }
  .shop-masthead .shop-search button { grid-area: auto; border-radius: 0 .5rem .5rem 0; padding-inline: .65rem; }
  .shop-shell:has(.shop-masthead) .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .shop-shell:has(.shop-masthead) .catalogue-results-header { align-items: baseline; gap: .4rem; }
  .shop-shell:has(.shop-masthead) .catalogue-results-header p { font-size: .75rem; white-space: nowrap; }
  .catalogue-pagination { gap: .5rem; font-size: .82rem; }
}
@media (max-width: 359px) {
  .shop-shell:has(.shop-masthead) .product-grid { grid-template-columns: minmax(0, 1fr); }
}
