/* Course detail layout for single product pages (2026-10-06 redesign).
 * Based on Ameer's Critical Thinking mockup, rebuilt on the site's brand tokens
 * from landing.css. Loaded after product.css and WooCommerce's CSS so it wins.
 * Everything is scoped under .cd so other templates are untouched.
 */

.eduk8u-product .cd {
  padding-top: 24px;
  padding-bottom: 72px;
}

.cd-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--ink-500);
  font-size: 14px;
}
.cd-crumbs a { color: var(--ink-700); text-decoration: none; }
.cd-crumbs a:hover { color: var(--brand-orange); }
.cd-crumbs [aria-current="page"] { color: var(--ink-500); }

/* WooCommerce gives div.product its own float layout; reset it. */
.eduk8u-product .cd .cd-product { margin: 0; }
.eduk8u-product.woocommerce .cd div.product div.summary,
.eduk8u-product .cd .cd-buy {
  float: none;
  width: auto;
  margin: 0;
}

/* ---------- Top grid: hero card + buy box ---------- */
/* Desktop: hero card and accordion on the left, one sticky column on the right
 * holding the buy box and help card. Mobile flattens the right column so the
 * order becomes hero, buy box, accordion, help card. */
.cd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas:
    "main side"
    "acc  side";
  grid-template-rows: auto 1fr;
  column-gap: 28px;
  row-gap: 24px;
  align-items: start;
}
.cd-main { grid-area: main; }
.cd-accordion { grid-area: acc; }
.cd-side {
  grid-area: side;
  position: sticky;
  top: 96px;
  display: grid;
  gap: 20px;
}

.cd-main {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: 0 12px 34px rgba(7, 26, 52, .07);
}

.cd-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 300px;
  padding: 40px;
  display: flex;
  align-items: flex-end;
  color: var(--white);
  background: linear-gradient(120deg, var(--brand-navy-900), var(--brand-navy));
}
/* Theme rules set img height:auto; the extra scope keeps the photo filling the hero. */
.eduk8u-product .cd .cd-hero .cd-hero__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Left side shaded dark so the title always reads over the photo. */
.cd-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg,
    rgba(10, 20, 40, .94) 0%,
    rgba(10, 20, 40, .84) 40%,
    rgba(10, 20, 40, .35) 75%,
    rgba(10, 20, 40, .10) 100%);
}
.cd-hero__copy { max-width: 620px; }

.cd-eyebrow {
  margin: 0 0 12px;
  color: #FFB197;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eduk8u-product .cd .cd-title {
  margin: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(36px, 4.6vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.02em;
}

.cd-hero__sub {
  margin-top: 16px;
  color: #D5E1F2;
  font-size: 15px;
  line-height: 1.5;
}
.cd-hero__sub p { margin: 0; }

.cd-body { padding: 28px 32px 32px; }

.cd-summary {
  max-width: 720px;
  margin: 0 0 24px;
  color: var(--ink-700);
  font-size: 18px;
  line-height: 1.55;
}

.cd-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.cd-fact {
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.cd-fact:hover {
  position: relative;
  z-index: 1;
  transform: translateY(-3px);
  background: #FFFDF9;
  box-shadow: 0 12px 25px rgba(7, 26, 52, .08);
}
.cd-fact__num {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--brand-navy);
  background: #EAF0F8;
  font-size: 13px;
  font-weight: 700;
}
.eduk8u-product .cd .cd-fact__label {
  margin: 0 0 4px;
  color: var(--brand-orange);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  line-height: 1.4;
  text-transform: uppercase;
}
/* An odd last fact spans the full row instead of leaving an empty cell. */
.cd-fact:last-child:nth-child(odd) { grid-column: 1 / -1; }
.cd-fact p { margin: 0; color: var(--ink-900); font-size: 15px; line-height: 1.45; }

/* ---------- Buy box ---------- */
.cd-buy {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: 0 12px 34px rgba(7, 26, 52, .07);
}

.cd-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  color: var(--green);
  background: #E7F4EC;
  font-size: 12px;
  font-weight: 700;
}
.cd-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.cd-buy__title {
  margin: 16px 0 14px;
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
}
.cd-buy__label {
  margin: 0 0 2px;
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* WooCommerce price output (p.price), restyled only. */
.eduk8u-product .cd .cd-buy .price {
  margin: 0 0 18px;
  color: var(--brand-navy);
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
}
.eduk8u-product .cd .cd-buy .price del { color: var(--ink-400); font-size: .55em; }
.eduk8u-product .cd .cd-buy .price ins { text-decoration: none; }

/* WooCommerce add-to-cart form, restyled only. */
.eduk8u-product .cd .cd-buy form.cart {
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
}
.eduk8u-product .cd .cd-buy form.cart::before,
.eduk8u-product .cd .cd-buy form.cart::after { content: none; }
.eduk8u-product .cd .cd-buy form.cart .quantity { float: none; margin: 0; }
.eduk8u-product .cd .cd-buy form.cart .quantity input.qty {
  width: 64px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font: inherit;
  text-align: center;
}
.eduk8u-product .cd .cd-buy form.cart .single_add_to_cart_button {
  flex: 1;
  float: none;
  height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r);
  color: var(--white);
  background: var(--brand-orange);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.eduk8u-product .cd .cd-buy form.cart .single_add_to_cart_button:hover {
  background: var(--brand-orange-600);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(221, 84, 38, .25);
}

.cd-points {
  margin: 0 0 18px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.cd-points li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-700);
  font-size: 14px;
}
.cd-points li + li { margin-top: 8px; }
.cd-points li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.cd-advisor {
  color: var(--brand-navy);
  font-size: 14px;
  font-weight: 600;
  text-underline-offset: 3px;
}
.cd-advisor:hover { color: var(--brand-orange); }

