/* ==========================================================================
   Tabuk PharmaEdge — program.css
   Subprogram detail pages: hero, overview, curriculum, products, courses,
   plus the two-level product / course dialogs.
   Accent colour per page is set with [data-accent] on <body>.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Per-page accent
   -------------------------------------------------------------------------- */
body[data-accent="wellness"] { --accent: #b8860b; --accent-dark: #8a6408; --accent-soft: #fdf4dd; }
body[data-accent="breath"]   { --accent: #0d92b8; --accent-dark: #0a7392; --accent-soft: #ddf2f8; }
body[data-accent="gastro"]   { --accent: #c1642c; --accent-dark: #9a4e21; --accent-soft: #fdeee2; }
body[data-accent="mind"]     { --accent: #7a4bbd; --accent-dark: #5f3a94; --accent-soft: #f0e9fb; }
body[data-accent="cardio"]   { --accent: #c33b48; --accent-dark: #9c2d38; --accent-soft: #fdeaec; }
body[data-accent="pharma"]   { --accent: #459334; --accent-dark: #35722a; --accent-soft: #e9f6e2; }
body { --accent: var(--green-600); --accent-dark: var(--green-700); --accent-soft: var(--green-50); }

/* The page hero is dark, so the header stays opaque from the first pixel */
.site-header.is-top {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 1px 0 var(--line), 0 10px 30px -24px rgba(5, 52, 77, 0.5);
  border-bottom-color: var(--line);
}
.nav-item.is-current .nav-toggle-sub { color: var(--green-700); }

/* --------------------------------------------------------------------------
   2. Page hero
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  margin-top: var(--header-h);
  padding: clamp(2.75rem, 3.4vw, 3.75rem) 0 clamp(2.75rem, 3.4vw, 4rem);
  background: linear-gradient(125deg, var(--navy-900) 0%, var(--navy-700) 52%, var(--navy-600) 100%);
  color: rgba(255, 255, 255, 0.8);
  overflow: hidden;
}
.page-hero::before {
  content: ""; position: absolute; top: -180px; right: -120px;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 68%);
  filter: blur(60px); opacity: 0.55;
}
.page-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 70% 80% at 20% 10%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 20% 10%, #000, transparent 70%);
}
.page-hero .container { position: relative; z-index: 2; }

.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 0.8rem; color: rgba(255, 255, 255, 0.55);
  margin-bottom: 24px;
}
.breadcrumb a { color: rgba(255, 255, 255, 0.75); transition: color var(--t-fast); }
.breadcrumb a:hover { color: var(--green-400); }
.breadcrumb svg { opacity: 0.5; }
.breadcrumb [aria-current] { color: var(--white); font-weight: 600; }

.page-hero-grid {
  display: grid; grid-template-columns: 1.35fr 0.65fr;
  gap: clamp(1.5rem, 1rem + 3vw, 3.5rem); align-items: center;
}

.ph-code {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display);
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--white);
  padding: 8px 16px; margin-bottom: 20px;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: var(--r-full);
}
.page-hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 1.3rem + 2.9vw, 3.3rem);
  margin-bottom: 14px;
}
.ph-sub {
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.22rem);
  font-weight: 600; color: var(--green-300);
  margin-bottom: 18px;
}
.ph-lead { font-size: 1.02rem; line-height: 1.75; color: rgba(255, 255, 255, 0.76); max-width: 60ch; margin-bottom: 26px; }
.ph-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.ph-tags .chip { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.85); border: 1px solid rgba(255, 255, 255, 0.15); }
.ph-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.ph-card {
  padding: 26px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.ph-card h4 {
  font-size: 0.76rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6); margin-bottom: 16px;
}
.ph-stat { display: flex; align-items: center; gap: 13px; padding: 11px 0; }
.ph-stat + .ph-stat { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.ph-stat-icon {
  width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 11px; background: rgba(255, 255, 255, 0.1); color: var(--green-300);
}
.ph-stat strong { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--white); line-height: 1.25; }
.ph-stat span { font-size: 0.76rem; color: rgba(255, 255, 255, 0.55); }

@media (max-width: 900px) { .page-hero-grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   3. Overview + outcomes
   -------------------------------------------------------------------------- */
.overview-grid {
  display: grid; grid-template-columns: 1.4fr 0.6fr;
  gap: clamp(2rem, 1rem + 3.5vw, 4rem);
}
.overview-body p { font-size: 1.01rem; line-height: 1.85; color: var(--ink-600); margin-bottom: 18px; }
.overview-body p:last-child { margin-bottom: 0; }
.overview-body .pull {
  margin: 26px 0;
  padding: 22px 26px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 600; line-height: 1.6;
  color: var(--navy-800);
}

.overview-aside {
  align-self: start; position: sticky; top: calc(var(--header-h) + 20px);
  padding: 26px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.overview-aside h4 {
  font-size: 0.76rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-500); margin-bottom: 16px;
}
.aside-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.aside-row + .aside-row { border-top: 1px dashed var(--line-strong); }
.aside-row svg { color: var(--accent); flex-shrink: 0; margin-top: 3px; }
.aside-row strong { display: block; font-family: var(--font-display); font-size: 0.92rem; color: var(--navy-800); }
.aside-row span { font-size: 0.82rem; color: var(--ink-500); }
.overview-aside .btn { margin-top: 18px; }

@media (max-width: 980px) {
  .overview-grid { grid-template-columns: 1fr; }
  .overview-aside { position: static; }
}

.outcomes-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: clamp(0.9rem, 0.5rem + 1vw, 1.35rem);
}
.outcome {
  position: relative;
  padding: 26px 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base), border-color var(--t-base);
}
.outcome:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.outcome-num {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; margin-bottom: 14px;
  border-radius: 10px;
  font-family: var(--font-display); font-size: 0.86rem; font-weight: 800;
  background: var(--accent-soft); color: var(--accent-dark);
}
.outcome h4 { font-size: 1rem; margin-bottom: 6px; }
.outcome p { font-size: 0.88rem; line-height: 1.62; color: var(--ink-500); }

/* Curriculum */
.modules { display: flex; flex-direction: column; gap: 12px; max-width: 900px; margin-inline: auto; }
.module {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 22px 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base), border-color var(--t-base);
}
.module:hover { transform: translateX(5px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.module-index {
  flex-shrink: 0; width: 46px; height: 46px;
  display: grid; place-items: center; border-radius: 13px;
  background: var(--navy-800); color: var(--white);
  font-family: var(--font-display); font-weight: 800; font-size: 0.92rem;
}
.module:hover .module-index { background: var(--accent); }
.module-body { flex: 1; }
.module h4 { font-size: 1.02rem; margin-bottom: 4px; }
.module p { font-size: 0.88rem; line-height: 1.6; color: var(--ink-500); }
.module-meta {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.76rem; font-weight: 700; color: var(--navy-600);
  background: var(--navy-100); padding: 6px 12px; border-radius: var(--r-full);
}
@media (max-width: 640px) {
  .module { flex-wrap: wrap; gap: 14px; }
  .module-meta { order: 3; }
}

/* Stretched link: the whole card is clickable while the markup stays valid
   (a <button> may not contain a heading, so the button overlays the card). */
.card-open {
  position: absolute; inset: 0; z-index: 4;
  border: 0; border-radius: inherit; background: transparent;
  cursor: pointer;
  font-size: 0; line-height: 0; color: transparent;
  overflow: hidden;
}
.card-open:focus-visible { outline: 3px solid var(--green-500); outline-offset: 3px; }

/* --------------------------------------------------------------------------
   4. Therapeutic product cards
   -------------------------------------------------------------------------- */
.products-section { position: relative; overflow: hidden; }
.products-section .ornament--green { width: 420px; height: 420px; top: -140px; left: -160px; opacity: 0.3; }

.product-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(1rem, 0.6rem + 1.2vw, 1.6rem);
}

/* Five products: three across the top, the last two centred underneath.
   Six equal tracks let a 2-track card sit flush with the row above while the
   second row is inset by exactly one track on each side. */
@media (min-width: 1000px) {
  .product-grid--3-2 { grid-template-columns: repeat(6, 1fr); }
  .product-grid--3-2 > .product-card { grid-column: span 2; }
  .product-grid--3-2 > .product-card:nth-child(4) { grid-column: 2 / span 2; }
  .product-grid--3-2 > .product-card:nth-child(5) { grid-column: 4 / span 2; }
}
/* Two across on tablets: the fifth card centres rather than hanging left. */
@media (min-width: 640px) and (max-width: 999px) {
  .product-grid--3-2 { grid-template-columns: repeat(4, 1fr); }
  .product-grid--3-2 > .product-card { grid-column: span 2; }
  .product-grid--3-2 > .product-card:nth-child(5) { grid-column: 2 / span 2; }
}
.product-card {
  position: relative;
  display: flex; flex-direction: column;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base);
}
.product-card:hover { transform: translateY(-7px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--ink-50);
  overflow: hidden;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-out); }
.product-card:hover .product-media img { transform: scale(1.05); }
.product-flag {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--navy-800);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.product-zoom {
  position: absolute; right: 14px; bottom: 14px; z-index: 2;
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94); color: var(--navy-700);
  box-shadow: var(--shadow-md);
  transform: translateY(8px); opacity: 0;
  transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out), background var(--t-fast), color var(--t-fast);
}
.product-card:hover .product-zoom { opacity: 1; transform: none; }
.product-card:hover .product-zoom { background: var(--accent); color: var(--white); }
.product-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.product-body h3 { font-size: 1.16rem; margin-bottom: 4px; }
.product-generic { font-size: 0.83rem; font-weight: 600; color: var(--accent-dark); margin-bottom: 10px; }
.product-body p { font-size: 0.88rem; line-height: 1.6; color: var(--ink-500); margin-bottom: 16px; }
.product-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: auto; padding-top: 15px; border-top: 1px dashed var(--line-strong);
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--accent-dark);
}
.product-foot svg { transition: transform var(--t-base) var(--ease-out); }
.product-card:hover .product-foot svg { transform: translateX(4px); }

