/*
 * product-page: course-style single product layout.
 * Scoped to .mj-product; loaded only on single product pages.
 */

.mj-product-on .main-page-wrapper {
  padding-top: 0;
  background: var(--mj-page);
}

.mj-product-on .main-page-wrapper .wd-content-layout {
  padding-block: 0;
  background: var(--mj-page);
}

.mj-product-on .wd-sticky-btn {
  display: none !important;
}

.mj-product {
  --mj-gap: clamp(20px, 3vw, 36px);
  font-family: var(--mj-font);
  color: var(--mj-ink);
  padding-bottom: 4rem;
}

.mj-product svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hero with a light girih (eight-point star) lattice */
.mj-hero {
  position: relative;
  padding: clamp(28px, 4vw, 48px) 0 clamp(90px, 10vw, 130px);
  background-color: var(--mj-sand);
  background-image:
    linear-gradient(180deg, rgba(245, 241, 234, 0) 55%, var(--mj-page) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23b08d57' stroke-opacity='.22' stroke-width='1'%3E%3Cpath d='M32 14l5.3 12.7L50 32l-12.7 5.3L32 50l-5.3-12.7L14 32l12.7-5.3z'/%3E%3Cpath d='M19.3 19.3h25.4v25.4H19.3z' transform='rotate(45 32 32)'/%3E%3Cpath d='M0 0l14 14M64 0L50 14M0 64l14-14M64 64L50 50'/%3E%3C/g%3E%3C/svg%3E");
  border-bottom: 1px solid var(--mj-line);
}

.mj-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.mj-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: var(--mj-muted);
}

.mj-breadcrumb a {
  color: var(--mj-muted);
  text-decoration: none;
}

.mj-breadcrumb a:hover {
  color: var(--mj-primary);
}

.mj-breadcrumb__sep {
  opacity: .5;
}

.mj-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mj-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border: 1px solid color-mix(in srgb, var(--mj-gold) 40%, transparent);
  border-radius: 999px;
  background: var(--mj-gold-soft);
  font-size: .82rem;
  font-weight: 600;
  color: #7a5f35;
  text-decoration: none;
}

.mj-chip:hover {
  color: #5e4726;
}

.mj-hero__title.product_title {
  margin: 0;
  max-width: 22ch;
  font-family: var(--mj-font-title);
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 800;
  line-height: 1.35;
  color: var(--mj-ink);
}

.mj-hero__subtitle {
  margin: 0;
  max-width: 60ch;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.9;
  color: var(--mj-muted);
}

.mj-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 6px;
}

.mj-hero__teacher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}

.mj-hero__teacher strong {
  display: block;
  font-size: .98rem;
}

.mj-hero__teacher small {
  display: block;
  font-size: .82rem;
  color: var(--mj-muted);
}

.mj-hero__rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: var(--mj-muted);
  text-decoration: none;
}

.mj-hero__rating .star-rating {
  margin: 0;
}

.mj-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--mj-primary);
  color: var(--mj-on-primary);
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 0 0 3px var(--mj-surface), 0 0 0 4px color-mix(in srgb, var(--mj-gold) 55%, transparent);
}

.mj-avatar--lg {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
}

/* Two-column layout: sidebar (buy) + main (details) */
.mj-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: var(--mj-gap);
  align-items: start;
  margin-top: clamp(-100px, -8vw, -60px);
  position: relative;
}

.mj-aside {
  position: sticky;
  top: calc(var(--wd-admin-bar-h, 0px) + 24px);
}

.admin-bar .mj-aside {
  top: 56px;
}

/* Buy card */
.mj-buy {
  overflow: hidden;
  background: var(--mj-surface);
  border: 1px solid var(--mj-line);
  border-radius: var(--mj-radius-lg);
  box-shadow: var(--mj-shadow);
}

.mj-buy__media {
  aspect-ratio: 3 / 2;
  background: var(--mj-sand);
}

.mj-buy__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mj-buy__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.mj-buy__price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mj-buy__price-label {
  font-size: .9rem;
  color: var(--mj-muted);
}

