/* Layout export: collection and product page layouts.
   Plain CSS, no framework. Needs tokens.css loaded first.

   Everything is scoped: every rule sits under the .lx wrapper and every class
   starts with lx-, so the file can be added to an existing site without
   changing that site's own styles.

   Breakpoints (min-width):
     480px   product grid goes from 1 to 2 columns
     640px   collection cards put text beside the photo; button rows go side by side
     768px   larger section spacing; 12-column heads; phone enquiry bar is hidden
     1024px  product grid 3 columns; product page photo left, details right
     1280px  collection cards three across
*/

/* ── Scope and reset ─────────────────────────────────────────────────── */
.lx,
.lx *,
.lx *::before,
.lx *::after {
  box-sizing: border-box;
}
.lx {
  font-family: var(--lx-font-body);
  font-size: var(--lx-text-body);
  line-height: var(--lx-leading);
  color: var(--lx-ink);
  background: var(--lx-paper);
  -webkit-text-size-adjust: 100%;
}
.lx :where(h1, h2, h3, p, ul, ol, dl, dd, figure) {
  margin: 0;
}
.lx :where(ul, ol) {
  padding: 0;
  list-style: none;
}
.lx :where(h1, h2, h3) {
  font-family: var(--lx-font-head);
  font-weight: 600;
  color: var(--lx-brand);
  letter-spacing: -0.015em;
  line-height: 1.12;
  text-wrap: balance;
}
.lx :where(p) {
  text-wrap: pretty;
}
.lx :where(img, svg) {
  display: block;
}
.lx :where(a) {
  color: var(--lx-brand);
}
.lx :where(button) {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.lx :focus-visible {
  outline: 3px solid var(--lx-brand);
  outline-offset: 3px;
}
.lx :where(a, button):active {
  opacity: 0.82;
}
.lx-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Page frame ──────────────────────────────────────────────────────── */
/* One centred column with the same side padding on every section. */
.lx-container {
  width: 100%;
  max-width: var(--lx-container);
  margin-inline: auto;
  padding-inline: var(--lx-gutter);
}

/* ── Heading sizes ───────────────────────────────────────────────────── */
.lx-h-page {
  font-size: var(--lx-h-page);
  line-height: 1.04;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
  min-width: 0;
}
.lx-h-collection {
  font-size: var(--lx-h-collection);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.lx-h-title {
  font-size: var(--lx-h-title);
  line-height: 1.06;
  letter-spacing: -0.025em;
}
.lx-h-section {
  font-size: var(--lx-h-section);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.lx-lede {
  font-size: 18px;
  line-height: 1.625;
  color: var(--lx-ink-2);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.lx-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--lx-radius-pill);
  font-family: var(--lx-font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color 150ms var(--lx-ease),
    border-color 150ms var(--lx-ease),
    color 150ms var(--lx-ease),
    transform 150ms var(--lx-ease);
}
.lx-btn:active {
  transform: scale(0.98);
}
.lx-btn--primary {
  background: var(--lx-cta);
  color: var(--lx-on-cta);
}
.lx-btn--primary:hover {
  background: var(--lx-cta-deep);
}
.lx-btn--outline {
  border-color: var(--lx-brand);
  background: var(--lx-paper);
  color: var(--lx-brand);
}
.lx-btn--outline:hover {
  background: var(--lx-tint);
}
.lx-btn--outline:active {
  background: var(--lx-tint-2);
}
.lx-btn--lg {
  min-height: 52px;
  padding: 0 28px;
  font-size: 17px;
}
/* Full width on phones, natural width from 640px. */
.lx-btn--block-sm {
  width: 100%;
}
@media (min-width: 640px) {
  .lx-btn--block-sm {
    width: auto;
  }
}

/* ── Breadcrumbs ─────────────────────────────────────────────────────── */
.lx-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 4px;
  font-size: 15px;
  color: var(--lx-ink-2);
}
.lx-crumbs li {
  display: flex;
  align-items: center;
  column-gap: 4px;
}
.lx-crumbs a,
.lx-crumbs [aria-current] {
  padding-block: 10px;
}
.lx-crumbs a {
  color: var(--lx-brand);
  text-decoration: none;
  text-underline-offset: 4px;
}
.lx-crumbs a:hover {
  text-decoration: underline;
}
.lx-crumbs [aria-current] {
  color: var(--lx-ink);
}
.lx-crumbs svg {
  width: 16px;
  height: 16px;
  color: var(--lx-ink-3);
}

/* ════════════════════════════════════════════════════════════════════
   1. COLLECTIONS PAGE (the list of all collections)
   ════════════════════════════════════════════════════════════════════ */
.lx-collections {
  padding-top: 24px;
}
.lx-collections__title {
  margin-top: 24px;
  max-width: 16ch;
}
.lx-collections__lede {
  margin-top: 16px;
  max-width: 48ch;
}
.lx-collections__cards {
  margin-top: 40px;
}
@media (min-width: 768px) {
  .lx-collections {
    padding-top: 32px;
  }
  .lx-collections__title {
    margin-top: 40px;
  }
  .lx-collections__cards {
    margin-top: 56px;
  }
}

/* Collection cards.
   Phones: one per row, text above the photo.
   640 to 1279px: one per row, text left and photo right (photo takes 56%).
   1280px up: three across, the photo at the foot of each card.
   The photo is shown whole at its own shape and is never cropped. */
.lx-ccards {
  display: grid;
  gap: 16px;
}
@media (min-width: 768px) {
  .lx-ccards {
    gap: 20px;
  }
}
@media (min-width: 1280px) {
  .lx-ccards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
}
.lx-ccard {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  border-radius: var(--lx-radius-frame);
  background: var(--lx-card);
  color: var(--lx-ink);
}
.lx-ccard__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 26px 22px 22px;
}
.lx-ccard__name {
  font-size: var(--lx-h-card);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.lx-ccard__line {
  margin-top: 8px;
  max-width: 24ch;
  font-size: 16px;
  line-height: 1.375;
  color: var(--lx-ink-2);
}
.lx-ccard__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-top: 20px;
  padding: 0 20px;
  border-radius: var(--lx-radius-pill);
  background: var(--lx-brand);
  color: var(--lx-on-cta);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 150ms;
}
.lx-ccard__link:hover {
  background: var(--lx-brand-deep);
}
/* The link covers the whole card, so the card is one click target. */
.lx-ccard__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}
.lx-ccard__link svg {
  width: 18px;
  height: 18px;
  transition: transform 200ms var(--lx-ease);
}
.lx-ccard:hover .lx-ccard__link svg {
  transform: translateX(4px);
}
/* Set aspect-ratio on this element to the photo's own width / height. */
.lx-ccard__photo {
  position: relative;
  z-index: -1;
  overflow: hidden;
  margin: 0 12px 12px;
  border-radius: calc(var(--lx-radius-frame) - 6px);
}
.lx-ccard__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@media (min-width: 640px) {
  .lx-ccard {
    flex-direction: row;
    align-items: center;
  }
  .lx-ccard__text {
    flex: 1 1 auto;
    min-width: 0;
    padding: 32px 24px 32px 36px;
  }
  .lx-ccard__photo {
    flex: 0 0 56%;
    margin: 16px 16px 16px 0;
  }
}
@media (min-width: 1280px) {
  .lx-ccard {
    flex-direction: column;
    align-items: stretch;
  }
  .lx-ccard__text {
    flex: 0 0 auto;
    padding: 36px 36px 28px;
  }
  .lx-ccard__line {
    margin-top: 12px;
    font-size: 17px;
  }
  .lx-ccard__link {
    margin-top: 24px;
    padding: 0 24px;
    font-size: 16px;
  }
  .lx-ccard__photo {
    flex: 0 0 auto;
    margin: auto 16px 16px;
  }
}