.disclaimer {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 22px; padding: 15px 20px;
  background: var(--ink-50);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  font-size: 0.82rem; line-height: 1.6; color: var(--ink-500);
}
.disclaimer svg { color: var(--ink-400); flex-shrink: 0; margin-top: 2px; }

/* --------------------------------------------------------------------------
   5. Course cards
   -------------------------------------------------------------------------- */
.course-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: clamp(1rem, 0.6rem + 1.2vw, 1.6rem);
}
.course-card {
  position: relative;
  display: flex; flex-direction: column; text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base);
}
.course-card:hover { transform: translateY(-7px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
.course-media { position: relative; aspect-ratio: 16 / 8; overflow: hidden; background: var(--navy-800); }
.course-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-out); }
.course-card:hover .course-media img { transform: scale(1.06); }
.course-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(4, 37, 54, 0.55) 100%);
}
.course-flag {
  position: absolute; top: 13px; left: 13px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-full);
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--white); background: rgba(4, 37, 54, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.course-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.course-body h3 { font-size: 1.12rem; line-height: 1.35; margin-bottom: 9px; }
.course-body p { font-size: 0.88rem; line-height: 1.62; color: var(--ink-500); margin-bottom: 16px; }
.course-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.course-actions { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.course-actions .btn { flex: 1; }

/* --------------------------------------------------------------------------
   6. Product dialog
   -------------------------------------------------------------------------- */
.product-dialog { display: grid; grid-template-columns: 0.95fr 1.05fr; min-height: 0; }
.pd-gallery {
  position: relative;
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  background: linear-gradient(160deg, var(--navy-50), var(--white));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px;
}
.pd-main {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.pd-main img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: var(--white); }
.pd-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.pd-thumb {
  width: 68px; height: 68px; border-radius: var(--r-xs); overflow: hidden;
  border: 2px solid var(--line-strong); background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast), transform var(--t-base) var(--ease-out);
}
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumb:hover { transform: translateY(-2px); }
.pd-thumb.is-active { border-color: var(--accent); }

.pd-info {
  padding: clamp(1.5rem, 1rem + 1.6vw, 2.25rem);
  display: flex; flex-direction: column; gap: 16px;
}
.pd-info h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem); margin: 0; }
.pd-generic { font-size: 0.92rem; font-weight: 600; color: var(--accent-dark); margin-top: -10px; }
.pd-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.pd-summary { font-size: 0.95rem; line-height: 1.7; color: var(--ink-600); }

