/* ============================================================
   Luxshine — Product Catalogue page (rebuilt 2026-10-14 on the design of
   "What Is Vietnamese Remy Hair?", user comment cmv7s37nfymeo: redesign with
   beautiful photos, strong motion; the catalogue itself needs effects and
   motion). css/remy.css carries the banner, the display type, the gold bars,
   the photo curtains and the footer. Since 2026-10-14 (comment cmv7uwcvotfu3)
   the page is the flip-book alone between header and footer: this file holds the
   book (CSS 3D, no library), its controls and its full-screen reader.
   Script: inline in product-catalogue.html.
   Photos: Luxshine product media (project folder "Media sản phẩm").
   Tokens only; spacing on the 12-step scale; transform and opacity only.
   ============================================================ */

/* ---------- The book's section: white (comment cmvoybxjxv4d4; it was beige), the title above the book, the controls below ---------- */
/* The book is the whole page between header and footer: its section is at least one screen tall and centres it. */
/* --cat-head is the header's height, measured by the page's script (72px until then). */
.cat-book { --remy-curtain: var(--color-white); --cat-ease: cubic-bezier(.3, .08, .2, 1); --cat-head: var(--remy-header); display: grid; align-content: center; min-height: calc(100svh - var(--cat-head)); background: var(--color-white); padding-block: var(--space-8); overflow: clip; }
/* The title on one line where it fits, so the book gets the height. */
.cat-book__title { text-align: center; }
.cat-book__title .remy-line { display: inline-block; vertical-align: top; }
/* --cpw is one page's width; a page is A4 (1 : 1.2947). It follows the screen's width, and never makes the book
   taller than the screen leaves once the header and the rest of the section are counted: --cat-rest is the
   section's padding (2 × 32), the title's line, the two gaps (2 × 32), the stage's padding (2 × 16) and the
   controls (56). */
.catalog {
  --cat-rest: calc(var(--display-2-size) * var(--display-2-lh) + 216px);
  --cpw: max(160px, min(clamp(240px, 30vw, 440px), calc((100svh - var(--cat-head) - var(--cat-rest)) / 1.2947)));
  --cph: calc(var(--cpw) * 1.2947);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-8);
}
.catalog__stage { display: flex; justify-content: center; width: 100%; padding-block: var(--space-4); }

/* The book is always as wide as a spread. Closed, it slides half a page to the left so the cover sits in the
   middle; open, it is centred on its spine; at the back cover it slides the other way. Transform only. */
.catalog__book {
  position: relative; width: calc(2 * var(--cpw)); height: var(--cph); flex: none;
  perspective: 3000px; cursor: pointer;
  transform: translateX(calc(var(--cpw) * -.5));
  transition: transform .9s var(--cat-ease), translate .6s var(--cat-ease);
}
.catalog__book.is-open { transform: none; }
.catalog__book.is-end { transform: translateX(calc(var(--cpw) * .5)); }
/* Shadow on the table under the pages that show. */
.catalog__book::before { content: ""; position: absolute; left: 3%; right: 3%; bottom: -4%; height: 7%; z-index: 0; background: radial-gradient(ellipse at center, color-mix(in srgb, var(--color-black) 30%, transparent), transparent 72%); filter: blur(7px); transition: opacity .6s ease; }
.catalog__book:not(.is-open)::before { left: 52%; }
.catalog__book.is-end::before { left: 3%; right: 52%; }
/* The fold at the spine and the depth at the outer edges, while a spread is open. */
.catalog__book::after {
  content: ""; position: absolute; inset: 0; z-index: 50; pointer-events: none;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--color-black) 12%, transparent) 0%, transparent 5%,
    transparent 45%, color-mix(in srgb, var(--color-black) 18%, transparent) 50%, transparent 55%,
    transparent 95%, color-mix(in srgb, var(--color-black) 12%, transparent) 100%);
  transition: opacity .6s ease;
}
.catalog__book:not(.is-open)::after, .catalog__book.is-end::after { opacity: 0; }
/* Under the pointer the closed book lifts and its cover opens a little. */
.catalog__book:not(.is-open):hover { translate: 0 calc(var(--space-2) * -1); }
.catalog__book:not(.is-open):hover .leaf:first-child { transform: rotateY(-14deg); }
.catalog__book:focus-visible { outline: 2px solid var(--color-black); outline-offset: var(--space-2); }

