/* ============================================================
   DERBY LIFESCIENCE — Product catalogue
   Builds on the shared design system in css/style.css
   (reuses --primary, --bg, --ink, --radius-*, --ease, --pine)
   ============================================================ */

:root {
  --pr-deep:    #47624F;
  --pr-dark:    #5f7d6c;
  --pr-tint:    rgba(118, 147, 130, 0.09);
  --pr-tint-2:  rgba(118, 147, 130, 0.18);
  --pr-line:    rgba(118, 147, 130, 0.16);
  --pr-soft:    rgba(38, 50, 41, 0.62);
  --pr-faint:   rgba(38, 50, 41, 0.42);

  --pr-r:       20px;
  --pr-r-sm:    14px;
  --pr-sh:      0 2px 4px rgba(38, 50, 41, 0.03), 0 12px 32px -18px rgba(38, 50, 41, 0.18);
  --pr-sh-hi:   0 6px 12px rgba(38, 50, 41, 0.05), 0 28px 56px -24px rgba(38, 50, 41, 0.30);
  --pr-sh-xl:   0 50px 100px -40px rgba(38, 50, 41, 0.45);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

html { scroll-behavior: smooth; }

/* the hero fills the top of the page and the capsule nav floats over it
   (same convention as home / about / contact) */
.header-wrap { position: fixed; left: 0; right: 0; }

/* ---------- button (matches the site's button language) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 22px;
  border: 1.5px solid transparent; border-radius: var(--radius-md);
  font-family: inherit; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; white-space: nowrap;
  transition: background 0.28s var(--ease), color 0.28s var(--ease), border-color 0.28s var(--ease),
              box-shadow 0.28s var(--ease), transform 0.28s var(--ease);
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; transition: transform 0.28s var(--ease); }
.btn--block { width: 100%; }
.btn--primary { background: var(--pr-deep); color: #fff; box-shadow: 0 14px 26px -14px rgba(71, 98, 79, 0.55); }
.btn--primary:hover { background: #3b5342; transform: translateY(-2px); box-shadow: 0 20px 34px -14px rgba(71, 98, 79, 0.65); }
.btn--primary:hover svg { transform: translateX(3px); }
.btn--primary:active { transform: translateY(0) scale(0.99); }

/* ============================================================
   HERO
   ============================================================ */
.p-hero {
  position: relative; overflow: hidden;
  padding: 184px 0 96px; text-align: center;
  /* soft sage wash at the top so the white capsule nav reads clearly against it */
  background:
    radial-gradient(110% 78% at 50% 0%, rgba(118,147,130,0.20), transparent 62%),
    linear-gradient(180deg, #f2f6f2 0%, var(--bg) 62%);
}
.p-hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.p-hero__glow { position: absolute; border-radius: 50%; filter: blur(80px); }
.p-hero__glow--a {
  width: 560px; height: 560px; top: -220px; right: -140px;
  background: radial-gradient(circle, rgba(118,147,130,0.30), transparent 70%);
  animation: pFloat 18s var(--ease) infinite;
}
.p-hero__glow--b {
  width: 460px; height: 460px; bottom: -220px; left: -150px;
  background: radial-gradient(circle, rgba(168,184,173,0.34), transparent 70%);
  animation: pFloat 22s var(--ease) infinite reverse;
}
.p-hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(118,147,130,0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(118,147,130,0.12) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(85% 70% at 50% 40%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(85% 70% at 50% 40%, #000 25%, transparent 78%);
}
.p-hero__mol {
  position: absolute; top: 16%; left: 5%; width: 132px; height: 132px;
  fill: none; stroke: rgba(71, 98, 79, 0.16); stroke-width: 1.5;
  animation: pSpin 52s linear infinite;
}
.p-hero__mol circle { fill: rgba(118,147,130,0.09); }
@keyframes pFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-26px); } }
@keyframes pSpin { to { transform: rotate(360deg); } }

.p-hero__inner { position: relative; z-index: 1; max-width: 780px; }

/* breadcrumb */
.crumbs { margin-bottom: 26px; }
.crumbs ol { display: inline-flex; align-items: center; gap: 8px; list-style: none; }
.crumbs a, .crumbs span { font-size: 12.5px; font-weight: 600; color: var(--pr-faint); transition: color 0.22s var(--ease); }
.crumbs a:hover { color: var(--pr-deep); }
.crumbs [aria-current] { color: var(--ink); }
.crumbs svg { width: 13px; height: 13px; color: var(--pr-faint); display: block; }

.p-eyebrow {
  display: inline-block; margin-bottom: 20px; padding: 7px 16px; border-radius: var(--radius-pill);
  background: var(--pr-tint); border: 1px solid var(--pr-line); color: var(--pr-deep);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
}
.p-hero__title {
  font-size: clamp(32px, 4.6vw, 56px); font-weight: 700; letter-spacing: -0.034em; line-height: 1.08; color: var(--ink);
}
.p-hero__title em { font-style: normal; color: var(--primary); }
.p-hero__lead {
  margin: 20px auto 0; max-width: 580px;
  font-size: 16.5px; line-height: 1.72; color: var(--pr-soft);
}

/* trust strip */
.p-hero__stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  margin: 40px auto 0; max-width: 760px; list-style: none;
}
.p-hero__stats li {
  flex: 1 1 160px; padding: 26px 18px; border-radius: var(--pr-r-sm);
  background: rgba(255,255,255,0.8); border: 1px solid var(--pr-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--pr-sh);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
              border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.p-hero__stats li:hover {
  transform: translateY(-5px); box-shadow: var(--pr-sh-hi);
  border-color: rgba(118,147,130,0.42); background: #fff;
}
.p-hero__stats b {
  display: block; font-size: clamp(34px, 4vw, 50px); font-weight: 800;
  letter-spacing: -0.04em; line-height: 1; white-space: nowrap;
  background: linear-gradient(140deg, var(--primary), var(--pr-deep));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--pr-deep);
}
/* word-based stats (PAN India / WHO-GMP) need a smaller size to stay on one line */
.p-hero__stats b.is-word { font-size: clamp(22px, 2.4vw, 31px); letter-spacing: -0.02em; }