.pd-features { display: grid; gap: 10px; }
.pd-feature {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 15px;
  background: var(--ink-50);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.pd-feature svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.pd-feature strong { display: block; font-family: var(--font-display); font-size: 0.9rem; color: var(--navy-800); }
.pd-feature span { font-size: 0.83rem; line-height: 1.55; color: var(--ink-500); }

.pd-specs { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.pd-spec { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 12px 16px; font-size: 0.86rem; }
.pd-spec + .pd-spec { border-top: 1px solid var(--line); }
.pd-spec dt { font-weight: 700; color: var(--navy-800); }
.pd-spec dd { color: var(--ink-500); line-height: 1.6; }

.pd-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--r-sm);
  background: var(--accent-soft);
  font-size: 0.8rem; line-height: 1.55; color: var(--ink-600);
}
.pd-note svg { color: var(--accent-dark); flex-shrink: 0; margin-top: 2px; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; }

@media (max-width: 880px) {
  .product-dialog { grid-template-columns: 1fr; }
  .pd-gallery { border-right: 0; border-bottom: 1px solid var(--line); }
  .pd-main img { aspect-ratio: 4 / 3; object-fit: contain; }
  .pd-spec { grid-template-columns: 1fr; gap: 2px; }
}

/* A product opened from inside a course dialog must layer above it */
#productModal { z-index: 10001; }