/* Closing band: heading and line on the left 8 columns, button on the right 4. */
.lx-closing {
  padding-block: 64px;
}
.lx-closing__row {
  display: grid;
  align-items: end;
  gap: 32px;
  padding-top: 40px;
  border-top: 1px solid var(--lx-line);
}
.lx-closing__title {
  max-width: 18ch;
}
.lx-closing__body {
  margin-top: 16px;
  max-width: 46ch;
  color: var(--lx-ink-2);
}
@media (min-width: 768px) {
  .lx-closing {
    padding-block: 80px;
  }
  .lx-closing__row {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    padding-top: 48px;
  }
  .lx-closing__copy {
    grid-column: span 8;
  }
  .lx-closing__action {
    grid-column: span 4;
    justify-self: end;
  }
}

/* ════════════════════════════════════════════════════════════════════
   2. COLLECTION PAGE (one collection and its products)
   ════════════════════════════════════════════════════════════════════ */
.lx-collection {
  padding-top: 24px;
  padding-bottom: 64px;
}
/* Head: title on columns 1 to 7, intro on columns 9 to 12, bottoms level. */
.lx-collection__head {
  display: grid;
  gap: 20px;
  margin-top: 24px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--lx-line);
}
.lx-collection__intro {
  max-width: 40ch;
}
.lx-collection__grid {
  margin-top: 32px;
}
/* Foot row: a line on the left, an outline button on the right. */
.lx-collection__foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--lx-line);
}
.lx-collection__foot p {
  max-width: 44ch;
  color: var(--lx-ink-2);
}
@media (min-width: 640px) {
  .lx-collection__foot {
    flex-direction: row;
    align-items: center;
  }
}
@media (min-width: 768px) {
  .lx-collection {
    padding-top: 32px;
    padding-bottom: 112px;
  }
  .lx-collection__head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    margin-top: 40px;
    padding-bottom: 48px;
  }
  .lx-collection__head h1 {
    grid-column: span 7;
  }
  .lx-collection__intro {
    grid-column: 9 / span 4;
    align-self: end;
  }
  .lx-collection__grid {
    margin-top: 48px;
  }
  .lx-collection__foot {
    margin-top: 96px;
  }
}