/* the counter must inherit the big gradient type from <b>, not the label style */
.p-hero__stats .p-counter { font: inherit; letter-spacing: inherit; text-transform: none; }

/* label — DIRECT child only, so it never hits .p-counter nested inside <b> */
.p-hero__stats > li > span {
  display: block; margin-top: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pr-soft);
}

.p-hero__scroll {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 38px;
  font-size: 13.5px; font-weight: 700; color: var(--pr-deep);
  transition: gap 0.28s var(--ease);
}
.p-hero__scroll svg { width: 16px; height: 16px; animation: pNudge 2s var(--ease) infinite; }
.p-hero__scroll:hover { gap: 14px; }
@keyframes pNudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ============================================================
   CATALOGUE
   ============================================================ */
.p-catalogue { padding: 56px 0 110px; background: var(--bg); }

/* ---- toolbar ---- */
.p-tools { margin-bottom: 40px; padding-bottom: 24px; border-bottom: 1px solid var(--pr-line); }
.p-tools__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* sort */
.p-sort { position: relative; display: flex; align-items: center; }
.p-sort > svg {
  position: absolute; left: 16px; width: 17px; height: 17px; color: var(--pr-faint); pointer-events: none;
}
.p-sort select {
  height: 52px; padding: 0 40px 0 43px; min-width: 190px;
  font-family: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink);
  background: #fff; border: 1.5px solid var(--pr-line); border-radius: var(--radius-pill);
  cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23263229' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; background-size: 15px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.p-sort select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--pr-tint-2); }