.mj-buy__price,
.mj-buy__price .price {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--mj-ink);
}

.mj-buy__price .amount,
.mj-mobilebar__price .amount {
  color: inherit;
}

.mj-buy__price del {
  display: block;
  font-size: .95rem;
  font-weight: 400;
  color: var(--mj-muted);
}

.mj-buy__price ins {
  text-decoration: none;
}

.mj-buy__price .woocommerce-Price-currencySymbol {
  font-size: .9rem;
  font-weight: 600;
  color: var(--mj-muted);
}

/* WooCommerce add to cart form inside the card */
.mj-buy__cart form.cart {
  display: flex;
  margin: 0;
  gap: 10px;
}

.mj-buy__cart .quantity {
  display: none !important;
}

.mj-buy__cart .stock {
  margin: 0 0 10px;
  font-size: .9rem;
}

.mj-product .mj-btn,
.mj-buy__cart .single_add_to_cart_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--mj-radius);
  font-family: var(--mj-font);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, transform .15s ease, box-shadow .2s ease;
}

.mj-product .mj-btn--primary,
.mj-buy__cart .single_add_to_cart_button {
  background: var(--mj-primary);
  color: var(--mj-on-primary);
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--mj-primary) 85%, transparent);
}

.mj-product .mj-btn--primary:hover,
.mj-buy__cart .single_add_to_cart_button:hover {
  background: var(--mj-primary-hover);
  color: var(--mj-on-primary);
}

.mj-product .mj-btn:active,
.mj-buy__cart .single_add_to_cart_button:active {
  transform: translateY(1px);
}

.mj-product .mj-btn:focus-visible,
.mj-buy__cart .single_add_to_cart_button:focus-visible {
  outline: 2px solid var(--mj-primary);
  outline-offset: 3px;
}

.mj-buy__note {
  margin: -6px 0 0;
  font-size: .85rem;
  line-height: 1.8;
  color: var(--mj-muted);
  text-align: center;
}

.mj-owned {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mj-owned__badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--mj-radius-sm);
  background: var(--mj-success-soft);
  color: var(--mj-success);
  font-size: .92rem;
  font-weight: 600;
}

.mj-owned__badge svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

/* Facts list */
.mj-facts {
  margin: 0;
  padding: 16px 0 0;
  list-style: none;
  border-top: 1px dashed var(--mj-line);
}

.mj-facts__item {
  display: grid;
  grid-template-columns: 22px auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 0;
  font-size: .93rem;
  line-height: 1.6;
}

.mj-facts__item + .mj-facts__item {
  border-top: 1px solid color-mix(in srgb, var(--mj-line) 60%, transparent);
}

.mj-facts__item svg {
  width: 20px;
  height: 20px;
  color: var(--mj-gold);
}

.mj-facts__label {
  color: var(--mj-muted);
}

.mj-facts__value {
  font-weight: 600;
  text-align: end;
}

/* Main column */
.mj-main {
  display: flex;
  flex-direction: column;
  gap: var(--mj-gap);
  min-width: 0;
  padding-top: clamp(60px, 8vw, 100px);
}

.mj-toc {
  position: sticky;
  top: calc(var(--wd-admin-bar-h, 0px) + 12px);
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  background: color-mix(in srgb, var(--mj-surface) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--mj-line);
  border-radius: var(--mj-radius);
}

.admin-bar .mj-toc {
  top: 44px;
}

.mj-toc::-webkit-scrollbar {
  display: none;
}

