﻿.section-block {
  padding: 110px 0;
}

.section-heading {
  margin-bottom: 42px;
}

.section-heading h2 {
  margin: 0;
  max-width: 740px;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--text-dark);
}

.section-kicker {
  margin: 0 0 16px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dark-muted);
}

.light {
  color: rgba(255, 255, 255, 0.7);
}

#collection.products-section {
  background-color: var(--bg);
  background-image: none;
}

#collection .section-kicker {
  color: var(--accent-strong);
}

#collection .section-heading h2 {
  max-width: none;
  font-size: clamp(1.2rem, 4.4vw, 3.5rem);
  white-space: nowrap;
  color: var(--text);
}

.collection-heading-break {
  display: none;
}

#collection .section-heading h2 em {
  color: var(--walnut);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.product-ring-controls,
.product-ring-hint {
  display: none;
}

.product-ring.is-ready .product-ring-stage {
  --ring-card-width: clamp(220px, 24vw, 290px);
  --ring-card-height: 400px;
  --ring-radius: clamp(250px, 26vw, 330px);
  position: relative;
  height: 520px;
  overflow: hidden;
  perspective: 2200px;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}

.product-ring.is-ready .product-ring-stage:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: -4px;
}

.product-ring.is-ready .product-ring-stage.is-dragging {
  cursor: grabbing;
}

.product-ring.is-ready .product-grid {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  transform: rotateY(var(--ring-rotation, 0deg));
  transform-style: preserve-3d;
  transition: transform 750ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.product-ring.is-ready .product-ring-stage.is-dragging .product-grid {
  transition: none;
}

.product-ring.is-ready .product-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--ring-card-width);
  height: var(--ring-card-height);
  opacity: var(--ring-opacity, 1);
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, var(--ring-shadow-opacity, 0.2)));
  transform: translate(-50%, -50%) rotateY(var(--ring-angle)) translateZ(var(--ring-radius));
  transform-style: preserve-3d;
  transition: opacity 180ms ease, filter 180ms ease;
}

.product-ring.is-ready .product-ring-stage.is-dragging .product-card {
  transition: none;
}

.product-ring.is-ready .product-card:not(.is-flipped) .product-back {
  visibility: hidden;
  transition: visibility 0s linear 700ms;
}

.product-ring.is-ready .product-card:hover,
.product-ring.is-ready .product-card:focus-within {
  filter: drop-shadow(0 17px 24px rgba(0, 0, 0, 0.4));
}

.product-ring.is-ready .product-ring-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 12px;
}

.product-ring-controls button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(215, 183, 141, 0.55);
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 1.35rem;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.product-ring-controls button:hover {
  transform: scale(1.06);
  background: var(--accent-earth);
}

.product-ring-controls button:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
}