.leaf { position: absolute; top: 0; left: 50%; width: var(--cpw); height: var(--cph); transform-style: preserve-3d; transform-origin: left center; transition: transform .9s var(--cat-ease); }
.leaf.is-flipped { transform: rotateY(-180deg); }
.leaf.is-flipping { z-index: 49 !important; }
/* The peek: the cover opens a third of the way and settles back, once (script adds .is-peek). */
.leaf.is-peek { animation: cat-peek 1.8s var(--cat-ease) .3s 1; }
@keyframes cat-peek { 0%, 100% { transform: none; } 38%, 52% { transform: rotateY(-34deg); } }

.face { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; background: var(--color-white); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-md); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face--back { transform: rotateY(180deg); }
/* A page darkens and clears as it turns. */
.face::after { content: ""; position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--color-black) 26%, transparent) 0%, color-mix(in srgb, var(--color-black) 6%, transparent) 32%, transparent 62%); }
.face--back::after { background: linear-gradient(270deg, color-mix(in srgb, var(--color-black) 26%, transparent) 0%, color-mix(in srgb, var(--color-black) 6%, transparent) 32%, transparent 62%); }
.leaf.is-flipping .face::after { animation: cpage-shade .9s var(--cat-ease) both; }
@keyframes cpage-shade { 0% { opacity: 0; } 48% { opacity: .55; } 100% { opacity: 0; } }

/* ---------- Pages. Type follows the page's width, so the book reads the same at every size. ---------- */
.cpage__media { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.cpage__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cpage__body { padding: calc(var(--cpw) * .055); }
.cpage__body--top { padding-bottom: calc(var(--cpw) * .03); }
.cpage__title { font-family: var(--font-heading); font-weight: 400; font-size: calc(var(--cpw) * .055); line-height: 1.3; text-transform: uppercase; color: var(--color-black); }
.cpage__text { margin-top: calc(var(--cpw) * .02); font-size: calc(var(--cpw) * .032); line-height: 1.45; color: var(--color-font); }
.cpage__specs { display: flex; flex-direction: column; margin-top: calc(var(--cpw) * .03); }
.cpage__spec { display: flex; justify-content: space-between; gap: var(--space-3); padding-block: calc(var(--cpw) * .018); border-top: 1px solid var(--border-subtle); font-size: calc(var(--cpw) * .03); line-height: 1.4; color: var(--color-black); }
.cpage__spec span:last-child { color: var(--color-font); text-align: right; }
.cpage__num { position: absolute; right: calc(var(--cpw) * .04); bottom: calc(var(--cpw) * .03); font-size: calc(var(--cpw) * .028); color: var(--color-font); }
/* Covers: light. The front carries a photo over the gold-ruled title block; the back is beige. */
.cpage--cover { background: var(--color-white); }
.cpage__cover-photo { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.cpage__cover-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cpage__cover-copy { display: flex; flex-direction: column; align-items: center; gap: calc(var(--cpw) * .015); padding: calc(var(--cpw) * .06) calc(var(--cpw) * .05); border-top: 2px solid var(--color-primary); text-align: center; }
.cpage__logo { width: calc(var(--cpw) * .3); height: auto; margin-bottom: calc(var(--cpw) * .02); }
.cpage__cover-title { font-family: var(--font-heading); font-weight: 400; font-size: calc(var(--cpw) * .075); line-height: 1.15; text-transform: uppercase; color: var(--color-black); }
.cpage__cover-sub { font-size: calc(var(--cpw) * .032); line-height: 1.4; color: var(--color-font); }
.cpage--back { justify-content: center; background: var(--surface-beige); }
.cpage--back .cpage__cover-copy { border-top: 0; }
.cpage__swatches { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--cpw) * .03); padding: 0 calc(var(--cpw) * .055) calc(var(--cpw) * .055); }
.cswatch { display: flex; flex-direction: column; gap: calc(var(--cpw) * .015); }
.cswatch__chip { overflow: hidden; aspect-ratio: var(--ty-le-video); border: 1px solid var(--border-subtle); }
.cswatch__chip img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cswatch__name { font-size: calc(var(--cpw) * .028); color: var(--color-font); }