/* dosage-form chips */
.p-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.p-chip {
  padding: 8px 16px; border-radius: var(--radius-pill); cursor: pointer;
  background: #fff; border: 1.5px solid var(--pr-line); color: var(--pr-soft);
  font-family: inherit; font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.p-chip:hover { color: var(--ink); border-color: var(--pr-tint-2); transform: translateY(-2px); }
.p-chip[aria-pressed="true"] { background: var(--pr-deep); border-color: var(--pr-deep); color: #fff; }
.p-chip__n { opacity: 0.6; font-weight: 500; margin-left: 4px; }

.p-search { position: relative; flex: 1 1 320px; max-width: 420px; }
.p-search__icon {
  position: absolute; left: 17px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--pr-faint); pointer-events: none;
  transition: color 0.25s var(--ease);
}
.p-search input {
  width: 100%; height: 52px; padding: 0 46px 0 46px;
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--pr-line); border-radius: var(--radius-pill);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.p-search input::-webkit-search-cancel-button { display: none; }
.p-search input::placeholder { color: var(--pr-faint); }
.p-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--pr-tint-2); }
.p-search:focus-within .p-search__icon { color: var(--primary); }
.p-search__clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--pr-faint); cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.p-search__clear svg { width: 15px; height: 15px; }
.p-search__clear:hover { background: var(--pr-tint); color: var(--ink); }

.p-count { margin-top: 18px; font-size: 13.5px; font-weight: 600; color: var(--pr-soft); letter-spacing: 0.01em; }
.p-count b { color: var(--ink); }

/* ---- grid · 4 / 2 / 1 ---- */
.p-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }

.p-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--pr-line); border-radius: var(--pr-r);
  padding: 14px 14px 18px; box-shadow: var(--pr-sh);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
              border-color 0.4s var(--ease), background 0.4s var(--ease);
}
/* hover: the whole card warms to a soft sage and lifts */
.p-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--pr-sh-hi);
  border-color: rgba(118, 147, 130, 0.45);
  background: linear-gradient(180deg, #ffffff 0%, rgba(118, 147, 130, 0.08) 100%);
}
/* accent bar that draws in along the top edge */
.p-card::before {
  content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--primary), var(--pr-deep));
  transform: scaleX(0); transform-origin: center;
  transition: transform 0.45s var(--ease);
}
.p-card:hover::before { transform: scaleX(1); }
/* `display:flex` above beats the hidden attribute's UA rule — restore it for filtering */
.p-card[hidden] { display: none; }