/* Empty collection: drawing or photo on 5 columns, text on columns 7 to 12. */
.lx-collection__empty {
  display: grid;
  align-items: center;
  gap: 32px;
  margin-top: 40px;
}
.lx-collection__empty-art {
  padding: 40px;
  border-radius: var(--lx-radius-frame);
  background: var(--lx-tint);
}
.lx-collection__empty-art img {
  width: 100%;
  height: auto;
}
.lx-collection__empty p {
  margin-top: 16px;
  max-width: 44ch;
  color: var(--lx-ink-2);
}
.lx-collection__empty .lx-btn {
  margin-top: 28px;
}
@media (min-width: 768px) {
  .lx-collection__empty {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    margin-top: 64px;
  }
  .lx-collection__empty-art {
    grid-column: span 5;
    padding: 56px;
  }
  .lx-collection__empty-copy {
    grid-column: 7 / span 6;
  }
}

/* Product grid: 1 column, 2 from 480px, 3 from 1024px.
   32px between columns, 48px between rows. Used on the collection page and
   for the related products on the product page. */
.lx-pgrid {
  display: grid;
  column-gap: 32px;
  row-gap: 48px;
}
@media (min-width: 480px) {
  .lx-pgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .lx-pgrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Product card: square photo frame, then name and price under it. */
.lx-pcard {
  display: block;
  text-decoration: none;
}
.lx-pcard__frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: var(--lx-radius-panel);
  background: var(--lx-paper-2);
}
/* The whole photo shows inside the square; nothing is cropped. */
.lx-pcard__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* No photo yet: a tinted frame with a small caption. */
.lx-pcard__frame--empty {
  display: flex;
  align-items: flex-end;
  padding: 12px;
  background: var(--lx-tint);
  font-size: 14px;
  color: var(--lx-ink-2);
}
.lx-pcard__body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}
.lx-pcard__name {
  font-size: 19px;
  text-underline-offset: 4px;
}
.lx-pcard:hover .lx-pcard__name {
  text-decoration: underline;
}
.lx-pcard__price {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--lx-ink);
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════════════════════════════
   3. PRODUCT PAGE
   ════════════════════════════════════════════════════════════════════ */