.product-ring-status {
  min-width: 150px;
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.product-ring.is-ready .product-ring-hint {
  display: block;
  margin: 12px 0 0;
  color: var(--text-dark-muted);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.product-card {
  min-width: 0;
  height: 490px;
  perspective: 1400px;
  filter: drop-shadow(0 12px 18px var(--shadow-card));
  transition: filter 250ms ease;
}

.product-card:hover,
.product-card:focus-within {
  filter: drop-shadow(0 17px 22px rgba(18, 29, 26, 0.2));
}

.product-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.product-card.is-flipped .product-card-inner {
  transform: rotateY(180deg);
}

.product-card.is-flipped .product-front {
  visibility: hidden;
  transition: visibility 0s linear 350ms;
}

.product-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  box-shadow: 0 5px 14px rgba(18, 29, 26, 0.08);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.product-front {
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
}

.product-photo-button {
  position: relative;
  display: block;
  flex: 1;
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--surface-image);
  color: inherit;
  cursor: pointer;
}

.product-photo-button::before {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  width: clamp(44px, 16%, 64px);
  aspect-ratio: 1.14;
  border: 1px solid rgba(255, 251, 208, 0.85);
  border-radius: 12px;
  background-color: var(--forest);
  background-image: url("../assets/images/brand/lilita-one-nav.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: auto 80%;
  content: "";
  pointer-events: none;
}

.product-photo-button img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 650ms ease;
}

.product-photo-button:hover img,
.product-photo-button:focus-visible img {
  transform: scale(1.035);
}

.product-photo-button:focus-visible,
.product-expand-button:focus-visible,
.product-back-button:focus-visible {
  outline: 3px solid var(--accent-earth);
  outline-offset: -4px;
}

.product-image-hint {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 14px;
  left: 14px;
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.product-expand-button {
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 14px;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 251, 208, 0.6);
  border-radius: 50%;
  background: rgba(4, 32, 15, 0.62);
  color: var(--cream);
  cursor: zoom-in;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.product-expand-button:hover {
  transform: scale(1.06);
  border-color: var(--cream);
  background: var(--forest);
}

.product-expand-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.product-front-caption {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 12px 16px;
  border-top: 1px solid rgba(215, 183, 141, 0.28);
  background: var(--bg);
}

.tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(12, 35, 31, 0.08);
  color: var(--text-dark);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product-front-caption h3,
.product-back h3 {
  margin: 9px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.product-front-caption h3 {
  margin-top: 0;
  color: var(--text);
  font-weight: 600;
}

.product-card h3 {
  text-align: center;
}

.product-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  transform: rotateY(180deg);
  background: linear-gradient(150deg, var(--bg-soft), var(--bg));
  color: var(--cream);
  text-align: center;
}

.product-back .tag {
  align-self: center;
  background: rgba(215, 183, 141, 0.15);
  color: var(--accent-strong);
}

.product-back h3 {
  width: 100%;
  margin-top: 14px;
  color: var(--cream);
}

.product-back p {
  width: 100%;
  margin: 12px 0 16px;
  color: rgba(245, 239, 233, 0.78);
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: justify;
  text-align-last: center;
}

.product-specs {
  display: grid;
  width: 100%;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-specs li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(245, 239, 233, 0.86);
  font-size: 0.76rem;
  line-height: 1.35;
}

.product-specs strong {
  color: var(--accent-strong);
  font-weight: 600;
}

.product-specs span {
  text-align: right;
}

.product-back-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  margin-top: auto;
  padding: 12px 0 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.product-back-button span {
  font-size: 1.2rem;
}

/* Full-size photo dialog: a header row (name + close), then the photo in the
   same wood-grain frame as the cards, with the card's description and spec
   list beside it (below it on phones). */
.product-lightbox {
  position: fixed;
  width: min(1100px, calc(100% - 48px));
  max-width: none;
  /* Sized to the viewport first; js/main.js then shrinks the dialog so it
     hugs the photo, which is why nothing inside ever needs to scroll. */
  height: min(calc(100vh - 48px), 820px);
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  color: var(--text);
}

.product-lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

/* Page scroll is held only while the photo dialog is open; the gutter stays
   reserved so the page does not shift sideways when the scrollbar hides. */
html.lightbox-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}

.product-lightbox::backdrop {
  background: rgba(2, 10, 9, 0.88);
  backdrop-filter: blur(5px);
}

.product-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px 14px 24px;
  border-bottom: 1px solid var(--line);
}

.product-lightbox-heading {
  min-width: 0;
}

.product-lightbox-kicker {
  margin: 0 0 5px;
  color: rgba(255, 251, 208, 0.58);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.product-lightbox-caption {
  margin: 0;
  overflow: hidden;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.9vw, 1.7rem);
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1.1;
  text-align: left;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.product-lightbox-close {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 251, 208, 0.45);
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.product-lightbox-close:hover {
  border-color: var(--cream);
  background: rgba(255, 251, 208, 0.1);
  transform: rotate(90deg);
}

.product-lightbox-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.6;
}

.product-lightbox-body {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  padding: 24px;
}

.product-lightbox-figure {
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
}