/* the packshot tile — contain (never crop a product pack) */
.p-card__media {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1;
  padding: 22px; border: 0; cursor: pointer; overflow: hidden;
  border-radius: var(--pr-r-sm);
  background: linear-gradient(168deg, #fdfdfc 0%, #f6f8f6 55%, var(--pr-tint) 100%);
  transition: background 0.45s var(--ease);
}
.p-card:hover .p-card__media {
  background: linear-gradient(168deg, #ffffff 0%, rgba(118,147,130,0.12) 60%, rgba(118,147,130,0.2) 100%);
}
.p-card__media img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  transition: transform 0.55s var(--ease), filter 0.45s var(--ease);
  filter: drop-shadow(0 10px 18px rgba(38, 50, 41, 0.10));
}
.p-card:hover .p-card__media img {
  transform: scale(1.07) translateY(-2px);
  filter: drop-shadow(0 18px 26px rgba(38, 50, 41, 0.18));
}
.p-card__media:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* dosage-form badge — top-left, clear of the centred pack */
.p-card__badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 5px 11px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.92); border: 1px solid var(--pr-line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pr-deep);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.p-card:hover .p-card__badge { background: var(--pr-deep); border-color: var(--pr-deep); color: #fff; }

/* view-details affordance — a corner control, never across the product */
.p-card__zoom {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255,255,255,0.94); border: 1px solid var(--pr-line); color: var(--pr-deep);
  box-shadow: var(--pr-sh);
  opacity: 0; transform: scale(0.7);
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}
.p-card__zoom svg { width: 16px; height: 16px; }
.p-card:hover .p-card__zoom,
.p-card__media:focus-visible .p-card__zoom { opacity: 1; transform: scale(1); }
.p-card__media:hover .p-card__zoom { background: var(--primary); border-color: var(--primary); color: #fff; }

.p-card__name {
  margin: 20px 6px 16px; text-align: center;
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; color: var(--ink);
  min-height: 2.8em;                                  /* keeps every button on the same line */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color 0.3s var(--ease);
}
.p-card:hover .p-card__name { color: var(--pr-deep); }
.p-card .btn { margin-top: auto; }

/* ---- empty state ---- */
.p-empty {
  margin-top: 10px; padding: 60px 26px; text-align: center;
  font-size: 15.5px; color: var(--pr-soft);
  background: #fff; border: 1px dashed var(--pr-line); border-radius: var(--pr-r);
}

/* ============================================================
   CTA
   ============================================================ */
.p-cta {
  position: relative; overflow: hidden; text-align: center;
  background: var(--pine);
}
/* photo layer sits behind the brand wash so the copy stays readable */
.p-cta::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    url("https://images.unsplash.com/photo-1533090161767-e6ffed986c88?q=80&w=1600&auto=format&fit=crop")
    center / cover no-repeat;
}
.p-cta::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(140deg, rgba(30,40,33,0.90) 0%, rgba(36,51,42,0.84) 55%, rgba(71,98,79,0.86) 100%);
}
.p-cta__decor span {
  position: absolute; z-index: 2; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(118,147,130,0.30), transparent 70%);
}
.p-cta__decor span:first-child { width: 420px; height: 420px; top: -160px; left: -110px; }
.p-cta__decor span:last-child  { width: 480px; height: 480px; bottom: -230px; right: -120px; }
.p-cta__inner { position: relative; z-index: 2; padding: 92px 0; max-width: 700px; }
.p-cta__title { font-size: clamp(25px, 3vw, 36px); font-weight: 700; letter-spacing: -0.026em; line-height: 1.18; color: #fff; }
.p-cta__text { margin: 14px auto 30px; max-width: 520px; font-size: 16.5px; line-height: 1.62; color: rgba(237,231,216,0.8); }
.p-cta .btn--primary { background: #fff; color: var(--pr-deep); box-shadow: 0 20px 40px -18px rgba(0,0,0,0.5); }
.p-cta .btn--primary:hover { background: var(--cream); }

/* ============================================================
   PRODUCT MODAL
   ============================================================ */
html.pm-open, html.pm-open body { overflow: hidden; }

.pm { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 28px; }
.pm[hidden] { display: none; }

.pm__backdrop {
  position: absolute; inset: 0; background: rgba(20, 28, 22, 0.5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.pm.is-open .pm__backdrop { opacity: 1; }

/* panel itself never scrolls — the image stays put and only .pm__body moves */
.pm__panel {
  position: relative; z-index: 1; width: 100%; max-width: 960px; max-height: 86vh; overflow: hidden;
  background: #fff; border-radius: 26px; box-shadow: var(--pr-sh-xl);
  opacity: 0; transform: scale(0.965) translateY(12px);
  transition: opacity 0.4s var(--ease), transform 0.45s var(--ease);
}
.pm.is-open .pm__panel { opacity: 1; transform: scale(1) translateY(0); }

.pm__close {
  position: absolute; top: 18px; right: 18px; z-index: 3;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--pr-line); border-radius: 50%;
  background: rgba(255,255,255,0.9); color: var(--ink); cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.35s var(--ease);
}
.pm__close svg { width: 18px; height: 18px; }
.pm__close:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: rotate(90deg); }

/* minmax(0,1fr) is what makes the row cap at 86vh instead of growing to fit the
   details column — without it the row overflows and nothing scrolls */
.pm__grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  grid-template-rows: minmax(0, 1fr);
  max-height: 86vh;
}

/* left · packshot — stays put; only .pm__body scrolls */
.pm__media {
  position: relative; margin: 0; padding: 44px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 340px;                        /* never collapses */
  background: linear-gradient(168deg, #fdfdfc 0%, #f6f8f6 55%, var(--pr-tint) 100%);
  border-radius: 26px 0 0 26px;
}
/* natural size, simply bounded by the box — no width:100% (which can render
   a 0-height image) and no fill-mode animation (which can stick at opacity 0) */
.pm__media img {
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: 400px;
  object-fit: contain;
  filter: drop-shadow(0 18px 32px rgba(38, 50, 41, 0.16));
}

/* right · details — the only scrolling region */
.pm__body {
  padding: 48px 44px 40px;
  overflow-y: auto; min-height: 0;          /* min-height:0 lets a grid item actually scroll */
  overscroll-behavior: contain;             /* don't chain the scroll to the page */
  scrollbar-width: thin; scrollbar-color: var(--pr-tint-2) transparent;
}
.pm__body::-webkit-scrollbar { width: 8px; }
.pm__body::-webkit-scrollbar-thumb { background: var(--pr-tint-2); border-radius: 8px; }
.pm__cat {
  display: inline-block; margin-bottom: 14px; padding: 5px 13px; border-radius: var(--radius-pill);
  background: var(--pr-tint); color: var(--pr-deep);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.pm__title { font-size: clamp(23px, 2.5vw, 31px); font-weight: 700; letter-spacing: -0.028em; line-height: 1.18; color: var(--ink); }
.pm__desc { margin-top: 12px; font-size: 15.2px; line-height: 1.72; color: var(--pr-soft); }

.pm__cat[hidden], .pm__tags[hidden] { display: none; }
.pm__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; list-style: none; }
.pm__tags li {
  padding: 6px 13px; border-radius: var(--radius-pill);
  background: var(--pr-tint); border: 1px solid var(--pr-line);
  font-size: 12px; font-weight: 600; color: var(--pr-deep);
}

.pm__specs { margin-top: 26px; border-top: 1px solid var(--pr-line); }
.pm__row {
  display: grid; grid-template-columns: 156px 1fr; gap: 18px;
  padding: 14px 0; border-bottom: 1px solid var(--pr-line);
}
.pm__row dt { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pr-faint); }
.pm__row dd { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.pm__row dd.is-pending { color: var(--pr-faint); font-style: italic; }
.pm__row dd.is-mrp { font-size: 17px; font-weight: 800; color: var(--pr-deep); letter-spacing: -0.02em; }
.pm__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.pm__list li { position: relative; padding-left: 15px; }
.pm__list li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary);
}

