/* Shop catalogue layer: a bright, practical superstore surface inside the Wonder Aisle shell. */
.shop-shell {
  --shop-ink: #172554;
  --shop-yellow: #ffd43b;
  --shop-paper: #ffffff;
  --shop-line: #d9deea;
  --shop-muted: #5f6b80;
  --shop-primary: var(--shop-ink);
  --shop-accent: var(--shop-yellow);
  width: 100%;
  gap: 1rem;
  padding: clamp(.75rem, 2vw, 1.5rem);
  border: 1px solid color-mix(in srgb, var(--shop-ink) 18%, white);
  border-top: 1px solid color-mix(in srgb, var(--shop-ink) 18%, white);
  border-radius: .8rem;
  background: var(--shop-paper);
  box-shadow: 0 .7rem 2.5rem rgb(23 37 84 / 10%);
}

.shop-shell[data-theme="playful-curator"] {
  --shop-primary: #7350ad;
  --shop-accent: #f3edff;
  --shop-tint: #fbf9ff;
}

.shop-shell[data-theme="robotic-department"] {
  --shop-primary: #1556c0;
  --shop-accent: #38d5e6;
  --shop-tint: #f2fbff;
  border-radius: .3rem;
  border-top-width: 1px;
}

.shop-shell[data-theme="brick-builder"] {
  --shop-ink: #33251d;
  --shop-yellow: #ffd447;
  --shop-line: #ecd9b9;
  --shop-muted: #756454;
  --shop-primary: #d9282f;
  --shop-accent: #ffd447;
  --shop-tint: #fff8e8;
  border-radius: .55rem;
}

.shop-shell[data-theme="fantasy-enchanted"] {
  --shop-ink: #241533;
  --shop-yellow: #F2A65A;
  --shop-paper: #fff;
  --shop-line: #decce9;
  --shop-muted: #665776;
  --shop-primary: #5B2A86;
  --shop-accent: #F2A65A;
  --shop-tint: #fbf7ff;
  border-radius: .7rem;
}

.shop-shell[data-theme="craft-workshop"] {
  --shop-ink: #173B3A;
  --shop-yellow: #E58C6B;
  --shop-paper: #fff;
  --shop-line: #c9dfdc;
  --shop-muted: #4f6b69;
  --shop-primary: #176B67;
  --shop-accent: #E58C6B;
  --shop-tint: #fffaf1;
  border-radius: .6rem;
}

.shop-masthead {
  border: 0;
  border-radius: .45rem;
  background: var(--shop-ink);
  color: #fff;
  box-shadow: none;
}

.shop-shell[data-theme="playful-curator"] .shop-masthead {
  background: #f3edff;
  color: #34215e;
  border: 1px solid #d8c8f3;
}

