:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --led: #38bdf8;
  --led-2: #22d3ee;
  --line: #253049;
  --bg: #0b0f16;
  --card: var(--panel, #121826);
  --card-2: var(--panel-2, #0e1420);
  --panel-3: #10203a;
  --bar: #161d2c;
  --text: #eef3fb;
  --muted: #8b97a9;
  --muted-2: #6b7688;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

/* Fixed ambient backdrop behind the whole shop (matches the feed/home look). */
.shop__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 520px at 82% -8%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(900px 480px at 8% 4%, rgba(34, 211, 238, 0.1), transparent 58%),
    linear-gradient(180deg, var(--bg) 0, var(--bg) 46rem, var(--bg) 100%);
}

button,
input,
select {
  font: inherit;
}

.shop {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.shop__topbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.shop__topbar a {
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
}

.shop__topbar span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

/* "Shop admin" pill — revealed by shop.js only for node managers. */
.shop__admin {
  margin-left: auto;
  padding: 6px 14px;
  border: 1px solid var(--muted, var(--muted));
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}
.shop__admin:hover { background: rgba(148, 163, 184, 0.15); }
.shop__admin[hidden] { display: none; }

/* Banner on top — a full-width image/gradient hero the node can later customise. */
.shop__hero {
  position: relative;
  min-height: 240px;
  display: flex;
  align-items: flex-end;
  margin-top: 18px;
  padding: clamp(26px, 4.5vw, 52px);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(9, 13, 22, 0.86) 0%, rgba(9, 13, 22, 0.35) 52%, rgba(9, 13, 22, 0.72) 100%),
    radial-gradient(680px 420px at 88% 12%, rgba(56, 189, 248, 0.4), transparent 62%),
    linear-gradient(135deg, var(--panel-3) 0%, var(--card-2) 46%, var(--card) 100%);
  box-shadow: 0 30px 90px rgba(2, 8, 20, 0.55);
}

.shop__hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--led), var(--led-2));
  opacity: 0.9;
}

.shop__hero-inner {
  position: relative;
  max-width: 780px;
}

.shop__eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  color: var(--led);
  background: rgba(56, 189, 248, 0.1);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.shop__hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--text);
}

.shop__hero p {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.55;
}

/* Product search, prominent, directly below the banner. */
.shop__search {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 18px;
}

.shop__search input,
.shop__search button,
.shop__filters input,
.shop__filters select,
.shop__filters button {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.shop__search input {
  min-width: 0;
  padding: 0 18px;
  background: var(--card);
  color: var(--text);
  font-size: 1.02rem;
}

.shop__search input::placeholder {
  color: var(--muted-2);
}

.shop__search input:focus-visible {
  outline: none;
  border-color: var(--led);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
}

.shop__search button {
  padding: 0 26px;
  border-color: transparent;
  background: linear-gradient(120deg, var(--led), var(--led-2));
  color: #04121f;
  font-weight: 850;
  cursor: pointer;
}

.shop__search button:hover {
  filter: brightness(1.06);
}

/* The same controls below: filters rail + catalog. */
.shop__layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  margin-top: 24px;
}

.shop__filters,
.catalog {
  min-width: 0;
}

.shop__filters {
  align-self: start;
  position: sticky;
  top: 14px;
  display: grid;
  gap: 14px;
}

.shop__filters form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.shop__filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.shop__filters label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.shop__filters input,
.shop__filters select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  background: var(--card-2);
  color: var(--text);
}

.shop__filters input:focus-visible,
.shop__filters select:focus-visible {
  outline: none;
  border-color: var(--led);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.shop__price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.shop__filters button {
  padding: 0 16px;
  border-color: transparent;
  background: linear-gradient(120deg, var(--led), var(--led-2));
  color: #04121f;
  font-weight: 850;
  cursor: pointer;
}

.shop__filters button[data-shop-clear] {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
}

.shop__filters button[data-shop-clear]:hover {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.4);
}

.shop__categories {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.shop__categories button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 760;
  text-align: left;
  cursor: pointer;
}

.shop__categories button:hover,
.shop__categories button[aria-pressed="true"] {
  background: rgba(56, 189, 248, 0.12);
  color: var(--led);
}

.catalog {
  display: grid;
  gap: 16px;
}

.catalog__head {
  min-height: 0;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.catalog__head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1;
  color: var(--text);
}

.catalog__head p,
.items > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.items a {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

@media (max-width: 920px) {
  .shop__layout {
    grid-template-columns: 1fr;
  }

  .shop__filters {
    position: static;
  }

  .shop__categories {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 620px) {
  .shop {
    width: min(100vw - 20px, 1280px);
    padding-top: 12px;
  }

  .shop__hero {
    padding: 22px;
  }

  .shop__search,
  .shop__price-grid {
    grid-template-columns: 1fr;
  }

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

  /* One swipe = one product: snap each card as you scroll (like the news feed). */
  html { scroll-snap-type: y proximity; scroll-padding-top: calc(var(--dh-top-overlay-height, 52px) + 8px); }
  .items > a { scroll-snap-align: start; scroll-snap-stop: always; }
}

/* Infinite-scroll sentinel (invisible; triggers loading the next page of products). */
.shop__sentinel {
  width: 100%;
  height: 1px;
}