.pm__disclaimer {
  margin-top: 24px; padding: 15px 17px; border-radius: var(--radius-md);
  background: var(--pr-tint); border: 1px solid var(--pr-line);
  font-size: 12.4px; line-height: 1.62; color: var(--pr-soft);
}
.pm__actions { margin-top: 26px; }

/* modal prev / next */
.pm__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--pr-line); border-radius: 50%;
  background: rgba(255,255,255,0.92); color: var(--ink); cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--pr-sh);
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.pm__nav[hidden] { display: none; }          /* display:grid above beats the hidden attribute */
.pm__nav svg { width: 19px; height: 19px; }
.pm__nav:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.pm__nav--prev { left: 14px; }
.pm__nav--next { right: 14px; }
.pm__nav--prev:hover { transform: translateY(-50%) translateX(-3px); }
.pm__nav--next:hover { transform: translateY(-50%) translateX(3px); }

.pm__media { position: relative; }
.pm__pos {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  padding: 5px 13px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.86); border: 1px solid var(--pr-line);
  font-size: 11.5px; font-weight: 600; color: var(--pr-soft); white-space: nowrap;
}

/* ---------- back to top ---------- */
.to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 900;
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid var(--pr-line); border-radius: 50%;
  background: rgba(255,255,255,0.9); color: var(--pr-deep); cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--pr-sh-hi);
  transition: background 0.28s var(--ease), color 0.28s var(--ease), transform 0.28s var(--ease);
}
.to-top[hidden] { display: none; }
.to-top svg { width: 19px; height: 19px; }
.to-top:hover { background: var(--pr-deep); border-color: var(--pr-deep); color: #fff; transform: translateY(-3px); }

/* ---------- button ripple ---------- */
.btn { position: relative; overflow: hidden; }
.ripple {
  position: absolute; border-radius: 50%; transform: scale(0); pointer-events: none;
  background: rgba(255, 255, 255, 0.45); animation: rippleOut 0.6s var(--ease) forwards;
}
@keyframes rippleOut { to { transform: scale(2.6); opacity: 0; } }

/* ---------- image shimmer while loading ---------- */
.p-card__media::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.7) 50%, transparent 80%);
  background-size: 220% 100%; animation: shimmer 1.5s linear infinite;
  opacity: 1; transition: opacity 0.4s var(--ease);
}
.p-card__media.is-loaded::before { opacity: 0; animation: none; }
@keyframes shimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }
.p-card__media img { position: relative; z-index: 1; opacity: 0; transition: opacity 0.5s var(--ease), transform 0.55s var(--ease); }
.p-card__media.is-loaded img { opacity: 1; }

