/* LAYAN — section V «Продукты» (js/products.js).
   Reference: a shop listing (client screenshot, 2026-10-24) — no section
   title, a row of category tabs («Все продукты» first, underlined when
   active), then a tight grid of cards: packshot on top, name / price /
   volume underneath, and a round arrow button that leads to the external
   shop. White field and white text frames (client, 2026-10-24); tabs in
   Faberge, sentence case. Tabs filter in place (no page reload).
   Real catalogue since 2026-11-25 (copied from refreshlayan.com): six
   categories, packshot tiles on Cotton Fluff, and size buttons on the
   products that come in several sizes.
   Reuse: .prods is self-contained; the grid and tabs only need the data. */

.prods{
  background:var(--white);color:var(--black);
  padding:clamp(72px,12svh,140px) var(--pad-x) clamp(96px,16svh,180px) var(--content-l);
}

/* ---------- category tabs ---------- */
.prods__tabs{
  display:flex;gap:clamp(24px,3.4vw,52px);
  margin:0 0 clamp(36px,5.5svh,60px);padding:0 0 4px;
  overflow-x:auto;scrollbar-width:none;
}
.prods__tabs::-webkit-scrollbar{display:none}

/* One row only (client 2026-11-25). js/products.js wraps the tabs in
   .prods__bar. What doesn't fit fades into fog at the edge, and a round
   arrow there brings the next categories in; once the row has moved, the
   left edge gets the same fog and a back arrow. --fade = width of the fog
   (the arrow sits in its fully clear outer third). */