/* ---------- Controls under the book: previous, where you are with a progress line, next, full screen ---------- */
.catalog__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-4); width: min(100%, 560px); }
.catalog__nav { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--color-black); background: transparent; color: var(--color-black); cursor: pointer; transition: background-color .3s ease, color .3s ease, transform .3s ease, opacity .3s ease; }
.catalog__nav:is(:hover, :focus-visible):not(:disabled) { background: var(--color-black); color: var(--color-white); }
.catalog__nav:active:not(:disabled) { transform: scale(.96); }
.catalog__nav:disabled { opacity: .32; cursor: default; }
.catalog__nav:focus-visible, .catalog__btn:focus-visible { outline: 2px solid var(--color-black); outline-offset: 2px; }
.catalog__ico { display: block; width: 20px; height: 20px; flex: none; }
.catalog__where { display: flex; flex: 1 1 0; max-width: 160px; flex-direction: column; align-items: center; gap: var(--space-2); min-width: 0; }
.catalog__label { font-size: var(--body-size); line-height: var(--body-lh); font-weight: 600; color: var(--color-black); }
.catalog__bar { position: relative; display: block; width: 100%; height: 2px; overflow: hidden; background: color-mix(in srgb, var(--color-black) 16%, transparent); }
.catalog__bar-fill { position: absolute; inset: 0; background: var(--color-black); transform: scaleX(0); transform-origin: 0 50%; transition: transform .9s var(--cat-ease); }
.catalog__btn { gap: var(--space-2); }
.catalog__btn .catalog__ico { width: 18px; height: 18px; }

/* ---------- Full-screen reader ---------- */
.catalog__full { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 0; overflow: hidden; border: 0; background: color-mix(in srgb, var(--color-black) 94%, transparent); }
.catalog__full::backdrop { background: color-mix(in srgb, var(--color-black) 82%, transparent); }
.catalog__full-stage { --cpw: min(40vw, 46vh); --cph: calc(var(--cpw) * 1.2947); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.catalog__full-close, .catalog__full-nav { position: absolute; z-index: 2; display: inline-flex; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--color-white) 26%, transparent); background: color-mix(in srgb, var(--color-white) 12%, transparent); cursor: pointer; transition: background-color .3s ease; }
.catalog__full-close { top: var(--space-6); right: var(--space-6); width: 44px; height: 44px; }
.catalog__full-counter { position: absolute; top: var(--space-6); left: var(--space-6); z-index: 2; padding: var(--space-2) var(--space-4); background: color-mix(in srgb, var(--color-white) 12%, transparent); font-size: var(--body-size); line-height: var(--body-lh); color: var(--color-white); }
.catalog__full-nav { top: 50%; width: 48px; height: 48px; transform: translateY(-50%); }
.catalog__full-nav--prev { left: var(--space-6); }
.catalog__full-nav--next { right: var(--space-6); }
.catalog__full-close img, .catalog__full-nav img { filter: invert(1); }
.catalog__full-close:hover, .catalog__full-nav:hover { background: color-mix(in srgb, var(--color-white) 22%, transparent); }

/* ============================================================
   Motion: the book settles flat once on load (it is the first thing on the page).
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .catalog__stage { animation: cat-tilt 1.4s var(--cat-ease) .2s both; }
}
@keyframes cat-tilt { from { opacity: .2; transform: perspective(1800px) rotateX(34deg) scale(.82); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .catalog__book, .leaf, .catalog__bar-fill { transition: none; }
  .leaf.is-flipping .face::after, .leaf.is-peek { animation: none; }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 899px) {
  .catalog { --cpw: 42vw; }
  .catalog__full-stage { --cpw: 44vw; }
  .catalog__full-nav { width: 44px; height: 44px; }
}
@media (max-width: 767px) {
  .catalog__btn { width: 100%; justify-content: center; }
  .catalog__full-close, .catalog__full-counter { top: var(--space-4); }
  .catalog__full-close { right: var(--space-4); }
  .catalog__full-counter { left: var(--space-4); }
  .catalog__full-nav { top: auto; bottom: var(--space-6); transform: none; }
  .catalog__full-nav--prev { left: var(--space-4); }
  .catalog__full-nav--next { right: var(--space-4); }
}