/* ---------- Details: accordions + help card ---------- */
.cd-accordion {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
}
.cd-accordion details { border-bottom: 1px solid var(--line); }
.cd-accordion details:last-child { border-bottom: 0; }
.cd-accordion summary {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  list-style: none;
}
.cd-accordion summary::-webkit-details-marker { display: none; }
.cd-accordion summary::after {
  content: "+";
  color: var(--brand-orange);
  font-size: 24px;
  line-height: 1;
}
.cd-accordion details[open] summary::after { content: "\2212"; }
.cd-accordion summary:hover { background: var(--paper); }
.eduk8u-product .cd .cd-acc-title {
  margin: 0;
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}
.cd-acc-body {
  padding: 0 24px 22px;
  color: var(--ink-700);
  line-height: 1.6;
}
.cd-acc-body > :first-child { margin-top: 0; }
.cd-acc-body > :last-child { margin-bottom: 0; }
.cd-acc-body ul { margin: 0; padding-left: 20px; }
.cd-acc-body li + li { margin-top: 8px; }

.cd-help {
  padding: 26px;
  border-radius: var(--r-lg);
  color: #D5E1F2;
  background: var(--brand-navy);
}
.eduk8u-product .cd .cd-help h2 {
  margin: 0 0 8px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 26px;
}
.cd-help p { margin: 0 0 18px; }
.eduk8u-product .cd .cd-help .btn {
  display: inline-block;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--r);
  color: var(--white);
  background: var(--brand-orange);
  font-weight: 700;
  text-decoration: none;
}
.eduk8u-product .cd .cd-help .btn:hover { background: var(--brand-orange-600); }