/* The wood-grain frame is the photo's own border, so it always hugs the
   photo exactly and the border-radius clips the photo to the frame's inner
   curve: no wrapper, no gap, no square corners. */
.product-lightbox-figure img {
  display: block;
  box-sizing: content-box;
  width: auto;
  height: auto;
  max-width: calc(100% - 8px);
  max-height: calc(100% - 8px);
  border: 4px solid transparent;
  border-radius: 18px 10px 22px 12px;
  background:
    linear-gradient(var(--forest), var(--forest)) padding-box,
    repeating-linear-gradient(105deg, var(--walnut-dark) 0 7px, var(--walnut) 7px 10px, var(--walnut-dark) 10px 15px) border-box;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
  object-fit: contain;
}

.product-lightbox-details {
  min-width: 0;
  align-self: start;
  padding-top: 2px;
}

.product-lightbox:focus,
.product-lightbox:focus-visible {
  outline: none;
  box-shadow: none;
}

.product-lightbox-close:focus-visible {
  outline: 2px solid var(--river-blue);
  outline-offset: 3px;
  box-shadow: none;
}

.product-lightbox-description {
  margin: 0 0 18px;
  color: rgba(255, 251, 208, 0.82);
  font-size: 0.92rem;
  line-height: 1.6;
}

.product-lightbox-specs {
  gap: 10px;
}

.product-lightbox-specs li {
  font-size: 0.84rem;
}

@media (max-width: 720px) {
  .product-lightbox {
    width: calc(100% - 24px);
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    border-radius: 14px;
  }

  .product-lightbox-header {
    gap: 14px;
    padding: 13px 12px 11px 16px;
  }

  .product-lightbox-kicker {
    margin-bottom: 4px;
  }

  .product-lightbox-caption {
    font-size: 1.25rem;
  }

  .product-lightbox-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 16px;
  }

  .product-lightbox-details {
    padding-top: 0;
  }

  .product-lightbox-description {
    margin-bottom: 12px;
    font-size: 0.86rem;
    line-height: 1.5;
  }

  /* Two compact columns keep the specs in view beneath the photo. */
  .product-lightbox-specs {
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
  }

  .product-lightbox-specs li {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding-bottom: 6px;
    font-size: 0.8rem;
  }

  .product-lightbox-specs span {
    text-align: left;
  }
}

.collection-gallery-toggle {
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: -18px 0 28px auto;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--walnut);
  border-radius: 3px;
  background: var(--sand);
  color: var(--forest);
  font: 600 0.75rem/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color 240ms cubic-bezier(0.2, 0.7, 0.2, 1),
    color 240ms cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 240ms cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 240ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.collection-gallery-toggle::after {
  color: var(--walnut);
  content: "→";
  font-size: 1rem;
  line-height: 1;
  transition:
    color 240ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.collection-gallery-toggle[aria-expanded="true"]::after {
  content: "←";
}

.collection-gallery-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--walnut);
  background: var(--walnut);
  box-shadow: 0 4px 10px rgba(1, 9, 8, 0.16);
  color: var(--cream);
}

.collection-gallery-toggle:hover::after {
  transform: translateX(4px);
  color: var(--cream);
}

.collection-gallery-toggle:active {
  transform: translateY(0) scale(0.99);
  box-shadow: none;
}

.collection-gallery-toggle:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.collection-gallery[hidden] {
  display: none;
}

.collection-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 0.92fr) minmax(0, 1.08fr));
  gap: 16px;
  margin-top: 6px;
}

.collection-gallery-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.collection-gallery-item {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  background: var(--surface-image);
  box-shadow: 0 8px 20px var(--shadow-card);
}

.collection-gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 500ms ease;
}

.collection-gallery-item:hover img {
  transform: scale(1.015);
}

@media (max-width: 960px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }

  .collection-gallery {
    display: block;
    columns: 3;
    column-fill: balance;
  }

  .collection-gallery-column {
    display: contents;
  }

  .collection-gallery-item {
    break-inside: avoid;
    margin-bottom: 16px;
  }
}