.shop-shell[data-theme="playful-curator"] .shop-masthead .shop-breadcrumb,
.shop-shell[data-theme="playful-curator"] .shop-masthead .shop-breadcrumb a,
.shop-shell[data-theme="playful-curator"] .shop-masthead .saved-list-link { color: #34215e; }
.shop-shell[data-theme="playful-curator"] .shop-masthead .shop-search input { background: #fff; color: #34215e; }

.shop-shell[data-theme="robotic-department"] .shop-masthead {
  background: linear-gradient(120deg, #103a91, #1556c0 65%, #1caac7);
  border-radius: .15rem;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 14px) 100%, 0 100%);
}

.shop-shell[data-theme="brick-builder"] .shop-masthead {
  background: #fff;
  color: #33251d;
  border: 1px solid #ecd9b9;
  border-top: 4px solid #d9282f;
}
.shop-shell[data-theme="brick-builder"] .shop-masthead .shop-breadcrumb,
.shop-shell[data-theme="brick-builder"] .shop-masthead .shop-breadcrumb a,
.shop-shell[data-theme="brick-builder"] .shop-masthead .saved-list-link { color: #33251d; }
.shop-shell[data-theme="brick-builder"] .shop-masthead .shop-search input { background: #fff; color: #33251d; }
.shop-shell[data-theme="brick-builder"] .shop-masthead .shop-search button { background: #ffd447; color: #33251d; }

.shop-shell[data-theme="fantasy-enchanted"] .shop-masthead {
  background: linear-gradient(110deg, #40205f, #5B2A86 68%, #7640a1);
  border-top: 4px solid #F2A65A;
}
.shop-shell[data-theme="fantasy-enchanted"] .shop-masthead .shop-breadcrumb,
.shop-shell[data-theme="fantasy-enchanted"] .shop-masthead .shop-breadcrumb a,
.shop-shell[data-theme="fantasy-enchanted"] .shop-masthead .saved-list-link { color: rgb(255 255 255 / 86%); }
.shop-shell[data-theme="fantasy-enchanted"] .shop-masthead .shop-search input { background: #fff; color: #241533; }
.shop-shell[data-theme="fantasy-enchanted"] .shop-masthead .shop-search button { background: #F2A65A; color: #241533; }

.shop-shell[data-theme="craft-workshop"] .shop-masthead {
  background: linear-gradient(110deg, #104d4a, #176B67 68%, #25837d);
  border-top: 4px solid #E58C6B;
}
.shop-shell[data-theme="craft-workshop"] .shop-masthead .shop-breadcrumb,
.shop-shell[data-theme="craft-workshop"] .shop-masthead .shop-breadcrumb a,
.shop-shell[data-theme="craft-workshop"] .shop-masthead .saved-list-link { color: rgb(255 255 255 / 86%); }
.shop-shell[data-theme="craft-workshop"] .shop-masthead .shop-search input { background: #fff; color: #173B3A; }
.shop-shell[data-theme="craft-workshop"] .shop-masthead .shop-search button { background: #E58C6B; color: #173B3A; }

.shop-masthead h1 { color: inherit; }
.shop-masthead .shop-breadcrumb { color: rgb(255 255 255 / 72%); }
.shop-masthead .shop-breadcrumb a { color: #fff; }
.shop-masthead .shop-search input { border-color: transparent; }
.shop-masthead .shop-search button { background: var(--shop-yellow); color: var(--shop-ink); }
.shop-masthead .saved-list-link { color: #fff; }

.shop-browse-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  padding: .55rem .65rem;
  border: 1px solid var(--shop-line);
  border-radius: .45rem;
  background: var(--shop-tint, #f8faff);
}
.shop-browse-row:not(:has(> *)) { display: none; }

.shop-category-browser {
  position: relative;
  min-width: min(100%, 22rem);
}

.shop-category-browser > summary {
  min-height: 2.65rem;
  padding: .45rem .65rem;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  border: 1px solid color-mix(in srgb, var(--shop-primary) 26%, var(--shop-line));
  border-radius: .35rem;
  background: #fff;
  color: var(--shop-ink);
  cursor: pointer;
  list-style: none;
}

.shop-category-browser > summary::-webkit-details-marker { display: none; }
.shop-category-browser > summary::before { content: "☰"; color: var(--shop-primary); font-size: .82rem; }
.shop-category-browser-label { font-size: .76rem; font-weight: 800; color: var(--shop-muted); white-space: nowrap; }
.shop-category-browser-current { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.shop-category-browser-chevron { color: var(--shop-primary); font-size: 1.1rem; line-height: 1; }
.shop-category-browser[open] .shop-category-browser-chevron { transform: rotate(180deg); }

.shop-category-menu {
  width: min(34rem, calc(100vw - 3rem));
  max-height: min(26rem, 65vh);
  padding: .45rem;
  position: absolute;
  z-index: 5;
  top: calc(100% + .4rem);
  left: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .25rem;
  border: 1px solid var(--shop-line);
  border-radius: .4rem;
  background: #fff;
  box-shadow: 0 .8rem 2rem rgb(23 37 84 / 16%);
}

.shop-category-link {
  min-height: 2.55rem;
  padding: .45rem .6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border-radius: .25rem;
  color: var(--shop-ink);
  font-size: .86rem;
  text-decoration: none;
}
.shop-category-link:hover { background: var(--shop-accent); }
.shop-category-link.is-active { background: var(--shop-primary); color: #fff; font-weight: 800; }
.shop-category-count { color: var(--shop-muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.shop-category-link.is-active .shop-category-count { color: rgb(255 255 255 / 78%); }

.shop-collections {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .55rem;
}
.shop-collections-label { color: var(--shop-muted); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.shop-collections a {
  padding: .35rem .55rem;
  border: 1px solid var(--shop-line);
  border-radius: 999px;
  color: var(--shop-primary);
  background: #fff;
  font-size: .78rem;
  font-weight: 750;
  text-decoration: none;
}
.shop-collections a:hover { border-color: var(--shop-primary); background: var(--shop-accent); }
.shop-collections a span { color: var(--shop-muted); font-size: .7rem; }

.shop-partner-line { color: var(--shop-muted); }

.shop-shell .catalogue-layout {
  display: block;
}

.shop-shell .catalogue-filters {
  margin-bottom: .9rem;
  border: 1px solid var(--shop-line);
  border-radius: .4rem;
  background: #fff;
}
.shop-shell .catalogue-filters > summary {
  min-height: 2.75rem;
  padding: .6rem .8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  color: var(--shop-ink);
  cursor: pointer;
  list-style: none;
}
.shop-shell .catalogue-filters > summary::-webkit-details-marker { display: none; }
.shop-shell .catalogue-filters > summary::before { content: "⚙"; color: var(--shop-primary); }
.shop-shell .catalogue-filters > summary span { margin-right: auto; font-size: .84rem; font-weight: 800; }
.shop-shell .catalogue-filters > summary strong { padding: .2rem .45rem; border-radius: 999px; background: var(--shop-yellow); color: var(--shop-ink); font-size: .7rem; }
.shop-shell .catalogue-filter-bar { padding: .75rem .8rem; border-top: 1px solid var(--shop-line); }
.shop-shell .catalogue-filter-bar label { color: var(--shop-muted); font-size: .74rem; font-weight: 750; }
.shop-shell .catalogue-filter-bar input,
.shop-shell .catalogue-filter-bar select { border-color: var(--shop-line); background: #fff; }
.shop-shell .catalogue-filter-bar button { background: var(--shop-primary); color: #fff; }
.shop-shell .catalogue-filter-bar a { color: var(--shop-primary); }

.shop-shell .catalogue-results-header { border-bottom: 1px solid var(--shop-line); }
.shop-shell .catalogue-results-header h2 { color: var(--shop-ink); }
.shop-shell .product-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .8rem;
}
.shop-shell .product-card {
  overflow: hidden;
  border: 1px solid var(--shop-line);
  border-radius: .4rem;
  background: #fff;
  box-shadow: 0 .2rem .7rem rgb(23 37 84 / 6%);
}
.shop-shell .product-card:hover { border-color: color-mix(in srgb, var(--shop-primary) 52%, var(--shop-line)); box-shadow: 0 .45rem 1.2rem rgb(23 37 84 / 13%); }
.shop-shell .product-card-media { background: #f7f8fb; }
.shop-shell .product-card-copy { padding: .75rem; }
.shop-shell .product-title-link { color: var(--shop-ink); }
.shop-shell .product-card-price { color: var(--shop-primary); }
.shop-shell .affiliate-product-link { color: var(--shop-ink); background: var(--shop-yellow); }

.shop-shell[data-theme="playful-curator"] .product-card { border-radius: .8rem; background: #fff; }
.shop-shell[data-theme="playful-curator"] .product-card-media { background: #f3edff; }
.shop-shell[data-theme="playful-curator"] .affiliate-product-link { background: #7350ad; color: #fff; }
.shop-shell[data-theme="robotic-department"] .product-card { border-radius: .15rem; border-color: #b7cde9; }
.shop-shell[data-theme="robotic-department"] .product-card-media { background: #eef8ff; }
.shop-shell[data-theme="robotic-department"] .affiliate-product-link { background: #1556c0; color: #fff; }
.shop-shell[data-theme="fantasy-enchanted"] .product-card { border-radius: .75rem; border-color: #decce9; }
.shop-shell[data-theme="fantasy-enchanted"] .product-card-media { background: linear-gradient(145deg, #fff, #f0e5fb); }
.shop-shell[data-theme="fantasy-enchanted"] .affiliate-product-link { background: #5B2A86; color: #fff; }
.shop-shell[data-theme="craft-workshop"] .product-card { border-radius: .5rem; border-color: #c9dfdc; }
.shop-shell[data-theme="craft-workshop"] .product-card-media { background: linear-gradient(145deg, #fff, #fff1df); }
.shop-shell[data-theme="craft-workshop"] .affiliate-product-link { background: #176B67; color: #fff; }

@media (max-width: 1100px) {
  .shop-shell .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .shop-shell { padding: .55rem; border-top-width: 1px; }
  .shop-browse-row { align-items: stretch; flex-direction: column; }
  .shop-category-browser { width: 100%; }
  .shop-category-menu { width: 100%; position: static; box-shadow: none; }
  .shop-collections { padding-top: .15rem; }
  .shop-shell .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
}

@media (max-width: 420px) {
  .shop-category-menu { grid-template-columns: minmax(0, 1fr); }
  .shop-shell .product-card-copy { padding: .55rem; }
}

/* Shop listing: wide retail canvas with a persistent desktop department and filter rail. */
@media (min-width: 768px) {
  body .site-frame:has(.shop-listing-wide) {
    width: calc(100% - clamp(1.5rem, 3vw, 3rem));
    max-width: none;
  }

  .shop-listing-wide.catalogue-layout,
  .shop-listing-wide .catalogue-layout {
    display: grid;
    grid-template-columns: clamp(13.5rem, 17vw, 16rem) minmax(0, 1fr);
    gap: clamp(1rem, 1.6vw, 1.5rem);
    align-items: start;
  }

  .shop-listing-wide .catalogue-filters {
    position: sticky;
    top: 1rem;
    margin: 0;
    overflow: clip;
  }

  .shop-shell.shop-listing-wide .catalogue-filters > summary { display: none; }
  .shop-shell.shop-listing-wide .catalogue-filters:not([open]) > .catalogue-departments,
  .shop-shell.shop-listing-wide .catalogue-filters:not([open]) > .catalogue-filter-bar { display: grid; }
  .shop-listing-wide .catalogue-departments { padding: .65rem; }
  .shop-listing-wide .catalogue-departments-heading {
    padding: .25rem .45rem .55rem;
    color: var(--shop-ink);
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .shop-listing-wide .catalogue-departments ul { max-height: min(42vh, 28rem); overflow-y: auto; }
  .shop-listing-wide .catalogue-filter-bar { border-top: 1px solid var(--shop-line); }
  .shop-listing-wide .catalogue-results { min-width: 0; }
}

@media (min-width: 1500px) {
  .shop-listing-wide .product-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  body .site-frame:has(.shop-listing-wide) { width: min(calc(100% - 1rem), 78rem); }
  .shop-listing-wide .catalogue-departments { padding: .25rem .8rem .75rem; }
  .shop-listing-wide .catalogue-departments ul { max-height: 15rem; overflow-y: auto; }
  .shop-listing-wide .catalogue-filters:not([open]) > .catalogue-departments,
  .shop-listing-wide .catalogue-filters:not([open]) > .catalogue-filter-bar { display: none; }
}

.private-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem auto;
  padding: .8rem 1rem;
  border: 2px solid #7c3aed;
  border-radius: 1rem;
  background: #f5f3ff;
  color: #3b0764;
}

.private-preview-banner div { display: grid; gap: .2rem; }
.private-preview-banner a { color: inherit; font-weight: 800; }
.product-preview-badge {
  position: absolute;
  right: .6rem;
  bottom: .6rem;
  padding: .3rem .55rem;
  border-radius: 999px;
  background: #3b0764;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
}
.product-preview-action { cursor: default; opacity: .72; }

@media (max-width: 640px) {
  .private-preview-banner { align-items: flex-start; flex-direction: column; }
}
