/* ── Catalog page ─────────────────────────────────────────────────────── */

.catalog-header {
  max-width: 960px;
  margin: 3rem auto 2rem;
  padding: 0 1.5rem;
}
.catalog-header h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 .35rem;
}
.catalog-header p {
  color: #64748b;
  font-size: 1.05rem;
  margin: 0;
}

/* Country selector */
.catalog-toolbar {
  max-width: 960px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.catalog-toolbar label {
  font-size: .85rem;
  font-weight: 600;
  color: #475569;
}
.catalog-toolbar select {
  font-size: .85rem;
  padding: .4rem .75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
}
.catalog-toolbar select:focus {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
}

/* Publisher groups */
.catalog-publisher-group {
  max-width: 960px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
}
.catalog-publisher-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #334155;
  margin: 0 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid #e2e8f0;
}

/* Workbook card grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.catalog-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .2s, transform .15s;
  display: flex;
  flex-direction: column;
}
.catalog-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.catalog-card-cover {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: #f8fafc;
  display: block;
}
.catalog-card-cover-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 2rem;
}
.catalog-card-body {
  padding: 1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.catalog-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #1e293b;
  margin: 0 0 .35rem;
  line-height: 1.35;
  min-height: 2.7rem;
}
.catalog-card-title a {
  color: inherit;
  text-decoration: none;
}
.catalog-card-title a:hover {
  color: #6366f1;
}
.catalog-card-desc {
  color: #64748b;
  font-size: .85rem;
  line-height: 1.5;
  margin: 0 0 .75rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-card-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding-top: .75rem;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}
.catalog-card-footer .catalog-btn {
  width: 100%;
  justify-content: center;
}
.catalog-card-external-links {
  width: 100%;
}
.catalog-card-external-label {
  font-size: .7rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .4rem;
}
.catalog-card-external-btns {
  display: flex;
  gap: .4rem;
  justify-content: center;
  flex-wrap: wrap;
}
.catalog-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: #1e293b;
}
.catalog-price-label {
  font-size: .75rem;
  font-weight: 500;
  color: #94a3b8;
}

/* Buttons */
.catalog-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  font-size: .82rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.catalog-btn-primary {
  background: #6366f1;
  color: #fff;
}
.catalog-btn-primary:hover {
  background: #4f46e5;
}
.catalog-btn-secondary {
  background: #f1f5f9;
  color: #475569;
}
.catalog-btn-secondary:hover {
  background: #e2e8f0;
}
.catalog-btn-ghost {
  background: transparent;
  color: #6366f1;
  border: 1px solid #e2e8f0;
}
.catalog-btn-ghost:hover {
  background: #f1f5f9;
}
.catalog-btn-in-cart {
  background: #dcfce7;
  color: #166534;
  cursor: default;
}
.catalog-btn-danger {
  background: #fef2f2;
  color: #dc2626;
}
.catalog-btn-danger:hover {
  background: #fee2e2;
}

/* ── Workbook detail page ────────────────────────────────────────────── */

.wb-detail {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.wb-hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
  align-items: start;
}
/* Body CTA (duplicate at bottom of description) — desktop/tablet only */
.wb-body-cta {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}
.wb-body-cta .wb-hero-price {
  text-align: left;
  margin-bottom: .5rem;
}
.wb-body-cta .wb-hero-actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}
.wb-body-cta .wb-hero-actions .catalog-btn,
.wb-body-cta .wb-hero-actions form {
  width: auto;
}
.wb-body-cta .wb-external-links {
  border-top: none;
  padding-top: 0;
  margin-top: .75rem;
}
.wb-body-cta .wb-external-links-label {
  text-align: left;
}
.wb-body-cta .wb-external-links-btns {
  justify-content: flex-start;
}