/* ============================================================
   REVEAL
   ============================================================ */
[data-animate] { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-animate].is-visible { opacity: 1; transform: translateY(0); }
.p-grid [data-animate]:nth-child(4n+2) { transition-delay: 0.05s; }
.p-grid [data-animate]:nth-child(4n+3) { transition-delay: 0.10s; }
.p-grid [data-animate]:nth-child(4n+4) { transition-delay: 0.15s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {                 /* tablet · 2 columns */
  .p-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .p-grid [data-animate]:nth-child(n) { transition-delay: 0s; }
  .p-grid [data-animate]:nth-child(2n) { transition-delay: 0.06s; }
  /* stacked: image sits on top, so scroll the whole panel instead */
  .pm__panel { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--pr-tint-2) transparent; }
  .pm__panel::-webkit-scrollbar { width: 8px; }
  .pm__panel::-webkit-scrollbar-thumb { background: var(--pr-tint-2); border-radius: 8px; }
  .pm__grid { grid-template-columns: 1fr; grid-template-rows: auto auto; max-height: none; }
  .pm__media { border-radius: 26px 26px 0 0; padding: 34px; min-height: 0; }
  .pm__media img { max-height: 300px; }
  .pm__body { padding: 32px 30px 32px; overflow: visible; }
}

@media (max-width: 768px) {
  .p-hero { padding: 138px 0 68px; }
  .p-hero__mol { display: none; }
  .p-hero__stats { gap: 10px; }
  .p-hero__stats li { flex: 1 1 calc(50% - 10px); padding: 16px 12px; }
  .p-catalogue { padding: 44px 0 84px; }
  .p-tools { margin-bottom: 30px; }
  .p-search { max-width: none; flex: 1 1 100%; }
  .p-sort { flex: 1 1 100%; }
  .p-sort select { width: 100%; }
  .pm__nav { width: 38px; height: 38px; }
  .pm__nav--prev { left: 8px; }
  .pm__nav--next { right: 8px; }
  .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
  .pm { padding: 14px; }
  .pm__panel { max-height: 92vh; }
  .pm__row { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }
  .p-cta__inner { padding: 74px 0; }
}

@media (max-width: 560px) {                  /* mobile · 1 column */
  .p-grid { grid-template-columns: 1fr; gap: 20px; }
  .p-grid [data-animate] { transition-delay: 0s !important; }
  .p-card__name { min-height: 0; }
  .pm__media { padding: 26px; }
  .pm__body { padding: 26px 22px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] { opacity: 1; transform: none; }
  .pm__panel, .pm__backdrop { transition: none; }
  .pm__media img { animation: none; }
  .p-card:hover { transform: none; }
  .p-card:hover .p-card__media img { transform: none; }
  .p-hero__glow, .p-hero__mol, .p-hero__scroll svg, .ripple { animation: none !important; }
  .p-card__media::before { animation: none; opacity: 0; }
  .p-card__media img { opacity: 1; }
  html { scroll-behavior: auto; }
}