.lx-product {
  padding-top: 24px;
  padding-bottom: 64px;
}
/* Phones and tablets: photo first, details under it, 32px apart.
   1024px up: photo left, details right, 56px apart, tops level. */
.lx-product__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  margin-top: 16px;
}
.lx-product__gallery,
.lx-product__details {
  min-width: 0;
}
@media (min-width: 768px) {
  .lx-product {
    padding-top: 32px;
    padding-bottom: 96px;
  }
  .lx-product__row {
    margin-top: 32px;
  }
}
@media (min-width: 1024px) {
  .lx-product__row {
    display: flex;
    align-items: flex-start;
    column-gap: 56px;
  }
  /* The photo column is a square sized so the photo and the thumbnail row
     under it fit the first screen, between 320px and 46% of the row.
     layout.js then sets --lx-gallery-size so the thumbnails' bottom edge sits
     level with the last details row, never lower than the screen allows. */
  .lx-product__gallery {
    flex-shrink: 0;
    width: var(--lx-gallery-size, clamp(320px, calc(100dvh - 420px), 46%));
  }
  .lx-product__details {
    flex: 1 1 0%;
  }
  /* The photo stays in view while the details scroll past. */
  .lx-product__gallery-pin {
    position: sticky;
    top: calc(var(--lx-header-h) + 32px);
  }
}

/* Gallery */
.lx-gallery__panel {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: var(--lx-radius-frame);
  background: var(--lx-paper-2);
  touch-action: pan-y;
}
.lx-gallery__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}
/* Photo change: a short crossfade. */
.lx-gallery__img.is-entering {
  animation: lx-fade-in 220ms var(--lx-ease) both;
}
.lx-gallery__img.is-leaving {
  animation: lx-fade-out 220ms var(--lx-ease) both;
}
@keyframes lx-fade-in {
  from {
    opacity: 0;
  }
}
@keyframes lx-fade-out {
  to {
    opacity: 0;
  }
}
.lx-gallery__nav {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}
.lx-gallery__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--lx-line);
  border-radius: 50%;
  background: var(--lx-paper);
  color: var(--lx-brand);
  transition: border-color 150ms;
}
.lx-gallery__arrow:hover {
  border-color: var(--lx-brand);
}
.lx-gallery__arrow svg {
  width: 14px;
  height: 14px;
}
@media (min-width: 1024px) {
  .lx-gallery__nav {
    right: 16px;
    bottom: 16px;
    gap: 8px;
  }
  .lx-gallery__arrow {
    width: 44px;
    height: 44px;
  }
  .lx-gallery__arrow svg {
    width: 20px;
    height: 20px;
  }
}
/* Thumbnails: one row under the photo. They share the row's width equally
   (between 44px and 88px each, 56px from 1024px up), so a typical set fills
   the row with no scrollbar; a long set scrolls sideways at the minimum. */
.lx-gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-padding-inline: 3px;
}
.lx-gallery__thumb {
  position: relative;
  flex: 1 1 0%;
  min-width: 44px;
  max-width: 88px;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: var(--lx-radius-field);
  background: var(--lx-tint);
  opacity: 0.75;
  transition:
    border-color 150ms,
    opacity 150ms;
}
.lx-gallery__thumb:hover,
.lx-gallery__thumb[aria-selected="true"] {
  opacity: 1;
}
.lx-gallery__thumb[aria-selected="true"] {
  border-color: var(--lx-brand);
}
.lx-gallery__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (min-width: 1024px) {
  .lx-gallery__thumbs {
    gap: 10px;
  }
  .lx-gallery__thumb {
    min-width: 56px;
  }
}