/* --------------------------------------------------------------------------
   7. Course dialog
   -------------------------------------------------------------------------- */
.course-dialog { display: flex; flex-direction: column; }
.cd-banner { position: relative; }
.cd-banner img { width: 100%; aspect-ratio: 16 / 6.2; object-fit: cover; }
.cd-banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4, 37, 54, 0.1) 40%, rgba(4, 37, 54, 0.82) 100%);
}
.cd-banner-copy { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); }
.cd-banner-copy .chip { background: rgba(255, 255, 255, 0.16); color: var(--white); border: 1px solid rgba(255, 255, 255, 0.24); margin-bottom: 10px; }
.cd-banner-copy h2 { color: var(--white); font-size: clamp(1.3rem, 1.1rem + 1.2vw, 2rem); margin: 0; }

.cd-body { padding: clamp(1.5rem, 1rem + 1.6vw, 2.25rem); display: flex; flex-direction: column; gap: 26px; }
.cd-lead { font-size: 1rem; line-height: 1.78; color: var(--ink-600); }
.cd-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.cd-point {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--ink-50); border: 1px solid var(--line);
}
.cd-point svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.cd-point strong { display: block; font-family: var(--font-display); font-size: 0.88rem; color: var(--navy-800); }
.cd-point span { font-size: 0.81rem; line-height: 1.5; color: var(--ink-500); }

.cd-sponsors {
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, var(--navy-50), var(--green-50));
  border: 1px solid var(--line);
}
.cd-sponsors-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 16px;
}
.cd-sponsors-head h4 { font-size: 1rem; }
.cd-sponsors-head span {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500);
}
.cd-ads { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cd-ad {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.cd-ad:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cd-ad-media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--ink-50); }
.cd-ad-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-out); }
.cd-ad:hover .cd-ad-media img { transform: scale(1.05); }
.cd-ad-tag {
  position: absolute; top: 10px; left: 10px;
  padding: 5px 10px; border-radius: var(--r-full);
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.92); color: var(--navy-700);
}
.cd-ad-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.cd-ad-title { display: block; font-family: var(--font-display); font-size: 0.98rem; font-weight: 800; color: var(--navy-800); margin-bottom: 3px; }
.cd-ad-body .cd-ad-generic { font-size: 0.76rem; font-weight: 600; color: var(--accent-dark); margin-bottom: 7px; }
.cd-ad-body p { font-size: 0.81rem; line-height: 1.55; color: var(--ink-500); margin-bottom: 12px; }
.cd-ad-link {
  margin-top: auto; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-size: 0.79rem; font-weight: 700; color: var(--accent-dark);
}