/* Tablets (721px to 1024px): the heading and the "View All Pieces" button
   form one centred group above the carousel instead of the desktop's
   left heading and right-aligned button. */
@media (min-width: 721px) and (max-width: 1024px) {
  #collection .section-heading {
    text-align: center;
  }

  #collection .section-heading h2 {
    margin: 0 auto;
  }
}

/* The centred heading starts at 720px, the centred button only at 500px:
   between them the button sat on the right under a centred title. */
@media (min-width: 501px) and (max-width: 1024px) {
  .collection-gallery-toggle {
    margin: -6px auto 28px;
  }
}

/* Between 501px and 640px the heading's font has reached its minimum, so
   on one line it overran the container. Break it into its two natural
   lines, as it already does below 500px, keeping the size. */
@media (min-width: 501px) and (max-width: 640px) {
  .collection-heading-break {
    display: block;
  }

  #collection .section-heading h2 {
    white-space: normal;
  }

  #collection .section-heading h2 em {
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .section-block {
    padding: 82px 0;
  }

  #collection .section-heading {
    text-align: center;
  }

  .product-ring.is-ready .product-ring-stage {
    --ring-card-width: clamp(220px, 68vw, 250px);
    --ring-card-height: clamp(330px, 92vw, 370px);
    height: clamp(430px, 118vw, 480px);
    perspective: 1500px;
  }

  /* One card at a time on phones. js/main.js sets --ring-fade from how far
     each card has turned away from the viewer, so during a swipe the card
     leaving fades out as the next one fades in. When the finger lifts (or an
     arrow is tapped) the same fade runs on the ring's own easing, the card
     leaving a little ahead of the one arriving. */
  .product-ring.is-ready .product-card {
    visibility: hidden;
    opacity: 0;
    transition: opacity 480ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 180ms ease, visibility 0s linear 480ms;
  }

  .product-ring.is-ready .product-card.is-mobile-active {
    visibility: visible;
    opacity: var(--ring-fade, 1);
    transition: opacity 700ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 180ms ease;
  }

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

  .collection-gallery {
    display: block;
    columns: 2;
    column-fill: balance;
    column-gap: 12px;
  }

  .collection-gallery-column {
    display: contents;
  }

  .collection-gallery-item {
    margin-bottom: 12px;
  }

  .product-card {
    height: 470px;
  }

  .product-back {
    padding: 20px;
  }
}

@media (max-width: 500px) {
  .collection-heading-break {
    display: block;
  }

  #collection .section-heading h2 {
    font-size: clamp(2rem, 9vw, 3.2rem);
    line-height: 0.98;
    white-space: normal;
  }

  #collection .section-heading h2 em {
    display: block;
    font-size: clamp(0.8rem, 7.4vw, 2.1rem);
    white-space: nowrap;
  }

  #collection .section-heading {
    margin-bottom: 30px;
  }

  .collection-gallery-toggle {
    margin: -12px auto 24px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .product-ring.is-ready .product-ring-stage {
    --ring-card-width: min(68vw, 250px);
    --ring-card-height: clamp(320px, 88vw, 350px);
    height: clamp(420px, 112vw, 460px);
  }

  .product-card {
    height: clamp(360px, 118vw, 450px);
  }

  .product-back {
    padding: 24px;
  }

  .product-front-caption h3 {
    font-size: clamp(1.7rem, 7vw, 2rem);
    line-height: 1;
  }
}

@media (max-width: 360px) {
  .product-ring-status {
    min-width: 0;
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-ring.is-ready .product-card:not(.is-flipped) .product-back {
    transition: none;
  }

  .product-card,
  .product-card-inner,
  .product-back,
  .product-photo-button img,
  .product-expand-button,
  .product-lightbox-close,
  .product-ring.is-ready .product-grid,
  .product-ring.is-ready .product-card,
  .product-ring.is-ready .product-card.is-mobile-active,
  .product-ring-controls button,
  .collection-gallery-item img,
  .collection-gallery-toggle {
    transition: none;
  }
}