@media (max-width: 640px) {
  .wb-hero {
    grid-template-columns: 1fr;
  }
  /* On mobile: hide the body CTA duplicate; left column already shows it */
  .wb-body-cta {
    display: none;
  }
}
.wb-hero-left {
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.wb-hero-cover {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  background: #f1f5f9;
}
.wb-hero-cover-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 3rem;
}
.wb-hero-body h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 .5rem;
  color: #1e293b;
}
.wb-hero-publisher {
  font-size: .9rem;
  color: #64748b;
  margin-bottom: .75rem;
}
.wb-hero-description {
  color: #475569;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

/* Rendered markdown inside the workbook description */
.wb-description-body h1,
.wb-description-body h2,
.wb-description-body h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: #1e293b;
  margin: 1.1rem 0 .35rem;
  line-height: 1.3;
}
.wb-description-body h1 { font-size: 1.05rem; }
.wb-description-body h2 { font-size: .98rem; }
.wb-description-body h3 { font-size: .92rem; color: #334155; }
.wb-description-body p  { margin: 0 0 .6rem; }
.wb-description-body ul,
.wb-description-body ol {
  margin: .25rem 0 .6rem 1.25rem;
  padding: 0;
}
.wb-description-body li { margin-bottom: .2rem; }
.wb-description-body strong { font-weight: 700; color: #1e293b; }
.wb-description-body hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: .75rem 0;
}
/* The first h1 duplicates the page title — render it smaller as a tagline */
.wb-description-body > h1:first-child {
  font-size: .95rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 0;
}
.wb-hero-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: #1e293b;
  text-align: center;
}
.wb-hero-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: stretch;
}
.wb-hero-actions .catalog-btn,
.wb-hero-actions form {
  width: 100%;
}
.wb-hero-actions .catalog-btn {
  text-align: center;
  justify-content: center;
}
.wb-external-links {
  border-top: 1px solid #e2e8f0;
  padding-top: .75rem;
}
.wb-external-links-label {
  font-size: .75rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: .5rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: center;
}
.wb-external-links-btns {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.wb-external-links a {
  display: inline-block;
  margin-right: .5rem;
}

/* Platform-branded external purchase buttons */
.wb-external-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem 1rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-decoration: none;
  border: 2px solid transparent;
  transition: filter .15s, transform .1s;
  letter-spacing: .01em;
}
.wb-external-btn:hover {
  filter: brightness(.92);
  transform: translateY(-1px);
}
.wb-external-btn-amazon {
  background: #FF9900;
  color: #111;
  border-color: #e68900;
}
.wb-external-btn-tpt {
  background: #4aac39;
  color: #fff;
  border-color: #3d9130;
}

/* Lessons table in workbook detail */
.wb-lessons-section {
  margin-top: 2rem;
}
.wb-lessons-section h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #334155;
  margin: 0 0 1rem;
}
.wb-lessons-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.wb-lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.wb-lesson-row:hover {
  border-color: #c7d2fe;
}
.wb-lesson-info {
  flex: 1;
  min-width: 0;
}
.wb-lesson-number {
  font-weight: 700;
  color: #6366f1;
  font-size: .85rem;
}
.wb-lesson-title {
  font-weight: 600;
  color: #1e293b;
  font-size: .92rem;
}
.wb-lesson-title-link {
  text-decoration: none;
  transition: color .15s;
}
.wb-lesson-title-link:hover {
  color: #6366f1;
  text-decoration: underline;
}
.wb-lesson-summary {
  color: #64748b;
  font-size: .8rem;
  margin-top: .15rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wb-lesson-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

/* ── Cart page ───────────────────────────────────────────────────────── */

.cart-page {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.cart-page h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 1.5rem;
}
.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
  font-size: 1.1rem;
}
.cart-items {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-type {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6366f1;
}
.cart-item-title {
  font-weight: 600;
  color: #1e293b;
  font-size: .95rem;
}
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}
.cart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 1.25rem;
}
.cart-summary-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: #334155;
}
.cart-summary-total {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: #1e293b;
}
.cart-checkout-row {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}

/* ── Lesson viewer ───────────────────────────────────────────────────── */

.lesson-viewer {
  max-width: 960px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.5rem;
}

.lesson-back-row {
  margin-bottom: 1.25rem;
}

/* Hero layout */
.lesson-hero {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.lesson-hero-left {
  flex-shrink: 0;
  width: 180px;
}

.lesson-hero-cover {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  display: block;
}

.lesson-hero-cover-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.lesson-hero-body {
  flex: 1;
  min-width: 0;
}

.lesson-hero-eyebrow {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6366f1;
  margin-bottom: .35rem;
}

.lesson-hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 .65rem;
  line-height: 1.25;
}

.lesson-hero-summary {
  color: #475569;
  font-size: 1rem;
  line-height: 1.65;
  margin: 0 0 1.1rem;
}

/* Locale switcher */
.lesson-locale-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.lesson-locale-label {
  font-size: .8rem;
  color: #64748b;
  font-weight: 600;
}