/* ---------- Related courses (own cards, 2026-10-07) ---------- */
.cd-related { margin-top: 56px; clear: both; }
.cd-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.eduk8u-product .cd .cd-section-head h2,
.eduk8u-product .cd .cd-reviews h2 {
  margin: 0;
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.1;
}
.cd-section-head p { margin: 6px 0 0; color: var(--ink-500); font-size: 14px; }
.cd-browse { color: var(--brand-orange); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.cd-browse:hover { text-decoration: underline; }

.cd-related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.cd-rel-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  box-shadow: 0 10px 26px rgba(7, 26, 52, .055);
  transition: transform .25s ease, box-shadow .25s ease;
}
.cd-rel-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(7, 26, 52, .1); }
.cd-rel-image { display: block; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--brand-navy-900), var(--brand-navy)); }
.eduk8u-product .cd .cd-rel-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cd-rel-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.cd-rel-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.cd-rel-cat { color: var(--brand-orange); }
.cd-rel-num { color: var(--ink-400); }
.eduk8u-product .cd .cd-rel-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.25;
}
.cd-rel-title a { color: var(--ink-900); text-decoration: none; }
.cd-rel-title a:hover { color: var(--brand-orange); }
.cd-rel-desc {
  margin: 0 0 16px;
  color: var(--ink-500);
  font-size: 13.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cd-rel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.eduk8u-product .cd .cd-rel-price,
.eduk8u-product .cd .cd-rel-price .amount { color: var(--ink-900); font-weight: 700; font-size: 15px; }
.cd-rel-link { color: var(--brand-orange); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.cd-rel-link:hover { text-decoration: underline; }

/* ---------- Reviews (WooCommerce's own list and form, collapsed by default) ---------- */
.cd-reviews {
  margin-top: 56px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: 0 12px 34px rgba(7, 26, 52, .07);
}
.cd-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cd-review-copy p { margin: 8px 0 10px; max-width: 520px; color: var(--ink-500); }
.cd-review-meta { display: flex; align-items: center; gap: 10px; color: var(--ink-500); font-size: 14px; }
.cd-review-stars { color: var(--gold); letter-spacing: 2px; font-size: 16px; }
.cd-review-toggle {
  padding: 12px 20px;
  border: 1.5px solid var(--brand-orange);
  border-radius: var(--r);
  color: var(--brand-orange);
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.cd-review-toggle:hover,
.cd-review-toggle[aria-expanded="true"] { background: var(--brand-orange); color: var(--white); }
.cd-reviews.is-collapsed #review_form_wrapper { display: none; }
/* Our head replaces WooCommerce's own title and empty-state line. */
.eduk8u-product .cd .cd-reviews .woocommerce-Reviews-title,
.eduk8u-product .cd .cd-reviews .woocommerce-noreviews { display: none; }
.eduk8u-product .cd .cd-reviews #reviews { margin-top: 8px; }
.eduk8u-product .cd .cd-reviews #reviews #comments { float: none; width: auto; }
.eduk8u-product .cd .cd-reviews #review_form_wrapper { float: none; width: auto; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.eduk8u-product .cd .cd-reviews .comment-reply-title {
  display: block;
  margin: 8px 0 12px;
  color: var(--ink-900);
  font-weight: 700;
}
.eduk8u-product .cd .cd-reviews input[type="text"],
.eduk8u-product .cd .cd-reviews input[type="email"],
.eduk8u-product .cd .cd-reviews #respond textarea#comment,
.eduk8u-product .cd .cd-reviews textarea {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font: inherit;
}
.eduk8u-product .cd .cd-reviews #respond input#submit {
  padding: 12px 22px;
  border: 0;
  border-radius: var(--r);
  color: var(--white);
  background: var(--brand-orange);
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Mobile sticky buy bar ---------- */
.cd-mobile-buy { display: none; }

@media (max-width: 1024px) {
  .cd-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .cd-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "buy" "acc" "help";
    grid-template-rows: none;
  }
  .cd-side { display: contents; }
  .cd-buy { grid-area: buy; }
  .cd-help { grid-area: help; }
  .cd-hero { min-height: 240px; padding: 26px; }
  .cd-hero::before {
    background: linear-gradient(0deg, rgba(10, 20, 40, .92) 0%, rgba(10, 20, 40, .6) 60%, rgba(10, 20, 40, .3) 100%);
  }
  .cd-body { padding: 22px; }
  .cd-reviews { padding: 22px; }

  .eduk8u-product .cd { padding-bottom: 96px; }
  .cd-mobile-buy {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--white);
    box-shadow: 0 -8px 24px rgba(11, 23, 48, .1);
  }
  /* Lift the WhatsApp button above the sticky bar so it doesn't cover Add to cart. */
  .eduk8u-product:has(.cd-mobile-buy) .float-wa { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .cd-mobile-buy__price {
    color: var(--brand-navy);
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
  }
  .cd-mobile-buy__btn {
    padding: 12px 20px;
    border: 0;
    border-radius: var(--r);
    color: var(--white);
    background: var(--brand-orange);
    font-weight: 700;
  }
}

@media (max-width: 520px) {
  .cd-facts { grid-template-columns: 1fr; }
  .cd-fact:last-child:nth-child(odd) { grid-column: auto; }
  .cd-related-grid { grid-template-columns: 1fr; }
  .cd-reviews { padding: 22px; }
  .cd-section-head { flex-direction: column; align-items: flex-start; }
}

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