.mj-toc a {
  flex: none;
  padding: 8px 14px;
  border-radius: calc(var(--mj-radius) - 5px);
  font-size: .9rem;
  font-weight: 600;
  color: var(--mj-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}

.mj-toc a:hover {
  color: var(--mj-ink);
}

.mj-toc a.is-active {
  background: var(--mj-primary-soft);
  color: var(--mj-primary);
}

.mj-lead {
  font-size: 1.12rem;
  line-height: 2.1;
  color: var(--mj-ink);
}

.mj-lead p {
  margin: 0;
}

.mj-section {
  scroll-margin-top: 90px;
  padding: clamp(22px, 3vw, 34px);
  background: var(--mj-surface);
  border: 1px solid var(--mj-line);
  border-radius: var(--mj-radius-lg);
  box-shadow: var(--mj-shadow-sm);
}

.mj-section__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-family: var(--mj-font-title);
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  font-weight: 800;
  line-height: 1.5;
  color: var(--mj-ink);
}

.mj-product .mj-star {
  flex: none;
  width: 20px;
  height: 20px;
  fill: var(--mj-gold-soft);
  stroke: var(--mj-gold);
  stroke-width: 1.3;
}

.mj-subtitle {
  margin: 26px 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mj-ink);
}

.mj-prose {
  font-size: 1.02rem;
  line-height: 2.1;
  color: #3d372f;
}

.mj-prose > :first-child {
  margin-top: 0;
}

.mj-prose > :last-child {
  margin-bottom: 0;
}

.mj-prose p {
  margin: 0 0 1em;
}

/* Outcomes checklist */
.mj-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mj-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--mj-radius);
  background: var(--mj-sand);
  font-size: .96rem;
  line-height: 1.85;
}

.mj-checklist__icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--mj-primary);
  color: var(--mj-on-primary);
}

.mj-checklist__icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

/* Audience */
.mj-audience {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mj-audience li {
  position: relative;
  margin: 0;
  padding-inline-start: 26px;
  font-size: 1rem;
  line-height: 1.9;
}

.mj-audience li::before {
  content: "";
  position: absolute;
  top: .72em;
  inset-inline-start: 4px;
  width: 9px;
  height: 9px;
  background: var(--mj-gold);
  transform: rotate(45deg);
  border-radius: 2px;
}

/* Syllabus timeline */
.mj-steps {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.mj-steps__item {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  margin: 0;
  padding: 0 0 20px;
}

.mj-steps__item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 44px;
  bottom: 4px;
  inset-inline-start: 19.5px;
  width: 1px;
  background: repeating-linear-gradient(180deg, var(--mj-line) 0 5px, transparent 5px 9px);
}

.mj-steps__num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--mj-gold) 50%, transparent);
  border-radius: 12px;
  background: var(--mj-gold-soft);
  color: #7a5f35;
  font-weight: 800;
}

.mj-steps__item strong {
  display: block;
  padding-top: 7px;
  font-size: 1.02rem;
  line-height: 1.6;
}

.mj-steps__item p {
  margin: 4px 0 0;
  font-size: .95rem;
  line-height: 1.9;
  color: var(--mj-muted);
}

/* Instructor */
.mj-teacher {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.mj-teacher__name {
  display: block;
  font-size: 1.1rem;
}

.mj-teacher__role {
  display: block;
  margin-top: 2px;
  font-size: .88rem;
  color: var(--mj-gold);
  font-weight: 600;
}

.mj-teacher p {
  margin: 10px 0 0;
  line-height: 2;
  color: #3d372f;
}

/* FAQ */
.mj-faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mj-faq__item {
  border: 1px solid var(--mj-line);
  border-radius: var(--mj-radius);
  background: var(--mj-surface);
  transition: border-color .2s ease, background-color .2s ease;
}

.mj-faq__item[open] {
  border-color: color-mix(in srgb, var(--mj-primary) 30%, transparent);
  background: color-mix(in srgb, var(--mj-primary-soft) 45%, var(--mj-surface));
}

.mj-faq__item summary {
  position: relative;
  display: block;
  padding: 16px 18px;
  padding-inline-end: 48px;
  font-weight: 700;
  line-height: 1.7;
  cursor: pointer;
  list-style: none;
}

.mj-faq__item summary::-webkit-details-marker {
  display: none;
}

.mj-faq__item summary::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-end: 20px;
  width: 9px;
  height: 9px;
  margin-top: -7px;
  border-right: 2px solid var(--mj-muted);
  border-bottom: 2px solid var(--mj-muted);
  transform: rotate(45deg);
  transition: transform .25s var(--mj-ease), margin .25s var(--mj-ease);
}