.lesson-locale-pill {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  border: 1.5px solid #cbd5e1;
  font-size: .78rem;
  font-weight: 700;
  color: #475569;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}

.lesson-locale-pill:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.lesson-locale-pill--active {
  border-color: #6366f1;
  background: #6366f1;
  color: #fff !important;
}

/* Price + purchase area */
.lesson-hero-purchase {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
}

.lesson-hero-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
}

.lesson-hero-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}

/* Media row (video + slides) */
.lesson-media-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.lesson-media-item {
  display: flex;
  align-items: center;
}

.lesson-video-thumb {
  position: relative;
  display: inline-block;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  transition: box-shadow .15s, transform .15s;
  max-width: 260px;
}

.lesson-video-thumb:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  transform: translateY(-2px);
}

.lesson-video-thumb-img {
  display: block;
  width: 260px;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.lesson-video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 2.5rem;
  transition: background .15s;
}

.lesson-video-thumb:hover .lesson-video-play-overlay {
  background: rgba(99,102,241,.55);
}

.lesson-video-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: .35rem .65rem;
}

.lesson-video-thumb-placeholder {
  width: 260px;
  height: 146px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  border-radius: 10px;
}

.lesson-slides-btn {
  font-size: .9rem;
}

/* Preview sections */
.lesson-previews {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

.lesson-preview-box {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.lesson-preview-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
  font-size: .9rem;
  color: #334155;
}

.lesson-preview-icon {
  font-size: 1.1rem;
}

.lesson-preview-badge {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: .1rem .55rem;
}

.lesson-preview-body {
  padding: 1.25rem 1.5rem;
  position: relative;
  max-height: 420px;
  overflow: hidden;
  font-size: .95rem;
  line-height: 1.7;
  color: #334155;
}

.lesson-preview-fade::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent 0%, #fff 85%);
  pointer-events: none;
}

.lesson-preview-body p { margin: 0 0 .85rem; }
.lesson-preview-body h1,
.lesson-preview-body h2,
.lesson-preview-body h3,
.lesson-preview-body h4 {
  margin: .5rem 0 .5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

/* Sections preview internals */
.lesson-section-preview + .lesson-section-preview {
  border-top: 1px dashed #e2e8f0;
  padding-top: .85rem;
  margin-top: .85rem;
}

.lesson-section-title {
  font-size: .9rem;
  font-weight: 700;
  color: #475569;
  margin: 0 0 .5rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.lesson-section-vocab {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .2rem .75rem;
}

.lesson-section-vocab dt {
  font-weight: 700;
  color: #1e293b;
  font-size: .88rem;
}

.lesson-section-vocab dd {
  color: #475569;
  font-size: .88rem;
  margin: 0;
}

.lesson-section-list {
  margin: 0;
  padding-left: 1.5rem;
  font-size: .9rem;
  color: #475569;
}

.lesson-section-list li { margin-bottom: .25rem; }

.lesson-section-more {
  color: #94a3b8;
  font-style: italic;
  list-style: none;
}

.lesson-section-terms {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.lesson-section-term-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: .15rem .55rem;
  font-size: .83rem;
  color: #475569;
  font-weight: 600;
}

.lesson-section-table-preview {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.lesson-preview-answer-text {
  font-family: monospace;
  font-size: .85rem;
  white-space: pre-wrap;
  color: #475569;
}

/* Bottom CTA banner */
.lesson-cta-banner {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  border-radius: 14px;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.lesson-cta-text {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
}

.lesson-cta-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}

.lesson-cta-banner .catalog-btn-primary {
  background: #fff;
  color: #6366f1;
}

.lesson-cta-banner .catalog-btn-primary:hover {
  background: #f1f5f9;
}

.lesson-cta-banner .catalog-btn-ghost {
  border-color: rgba(255,255,255,.55);
  color: #fff;
}

.lesson-cta-banner .catalog-btn-ghost:hover {
  background: rgba(255,255,255,.12);
}

@media (max-width: 680px) {
  .lesson-hero {
    flex-direction: column;
    gap: 1.25rem;
  }
  .lesson-hero-left {
    width: 120px;
  }
  .lesson-hero-title {
    font-size: 1.35rem;
  }
  .lesson-cta-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem 1.25rem;
  }
}

/* ── Cart badge in nav ───────────────────────────────────────────────── */

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: .65rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #ef4444;
  border-radius: 999px;
  margin-left: .25rem;
  vertical-align: middle;
}
