/* ==========================================================================
   STEPS CME Academy — products.css
   The product catalogue page: banner, alternating detail sections, lightbox.
   Depends on theme.css for tokens, buttons, header and footer.
   ========================================================================== */

.products-page { padding-top: var(--header-h); }

/* --------------------------------------------------------------------------
   1. Header variant

   This page has no hero behind the bar, so the header starts solid rather
   than transparent and the compact logo is the one in use throughout.
   -------------------------------------------------------------------------- */
.site-header.is-flat,
.site-header.is-flat.is-top,
.site-header.is-flat.is-stuck {
  background: oklch(99% 0.002 265 / 0.9);
  backdrop-filter: saturate(180%) var(--glass-blur);
  box-shadow: 0 1px 3px oklch(24% 0.11 265 / 0.07);
}
/* site.js still toggles is-top / is-stuck on scroll; the compact mark and the
   solid bar are what this page wants in both states. */
.site-header.is-flat .logo-scrolled { display: inline-block; }
.site-header.is-flat .logo-top { display: none; }
.site-header.is-flat .logo img,
.site-header.is-flat.is-top .logo img {
  height: 82px;
  filter: drop-shadow(0 2px 6px oklch(0% 0 0 / 0.12));
}

.back-to-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--brand-800);
  transition: background var(--t-base) var(--ease-out),
              color var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out),
              transform var(--t-base) var(--ease-out);
}
.back-to-main:hover {
  background: var(--brand-800);
  border-color: var(--brand-800);
  color: var(--white);
  transform: translateX(-3px);
}
.back-to-main svg { transition: transform var(--t-base) var(--ease-out); }
.back-to-main:hover svg { transform: translateX(-3px); }

/* --------------------------------------------------------------------------
   2. Banner
   -------------------------------------------------------------------------- */
.products-banner { padding: clamp(1.4rem, 1rem + 1.6vw, 2.4rem) 0 0; }
.products-banner .container { max-width: var(--container-wide); }
.products-banner img {
  width: 100%;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   3. Product detail sections
   -------------------------------------------------------------------------- */
.product-detail {
  padding-block: clamp(2.6rem, 2rem + 2.6vw, 4.5rem);
  position: relative;
}
.product-detail + .product-detail::before {
  content: '';
  position: absolute;
  inset-inline: var(--gutter);
  top: 0;
  height: 1px;
  background: var(--grad-rule);
  opacity: 0.35;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 1.2rem + 3vw, 3.5rem);
  align-items: center;
}
.product-detail-grid > * { min-width: 0; }

/* Alternate which side the artwork sits on, so a long page has a rhythm. */
.product-detail:nth-of-type(even) .product-detail-media { order: 2; }

.product-detail-media {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(1.2rem, 0.8rem + 1.6vw, 2.2rem);
  border-radius: var(--r-lg);
  background: var(--grad-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.product-detail-media::after {
  content: '';
  position: absolute;
  inset: -30% -30% auto auto;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--accent-400);
  opacity: 0.1;
  filter: blur(50px);
  pointer-events: none;
}
.product-detail-media img {
  position: relative;
  width: 100%;
  cursor: zoom-in;
  border-radius: var(--r-md);
  transition: transform var(--t-base) var(--ease-out);
}
.product-detail-media img:hover { transform: scale(1.03); }

/* A small affordance so the zoom is discoverable without a caption. */
.product-detail-media::before {
  content: '';
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: oklch(99% 0.002 265 / 0.9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%231b2f6b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3M11 8v6M8 11h6'/%3E%3C/svg%3E") center / 17px no-repeat;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
  pointer-events: none;
}
.product-detail-media:hover::before { opacity: 1; transform: none; }

.product-detail-tag {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 14px;
  border-radius: var(--r-full);
  background: var(--accent-50);
  border: 1px solid oklch(58% 0.22 345 / 0.16);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-700);
}
.product-detail-title { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); margin-bottom: 16px; }
.product-detail-desc { font-size: 1rem; line-height: 1.72; color: var(--ink-500); margin-bottom: 26px; }

.product-detail-specs { display: grid; gap: 12px; }
.product-detail-specs li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-muted);
  border: 1px solid transparent;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--brand-800);
  transition: border-color var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}
.product-detail-specs li:hover { border-color: oklch(58% 0.22 345 / 0.24); transform: translateX(4px); }
.product-detail-specs li svg { color: var(--accent-600); flex-shrink: 0; margin-top: 3px; }
.product-detail-specs li strong { font-weight: 800; }

/* --------------------------------------------------------------------------
   4. Lightbox
   -------------------------------------------------------------------------- */
.product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: oklch(12% 0.01 265 / 0.86);
  backdrop-filter: blur(6px);
}
.product-lightbox.is-open { display: flex; animation: tz-fade-in 0.25s var(--ease-out) both; }
.product-lightbox img {
  max-width: min(640px, 92vw);
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: 0 40px 90px oklch(0% 0 0 / 0.45);
}
.product-lightbox-close {
  position: absolute;
  top: 24px;
  right: 26px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  color: var(--brand-800);
  box-shadow: var(--shadow-md);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-base) var(--ease-out);
}
.product-lightbox-close:hover { background: var(--accent-600); color: var(--white); transform: rotate(90deg); }

/* --------------------------------------------------------------------------
   5. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .product-detail-grid { grid-template-columns: 1fr; gap: 28px; }
  .product-detail:nth-of-type(even) .product-detail-media { order: 0; }
}

@media (max-width: 560px) {
  .back-to-main { padding: 9px 14px; font-size: 0.82rem; }
  .products-banner img { border-radius: var(--r-md); }
}

@media (prefers-reduced-motion: reduce) {
  .product-detail-media img,
  .product-detail-specs li,
  .back-to-main { transition: none; }
  .product-lightbox.is-open { animation: none; }
}