.prods__bar{position:relative;z-index:1;--fade:96px;margin:0 0 clamp(36px,5.5svh,60px)}
.prods__bar .prods__tabs{
  --fl:0px;--fr:0px;margin:0;overscroll-behavior-x:contain;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,transparent calc(var(--fl) * .34),#fff var(--fl),#fff calc(100% - var(--fr)),transparent calc(100% - var(--fr) * .34),transparent 100%);
          mask-image:linear-gradient(90deg,transparent 0,transparent calc(var(--fl) * .34),#fff var(--fl),#fff calc(100% - var(--fr)),transparent calc(100% - var(--fr) * .34),transparent 100%);
}
.prods__bar.can-prev .prods__tabs{--fl:var(--fade)}
.prods__bar.can-next .prods__tabs{--fr:var(--fade)}
.prods__nav{
  position:absolute;top:calc(50% - 18px);z-index:2;width:32px;height:32px;padding:0;border-radius:50%;
  border:1px solid var(--ink-200);background:var(--white);color:var(--black);cursor:pointer;
  transition:background-color var(--dur-fast) ease,border-color var(--dur-fast) ease,color var(--dur-fast) ease;
  -webkit-tap-highlight-color:transparent;
}
.prods__nav::before{content:"";position:absolute;inset:-8px}   /* finger-sized target */
.prods__nav--prev{left:0}
.prods__nav--next{right:0}
.prods__nav[hidden]{display:none}
.prods__nav svg{
  position:absolute;inset:0;margin:auto;width:13px;height:13px;
  fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;
}
.prods__nav--prev svg{transform:scaleX(-1)}
.prods__nav:hover,.prods__nav:focus-visible{background:var(--burgundy);border-color:var(--burgundy);color:var(--cotton-fluff)}
.prods__tab{
  position:relative;flex:none;padding:6px 0;border:0;background:none;cursor:pointer;
  font:400 clamp(19px,1.5vw,24px)/1.1 var(--font-display);letter-spacing:-.01em;
  color:var(--black);opacity:.55;transition:opacity var(--dur-fast) ease;
}
.prods__tab::after{
  content:"";position:absolute;left:0;right:0;bottom:-1px;height:1px;background:var(--burgundy);
  transform:scaleX(0);transform-origin:left;transition:transform var(--dur-base) var(--ease-out);
}
.prods__tab:hover{opacity:1}
.prods__tab[aria-pressed="true"]{opacity:1;color:var(--burgundy)}
.prods__tab[aria-pressed="true"]::after{transform:scaleX(1)}
.prods__tab sup{margin-left:.3em;font:400 11px/1 var(--font-text);letter-spacing:.04em;vertical-align:.9em}

/* ---------- grid ---------- */
.prods__grid{
  display:grid;gap:6px;grid-template-columns:repeat(2,minmax(0,1fr));
  list-style:none;margin:0;padding:0;
}
@media (min-width:761px){ .prods__grid{grid-template-columns:repeat(3,minmax(0,1fr))} }
@media (min-width:1280px){ .prods__grid{grid-template-columns:repeat(4,minmax(0,1fr))} }

/* card: the whole card is the link (the name's <a>, stretched over the card
   with ::after); the arrow is its visual handle. The size buttons sit above
   the stretched link so they stay clickable. */
.prod{
  position:relative;display:flex;flex-direction:column;height:100%;
  background:var(--white);color:inherit;
}
.prod__link{color:inherit;text-decoration:none}
.prod__link::after{content:"";position:absolute;inset:0;z-index:1}
.prod__link:focus-visible{outline:none}
.prod__link:focus-visible::after{outline:2px solid var(--garnet);outline-offset:-2px}
.prod__img{aspect-ratio:4/5;overflow:hidden;background:var(--cotton-fluff)}
.prod__img img{
  width:100%;height:100%;object-fit:cover;
  transition:transform 1.1s var(--ease-out);
}
.prod:hover .prod__img img{transform:scale(1.045)}
/* rows: name · size(s) · price + arrow. The body fills the card, so in one
   grid row the names line up under the photos and the prices at the bottom. */
.prod__body{
  flex:1;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto auto 1fr;align-items:start;gap:4px 12px;
  padding:16px 16px 18px;
  font-size:var(--fs-small);line-height:1.45;
}
.prod__name{grid-column:1/-1;font-weight:400;font-size:inherit;line-height:inherit}
.prod__vol,.prod__vols{grid-column:1/-1;grid-row:2}
.prod__vol{color:var(--text-muted)}
.prod__vol:empty{display:none}
.prod__price{grid-column:1;grid-row:3;align-self:end;display:flex;align-items:center;min-height:32px}

/* sizes of one product (5 мг · 10 мг · 30 мг): the pressed one sets the
   price and where the arrow leads */
.prod__vols{position:relative;z-index:2;display:flex;flex-wrap:wrap;gap:4px;margin:4px 0 6px}
.prod__v{
  padding:5px 10px;border:1px solid var(--ink-200);border-radius:999px;background:none;cursor:pointer;
  font:400 12px/1.2 var(--font-text);color:var(--black);white-space:nowrap;
  transition:background-color var(--dur-fast) ease,border-color var(--dur-fast) ease,color var(--dur-fast) ease;
}
.prod__v:hover{border-color:var(--burgundy)}
.prod__v[aria-pressed="true"]{background:var(--burgundy);border-color:var(--burgundy);color:var(--cotton-fluff)}

/* round arrow button → external shop */
.prod__go{
  grid-column:2;grid-row:3;align-self:end;position:relative;flex:none;width:32px;height:32px;border-radius:50%;
  border:1px solid var(--ink-200);color:var(--black);overflow:hidden;
  transition:background-color var(--dur-fast) ease,border-color var(--dur-fast) ease,color var(--dur-fast) ease;
}
.prod__go svg{
  position:absolute;inset:0;margin:auto;width:13px;height:13px;
  fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;
  transition:transform var(--dur-base) var(--ease-out);
}
/* two arrows: on hover the first leaves top-right, the second comes in from bottom-left */
.prod__go svg + svg{transform:translate(-160%,160%)}
.prod:hover .prod__go,.prod:has(.prod__link:focus-visible) .prod__go{background:var(--burgundy);border-color:var(--burgundy);color:var(--cotton-fluff)}
.prod:hover .prod__go svg:first-child,.prod:has(.prod__link:focus-visible) .prod__go svg:first-child{transform:translate(160%,-160%)}
.prod:hover .prod__go svg + svg,.prod:has(.prod__link:focus-visible) .prod__go svg + svg{transform:none}

/* «Показать ещё» (client 2026-11-25): the grid shows three rows; this
   button under it brings in the rest. Same dress as «Записаться». */
.prods__more{
  position:relative;z-index:1;display:block;margin:clamp(28px,4.5svh,48px) auto 0;padding:1em 1.9em;
  font:400 13px/1 var(--font-text);letter-spacing:.01em;white-space:nowrap;
  color:var(--cotton-fluff);background:var(--burgundy);border:0;border-radius:0;cursor:pointer;
  transition:background-color .3s ease;-webkit-tap-highlight-color:transparent;
}
.prods__more:hover{background:var(--garnet)}
.prods__more[hidden]{display:none}

/* filtering + reveal: cards rise in with a small stagger (--i) */
.prods__item{transition:opacity .5s var(--ease-out),transform .7s var(--ease-rise);transition-delay:calc(var(--i,0) * 45ms)}
.prods__item.is-out{opacity:0;transform:translateY(24px)}
.prods__item[hidden]{display:none}

/* cursor fluid (js/products-fx.js): a sticky one-viewport canvas under the
   text draws the photos through the fluid; the DOM <img>s turn transparent.
   overflow:clip (not hidden) keeps the canvas inside a short section
   without breaking sticky. */
.prods{position:relative}
.prods__fx-wrap{position:absolute;inset:0;overflow:clip;pointer-events:none;visibility:hidden}
.prods--gl .prods__fx-wrap{visibility:visible}
.prods__fx{position:sticky;top:0;display:block;width:100%;height:100vh}
.prods__tabs,.prods__grid{position:relative;z-index:1}   /* .prods__bar and .prods__more carry their own */
.prods--gl .prod,.prods--gl .prod__img{background:transparent}
.prods--gl .prod__img img{opacity:0}

@media (max-width:760px){
  /* client 2026-11-06: less air above/below, bigger type */
  .prods{padding:64px var(--gutter) 40px}   /* top just clears the fixed header (52px) */
  .prods__tabs{margin-bottom:18px}
  .prods__bar{--fade:64px;margin-bottom:18px}
  .prods__more{margin-top:22px;padding:14px 26px;font-size:14.5px}
  .prods__tab{font-size:23px}
  .prods__tab sup{font-size:12px}
  .prods__grid{gap:4px}
  .prod__body{padding:12px 10px 16px;font-size:14.5px;line-height:1.4}
  .prod__name{font-size:15px}
  .prod__go{width:32px;height:32px}
  .prod__vols{gap:5px;margin:6px 0 8px}
  .prod__v{padding:7px 10px;font-size:13px}   /* a finger-sized target */
}

/* ---------- «soon» mode (data/products.json → soon.on) ----------
   Only a centred line in the tab font, a size up. */
.prods--soon{display:grid;place-items:center;min-height:70svh;padding-left:var(--pad-x);padding-bottom:clamp(72px,12svh,140px)}   /* centred on the page, not the content column */
.prods--soon .prods__tabs{margin:0;padding:0;overflow:visible}
.prods__soon{
  margin:0;text-align:center;
  font:400 clamp(30px,3vw,48px)/1.1 var(--font-display);letter-spacing:-.01em;color:var(--black);
}
/* the dots count 1 → 2 → 3, 0.5s each; their space is always kept so the
   line doesn't shift. Desktop fluid mode draws its own dots on the canvas. */
.prods__dots i{font-style:normal}
.prods__dots i:nth-child(2){animation:prods-dot2 1.5s steps(1,end) infinite}
.prods__dots i:nth-child(3){animation:prods-dot3 1.5s steps(1,end) infinite}
@keyframes prods-dot2{0%{opacity:0}33.333%{opacity:1}}
@keyframes prods-dot3{0%{opacity:0}66.667%{opacity:1}}
.prods--gl .prods__soon{opacity:0}   /* the canvas shows it, bent by the fluid */
@media (max-width:760px){
  .prods--soon{min-height:56svh;padding:64px var(--gutter)}
  .prods__soon{font-size:29px;text-wrap:balance}   /* the longer line (2026-11-11) wraps in two even lines */
}

@media (prefers-reduced-motion: reduce){
  .prods__item,.prod__img img,.prod__go svg,.prods__tab::after,.prod__v,.prods__nav,.prods__more{transition:none}
  .prods__dots i{animation:none}
  .prods__item.is-out{opacity:1;transform:none}
}