.cd-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 18px;
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  border-radius: var(--r-lg);
  background: var(--grad-brand);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-lg);
}
.cd-cta h4 { color: var(--white); font-size: 1.12rem; margin-bottom: 4px; }
.cd-cta p { font-size: 0.86rem; }
.cd-cta .btn { flex-shrink: 0; }

@media (max-width: 640px) {
  .cd-ads { grid-template-columns: 1fr; }
  .cd-cta { flex-direction: column; align-items: stretch; text-align: center; }
  .cd-cta .btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   8. Related subprograms
   -------------------------------------------------------------------------- */
/* Five cards across one row left every title wrapping onto three lines, so the
   row now breaks 3 + 2 with the pair centred - the same rhythm as the products. */
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
@media (min-width: 1000px) {
  .related-grid--3-2 { grid-template-columns: repeat(6, 1fr); }
  .related-grid--3-2 > * { grid-column: span 2; }
  .related-grid--3-2 > *:nth-child(4) { grid-column: 2 / span 2; }
  .related-grid--3-2 > *:nth-child(5) { grid-column: 4 / span 2; }
}
@media (min-width: 660px) and (max-width: 999px) {
  .related-grid--3-2 { grid-template-columns: repeat(4, 1fr); }
  .related-grid--3-2 > * { grid-column: span 2; }
  .related-grid--3-2 > *:nth-child(5) { grid-column: 2 / span 2; }
}

.related-card {
  display: flex; align-items: center; gap: 12px;
  min-height: 84px;
  padding: 15px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base), border-color var(--t-base);
}
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(90, 170, 66, 0.35); }
/* The middle column takes the slack so the trailing icon can never be squeezed */
.related-text { flex: 1; min-width: 0; }

.related-card--soon {
  background: var(--ink-50); border-style: dashed; color: var(--ink-400); cursor: default;
}
.related-card--soon:hover { transform: none; box-shadow: none; border-color: var(--line); }
.related-card--soon .related-icon { background: var(--ink-100); color: var(--ink-400); }
.related-card--soon strong { color: var(--ink-500); }
/* Reserves the same slot the arrow uses on a live card, so both keep one rhythm */
.related-lock {
  width: 28px; height: 28px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ink-100); color: var(--ink-400);
}
.related-icon {
  width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 12px; background: var(--navy-100); color: var(--navy-600);
}
.related-card strong {
  display: block; font-family: var(--font-display);
  font-size: 0.97rem; line-height: 1.3; color: var(--navy-800);
  margin-bottom: 3px;
}
/* Tuned so the longest row - "SP-04 - GastroGuard Plus - Coming soon" - still
   holds one line at the 3-across card width. */
.related-card span { font-size: 0.76rem; line-height: 1.45; color: var(--ink-500); }
.related-card svg.arrow {
  flex-shrink: 0; margin-inline: 5px; color: var(--ink-400);
  transition: transform var(--t-base) var(--ease-out), color var(--t-base);
}
.related-card:hover svg.arrow { transform: translateX(4px); color: var(--green-600); }

/* --------------------------------------------------------------------------
   9. Program CTA band
   -------------------------------------------------------------------------- */
.program-cta {
  position: relative; overflow: hidden;
  padding-block: clamp(3rem, 2.2rem + 2.6vw, 4.5rem);
  background: linear-gradient(120deg, var(--navy-900), var(--navy-700));
  text-align: center;
}
.program-cta::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(65% 90% at 50% 115%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%);
}
.program-cta .container { position: relative; z-index: 1; }
.program-cta h2 { color: var(--white); margin-bottom: 14px; }
.program-cta p { color: rgba(255, 255, 255, 0.78); font-size: var(--fs-lead); max-width: 60ch; margin: 0 auto 24px; }
.program-cta .cta-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
@media (max-width: 520px) { .program-cta .cta-actions .btn { width: 100%; } }
