/* The hardware shop's catalogue shop.priloz.to (D29, ARCHITECTURE.md §25). It loads the marketing site's site.css
   first (copied into the shop's root by deploy/frontend.Dockerfile, so tokens, type, header, buttons, sections and
   footer are one source) and adds only what a catalogue needs: a shorter hero, product cards with a price line, a
   product page, the breadcrumb and the notice. Same rules as site.css: system fonts, no external request, WCAG 2
   contrast from the site's tokens, CSS only, nothing moves under prefers-reduced-motion. */

/* --- Header ----------------------------------------------------------------------------------- */

.shop-label {
  margin-inline-start: 0.625rem;
  padding: 0.1875rem 0.5625rem;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px var(--line-on-ink-strong);
  color: var(--muted-on-ink);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Narrow phones: the label leaves the bar (it stays in the link's name), so the order button keeps its room. */
@media (max-width: 23.99rem) {
  .shop-label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Hero: shorter than the marketing page's, the products are the point ------------------------ */

.shop-hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: grid;
  gap: var(--space-xl) var(--space-2xl);
  padding: clamp(3rem, 2rem + 4.5vw, 6rem) var(--page-edge) clamp(3.5rem, 2.5rem + 4.5vw, 6.5rem);
  background:
    radial-gradient(90% 60% at 50% 0%, var(--ink-soft), transparent 70%),
    var(--ink);
}

.shop-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: repeating-linear-gradient(90deg, rgb(243 238 227 / 0.04) 0 1px, transparent 1px 7px);
  -webkit-mask-image: linear-gradient(180deg, transparent 10%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 10%, #000 100%);
  pointer-events: none;
}

.hero__glow--shop {
  block-size: 80%;
  opacity: 0.7;
}

.shop-hero h1 {
  max-inline-size: 13ch;
  margin-block-start: var(--space-m);
  font-size: clamp(2.75rem, 1.5rem + 5.4vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.shop-hero h1 em {
  color: var(--lime);
}

.shop-hero .lead {
  max-inline-size: 42ch;
}

/* The shop is not open yet: said once, plainly, in the hero. */
.notice {
  max-inline-size: 40rem;
  margin-block-start: var(--space-l);
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius-m);
  background: rgb(200 241 53 / 0.08);
  box-shadow: inset 0 0 0 1px rgb(200 241 53 / 0.38);
  color: var(--text-on-ink);
  font-size: var(--text-small);
  line-height: 1.5;
}

.notice strong {
  color: var(--lime);
  font-weight: 650;
}

.facts {
  display: grid;
  gap: var(--space-m);
  align-content: end;
  color: var(--muted-on-ink);
  font-size: var(--text-small);
  line-height: 1.5;
}

.facts li {
  padding-inline-start: var(--space-s);
  border-inline-start: 1px solid var(--line-on-ink-strong);
}

.facts strong {
  display: block;
  margin-block-end: 0.25rem;
  color: var(--text-on-ink);
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

@media (min-width: 48rem) and (max-width: 63.99rem) {
  .facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .shop-hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    align-items: end;
  }
}

/* --- Product grid (cream) --------------------------------------------------------------------- */

.products {
  display: grid;
  gap: var(--space-gap);
}

/* The card is a column: picture, kind, name, text, price, actions; the price and actions sit at the bottom, so a
   row of cards lines them up whatever the text length. */
.product {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-l);
  background: var(--paper);
  box-shadow:
    inset 0 0 0 1px var(--line-on-cream),
    var(--shadow-card);
  color: var(--text-on-cream);
  transition:
    transform var(--duration-move) var(--ease-out),
    box-shadow var(--duration-move) var(--ease-out);
}

.product__link {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  color: inherit;
  text-decoration: none;
}

/* The picture: the product on ink, lit from below in lime, like the hero. */
.product__media,
.detail__media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(70% 75% at 50% 110%, rgb(200 241 53 / 0.32), rgb(200 241 53 / 0.06) 55%, transparent 75%),
    repeating-linear-gradient(90deg, rgb(243 238 227 / 0.035) 0 1px, transparent 1px 7px),
    var(--ink);
  box-shadow: inset 0 1px 0 rgb(243 238 227 / 0.1);
}

.product__media {
  aspect-ratio: 16 / 10;
  margin: 0.5rem;
  border-radius: calc(var(--radius-l) - 0.5rem);
}

.product__media .ill {
  inline-size: min(56%, 13rem);
  block-size: auto;
  transition: transform var(--duration-move) var(--ease-out);
}

.product__kind {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: var(--space-m) var(--space-card) 0;
  color: var(--muted-on-cream);
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product__kind::before {
  content: "";
  flex: none;
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 1.5px var(--ink);
}

.product__name {
  margin: var(--space-2xs) var(--space-card) 0;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.27rem + 0.5vw, 1.625rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.product__text {
  margin: var(--space-2xs) var(--space-card) 0;
  color: var(--muted-on-cream);
}

.product__price {
  margin: auto var(--space-card) 0;
  padding-block-start: var(--space-m);
  color: var(--text-on-cream);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  font-variant-numeric: tabular-nums;
}

.product__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-m);
  margin: var(--space-s) var(--space-card) var(--space-card);
  padding-block-start: var(--space-s);
  border-block-start: 1px solid var(--line-on-cream);
}

/* Hover only on a real pointer: a touch screen keeps no sticky hover state. */
@media (hover: hover) and (pointer: fine) {
  .product:hover {
    transform: translateY(-4px);
    box-shadow:
      inset 0 0 0 1px var(--line-on-cream),
      0 1px 2px rgb(13 26 23 / 0.05),
      0 26px 48px -24px rgb(13 26 23 / 0.42);
  }

  .product:hover .product__media .ill {
    transform: scale(1.04);
  }

  .product__link:hover .product__name {
    text-decoration: underline;
    text-decoration-thickness: max(1px, 0.0625em);
    text-underline-offset: 0.18em;
  }
}

@media (min-width: 40rem) {
  .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* --- Illustrations (inline SVG on ink) -------------------------------------------------------- */

.ill {
  overflow: visible;
  filter: drop-shadow(0 18px 24px rgb(0 0 0 / 0.45));
}

.ill-shadow {
  fill: rgb(200 241 53 / 0.14);
}

.ill-body {
  fill: rgb(243 238 227 / 0.08);
  stroke: rgb(243 238 227 / 0.45);
  stroke-width: 1.5;
}

.ill-line,
.ill-base {
  fill: none;
  stroke: rgb(243 238 227 / 0.35);
  stroke-linecap: round;
  stroke-width: 3;
}

.ill-base {
  stroke: rgb(243 238 227 / 0.6);
}

.ill-accent {
  fill: none;
  stroke: var(--lime);
  stroke-linecap: round;
  stroke-width: 4;
}

.ill-dot,
.ill-star,
.ill-qr-dots {
  fill: var(--lime);
}

.ill-qr {
  fill: none;
  stroke: rgb(243 238 227 / 0.6);
  stroke-width: 2;
}

.ill-word {
  fill: var(--text-on-ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ill-word-accent {
  fill: var(--lime);
}

/* --- Breadcrumb ------------------------------------------------------------------------------- */

.breadcrumb {
  max-inline-size: calc(var(--page-max) + 2 * var(--page-inline));
  margin-inline: auto;
  padding: var(--space-m) var(--page-inline) 0;
  color: var(--muted-on-ink);
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.breadcrumb li + li::before {
  content: "/";
  margin-inline: 0.75em;
  color: var(--line-on-ink-strong);
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap-min);
  color: var(--muted-on-ink);
  text-decoration-color: rgb(172 167 151 / 0.4);
}

.breadcrumb [aria-current="page"] {
  color: var(--text-on-ink);
}

/* --- Product page ----------------------------------------------------------------------------- */

.detail {
  display: grid;
  gap: var(--space-xl) var(--space-2xl);
  max-inline-size: calc(var(--page-max) + 2 * var(--page-inline));
  margin-inline: auto;
  padding: var(--space-s) var(--page-inline) var(--space-section);
}

.detail__media {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-xl);
  box-shadow:
    inset 0 0 0 1px var(--line-on-ink),
    inset 0 1px 0 rgb(243 238 227 / 0.1),
    0 40px 80px -40px rgb(0 0 0 / 0.8);
}

.detail__media .ill {
  inline-size: 68%;
  block-size: auto;
}

.detail__info .product__kind {
  margin: 0;
  color: var(--muted-on-ink);
}

.detail__info .product__kind::before {
  box-shadow: 0 0 10px rgb(200 241 53 / 0.6);
}

.detail h1 {
  margin-block-start: var(--space-s);
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.detail .lead {
  max-inline-size: 52ch;
  margin-block-start: var(--space-m);
}

.price {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  margin-block-start: var(--space-l);
  padding-block: var(--space-m);
  border-block: 1px solid var(--line-on-ink);
}

.price__value {
  color: var(--text-on-ink);
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  font-style: italic;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.price__note,
.detail__terms {
  color: var(--muted-on-ink);
  font-size: var(--text-small);
  line-height: 1.5;
}

.detail__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-m);
  margin-block-start: var(--space-l);
}

.detail__terms {
  margin-block-start: var(--space-s);
}

.detail__heading {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-block-start: var(--space-xl);
  color: var(--muted-on-ink);
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail__heading::before {
  content: "";
  flex: none;
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px rgb(200 241 53 / 0.6);
}

.specs {
  margin: var(--space-s) 0 0;
  border-block-start: 1px solid var(--line-on-ink-strong);
}

.specs div {
  display: grid;
  gap: var(--space-3xs) var(--space-m);
  padding-block: var(--space-s);
  border-block-end: 1px solid var(--line-on-ink);
}

.specs dt {
  color: var(--muted-on-ink);
  font-size: var(--text-small);
}

.specs dd {
  margin: 0;
  color: var(--text-on-ink);
}

@media (min-width: 40rem) {
  .specs div {
    grid-template-columns: 9rem minmax(0, 1fr);
  }
}

@media (min-width: 56rem) {
  .detail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    padding-block-start: var(--space-l);
  }

  .detail__media {
    position: sticky;
    inset-block-start: calc(var(--header-height) + var(--space-l));
  }
}

/* The sections under a product: their heading over the content, full width. */
.section__body > h2 {
  margin-block-end: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.other-products {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

.other-products a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap-min);
  padding-inline: 1.25rem;
  border-radius: var(--radius-pill);
  background: rgb(243 238 227 / 0.04);
  box-shadow: inset 0 0 0 1px var(--line-on-ink-strong);
  color: var(--text-on-ink);
  font-size: var(--text-small);
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color var(--duration-hover) ease,
    box-shadow var(--duration-hover) ease;
}

.other-products a:active {
  background: rgb(243 238 227 / 0.12);
}

@media (hover: hover) and (pointer: fine) {
  .other-products a:hover {
    background: rgb(243 238 227 / 0.08);
    box-shadow: inset 0 0 0 1px var(--lime);
  }
}

/* --- Steps of four (the front page and "how to order") ----------------------------------------- */

@media (min-width: 48rem) {
  .steps--four,
  .page--shop .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .steps--four,
  .page--shop .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --- How to order ----------------------------------------------------------------------------- */

.page--shop {
  padding-block-start: var(--space-l);
}

.page--shop h1 {
  font-size: clamp(2.75rem, 1.5rem + 5.4vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.page--shop .lead {
  max-inline-size: 52ch;
  margin-block-start: var(--space-m);
}

.page--shop .steps {
  margin-block: var(--space-xl) var(--space-l);
}

.page--shop .step p {
  margin: 0;
  font-size: var(--text-body);
}

.page--shop h2 {
  max-inline-size: var(--measure);
  margin-block-start: var(--space-l);
  padding-block-start: var(--space-m);
  border-block-start: 1px solid var(--line-on-ink);
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.page--shop h2 + p {
  margin-block-start: var(--space-xs);
  color: var(--text-on-ink);
  font-size: var(--text-body);
}

/* A link inside a sentence stays inline; its padding keeps a 44px tap target without opening up the line. */
.page--shop p .text-link {
  display: inline;
  padding-block: 0.75em;
  text-decoration-color: rgb(200 241 53 / 0.5);
}

.page__back {
  margin-block-start: var(--space-xl);
}

/* --- Preferences ------------------------------------------------------------------------------ */

@media (forced-colors: active) {
  .product,
  .detail__media,
  .product__media,
  .notice,
  .other-products a {
    border: 1px solid CanvasText;
  }

  .ill-accent,
  .ill-line,
  .ill-base,
  .ill-body,
  .ill-qr {
    stroke: CanvasText;
  }

  .ill-dot,
  .ill-star,
  .ill-qr-dots,
  .ill-word,
  .ill-word-accent {
    fill: CanvasText;
  }

  .shop-hero::before {
    display: none;
  }
}