.mj-faq__item[open] summary::after {
  margin-top: -2px;
  transform: rotate(-135deg);
}

.mj-faq__item summary:focus-visible {
  outline: 2px solid var(--mj-primary);
  outline-offset: -2px;
  border-radius: var(--mj-radius);
}

.mj-faq__item p {
  margin: 0;
  padding: 0 18px 18px;
  line-height: 2;
  color: #3d372f;
}

/* Reviews (WooCommerce markup) */
.mj-reviews #reviews {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0;
}

.mj-reviews #reviews .woocommerce-Reviews-title,
.mj-reviews #reviews #comments > h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.mj-reviews .woocommerce-noreviews {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--mj-radius);
  background: var(--mj-sand);
  color: var(--mj-muted);
}

.mj-reviews #reviews .comment-reply-title {
  display: block;
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 700;
}

.mj-reviews #review_form_wrapper,
.mj-reviews #comments {
  width: 100%;
  max-width: none;
  flex: none;
  padding: 0;
}

.mj-reviews #reviews textarea,
.mj-reviews #reviews input[type="text"],
.mj-reviews #reviews input[type="email"] {
  border: 1px solid var(--mj-line);
  border-radius: var(--mj-radius);
  background: var(--mj-surface);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.mj-reviews #reviews textarea:focus,
.mj-reviews #reviews input:focus {
  border-color: var(--mj-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mj-primary) 14%, transparent);
  outline: 0;
}

.mj-reviews #reviews .form-submit input[type="submit"] {
  min-height: 48px;
  padding: 10px 28px;
  border-radius: var(--mj-radius);
  background: var(--mj-primary);
  color: var(--mj-on-primary);
  font-weight: 700;
}

/* Mobile sticky buy bar */
.mj-mobilebar {
  display: none;
}

@media (max-width: 1024px) {
  .mj-layout {
    grid-template-columns: minmax(0, 1fr);
    margin-top: -70px;
  }

  .mj-aside {
    position: static;
    max-width: 560px;
    width: 100%;
    margin-inline: auto;
  }

  .mj-main {
    padding-top: 0;
  }

  .mj-hero__inner {
    align-items: center;
    text-align: center;
  }

  .mj-hero__title.product_title,
  .mj-hero__subtitle {
    margin-inline: auto;
  }

  .mj-breadcrumb,
  .mj-chips,
  .mj-hero__meta {
    justify-content: center;
  }

  .mj-mobilebar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 390;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--mj-surface) 94%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--mj-line);
    box-shadow: 0 -10px 30px -18px rgba(35, 31, 26, .35);
    visibility: hidden;
    transform: translateY(calc(100% + 140px));
    transition: transform .3s var(--mj-ease), visibility 0s linear .3s;
  }

  .mj-mobilebar.is-visible {
    visibility: visible;
    transform: none;
    transition: transform .3s var(--mj-ease), visibility 0s;
  }

  .mj-mobilebar__price {
    font-size: 1.15rem;
    font-weight: 800;
    white-space: nowrap;
  }

  .mj-mobilebar .mj-btn {
    width: auto;
    min-height: 48px;
    flex: 0 1 220px;
  }

  body.mj-product-on:has(.wd-toolbar) .mj-mobilebar {
    bottom: var(--mj-toolbar-h, 55px);
    padding-bottom: 12px;
  }

  .mj-product-on .scrollToTop {
    bottom: 140px;
  }
}

@media (max-width: 600px) {
  .mj-hero {
    padding-bottom: 90px;
  }

  .mj-buy__body {
    padding: 18px;
  }

  .mj-section {
    border-radius: var(--mj-radius);
  }

  .mj-teacher {
    flex-direction: column;
  }

  .mj-checklist {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mj-product *,
  .mj-mobilebar {
    transition: none !important;
  }
}