/* Details column, top to bottom: name, price, note, buttons, then the
   collapsible rows, then the specification lists. */
.lx-product__price {
  margin-top: 16px;
  font-size: 24px;
  font-weight: 600;
  color: var(--lx-brand);
  font-variant-numeric: tabular-nums;
}
.lx-product__note {
  margin-top: 4px;
  font-size: 15px;
  color: var(--lx-ink-2);
}
.lx-product__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}
@media (min-width: 640px) {
  .lx-product__actions {
    flex-direction: row;
  }
}

/* Collapsible rows (Description, Warranty and so on). Native <details>. */
.lx-accordion {
  margin-top: 32px;
  border-bottom: 1px solid var(--lx-line);
}
.lx-accordion details {
  border-top: 1px solid var(--lx-line);
}
.lx-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding-block: 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--lx-brand);
  list-style: none;
  cursor: pointer;
}
.lx-accordion summary::-webkit-details-marker {
  display: none;
}
.lx-accordion summary svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform 200ms;
}
.lx-accordion details[open] summary svg {
  transform: rotate(180deg);
}
.lx-accordion ul {
  display: grid;
  gap: 10px;
  padding-bottom: 24px;
  font-size: 16px;
  line-height: 1.625;
  color: var(--lx-ink-2);
}
.lx-accordion li strong {
  font-weight: 600;
  color: var(--lx-ink);
}

/* Specification lists: label left, value right, on one line. */
.lx-specs {
  margin-top: 36px;
  border-bottom: 1px solid var(--lx-line);
}
.lx-specs__group {
  padding-block: 24px;
  border-top: 1px solid var(--lx-line);
}
.lx-specs__group h2 {
  font-size: 19px;
}
.lx-specs__group dl,
.lx-specs__group ul {
  margin-top: 12px;
}
.lx-specs__group dl > div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 6px;
}
.lx-specs__group dt {
  color: var(--lx-ink-2);
}
.lx-specs__group dd {
  text-align: right;
  font-weight: 500;
  color: var(--lx-ink);
  font-variant-numeric: tabular-nums;
}
.lx-specs__group ul {
  display: grid;
  gap: 6px;
}

/* Related products: heading left, "view all" link right, then the grid. */
.lx-related {
  padding-bottom: 112px;
}
.lx-related__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 40px;
  border-top: 1px solid var(--lx-line);
}
.lx-related__all {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 600;
  color: var(--lx-brand);
  text-decoration: underline;
  text-decoration-color: var(--lx-line);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.lx-related__all:hover {
  text-decoration-color: var(--lx-brand);
}
.lx-related__grid {
  margin-top: 32px;
}
@media (min-width: 768px) {
  .lx-related__head {
    padding-top: 56px;
  }
}

/* Phone-only action bar. It slides up from the bottom once the buttons in the
   details column scroll out of view (layout.js adds .is-shown), so there is
   never more than one primary button on screen. Hidden from 768px. */
.lx-sticky {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 30;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--lx-line);
  background: var(--lx-paper);
  transform: translateY(100%);
  transition: transform 240ms var(--lx-ease);
}
.lx-sticky.is-shown {
  transform: translateY(0);
}
.lx-sticky .lx-btn {
  width: 100%;
}
@media (min-width: 768px) {
  .lx-sticky {
    display: none;
  }
}

/* ── Optional: cards fade up as they scroll into view ────────────────── */
/* layout.js adds .lx-reveal-wait only to items still below the fold, so the
   page is fully readable without script. */
.lx-reveal-wait {
  opacity: 0;
  transform: translateY(16px);
}
.lx-reveal-go {
  opacity: 1;
  transform: none;
  transition:
    opacity 450ms var(--lx-ease),
    transform 450ms var(--lx-ease);
}
@media (max-width: 767px) {
  .lx-reveal-wait {
    transform: translateY(8px);
  }
  .lx-reveal-go {
    transition-duration: 350ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lx *,
  .lx *::before,
  .lx *::after {
    transition: none !important;
    animation: none !important;
  }
}
