﻿:root {
  --font-sans: "Inter", "Segoe UI", Arial, sans-serif;
  --ink: #16202a;
  --muted: #657282;
  --line: #dfe6ec;
  --paper: #ffffff;
  --soft: #f4f7f7;
  --mint: #0f9f8f;
  --mint-dark: #087467;
  --sun: #f3b338;
  --coral: #e65e4f;
  --navy: #22324a;
  --shadow: 0 18px 50px rgba(22, 32, 42, 0.12);
}

.child-topic-category-select {
  display: grid;
  gap: 7px;
  max-width: 360px;
  margin-bottom: 14px;
  color: #506176;
  font-weight: 700;
}

.child-topic-category-select select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dce5f2;
  border-radius: 9px;
  padding: 0 12px;
}

#childTopicPickerBody[hidden] {
  display: none;
}

#childTopicPickerBody > input {
  width: 100%;
  margin-bottom: 12px;
}

#saveChildTopicsBtn {
  margin-top: 14px;
}

.child-topic-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.child-topic-list {
  display: grid;
  align-content: start;
  gap: 8px;
  margin-top: 8px;
  max-height: 340px;
  overflow-y: auto;
  overflow-x: hidden;
  /* Danh sach co scrollbar doc - neu khong danh rieng cho no 1 khoang, scrollbar
     (dac biet la scrollbar dang overlay trong webview) se de len canh phai cua row,
     che mat nut "Them"/"Go". scrollbar-gutter danh cho trinh duyet ho tro, padding-right
     la phuong an du phong cho trinh duyet/webview cu hon. */
  scrollbar-gutter: stable;
  padding-right: 6px;
}

.child-topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  background: #fff;
}

.child-topic-row > span {
  display: grid;
  min-width: 0;
}

.child-topic-row small {
  color: #64748b;
}

.child-topic-row.inactive {
  opacity: 0.65;
  background: #f1f5f9;
}

.child-topic-row > button,
.child-topic-row .admin-row-actions {
  flex-shrink: 0;
}

.child-topic-row .admin-row-actions {
  flex-wrap: nowrap;
}

.child-topic-row .admin-row-actions button {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .child-topic-picker {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(223, 230, 236, 0.8);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand,
.header-actions,
.main-nav,
.hero-actions,
.course-tools {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: white;
  border-radius: 8px;
  background: var(--mint);
}

.brand-logo-image {
  display: block;
  width: clamp(150px, 15vw, 225px);
  max-height: 54px;
  object-fit: contain;
}

.main-nav {
  justify-content: center;
  gap: clamp(12px, 3vw, 34px);
  color: var(--muted);
  font-weight: 650;
}

.main-nav a:hover {
  color: var(--ink);
}

.header-actions {
  gap: 10px;
}

@media (min-width: 921px) {
  .mobile-search-toggle,
  .mobile-catalog-toggle {
    display: none !important;
  }
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  cursor: pointer;
}

.cart-button,
.primary-button,
.secondary-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.cart-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 16px;
  color: white;
  background: var(--navy);
}

.cart-button strong {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  background: var(--sun);
}

.hero {
  position: relative;
  min-height: min(720px, calc(100vh - 72px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(20px, 5vw, 72px);
  align-items: center;
  padding: clamp(34px, 7vw, 96px) clamp(18px, 6vw, 92px);
  overflow: hidden;
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(13, 22, 30, 0.86), rgba(13, 22, 30, 0.55), rgba(13, 22, 30, 0.12)),
    linear-gradient(0deg, rgba(13, 22, 30, 0.2), rgba(13, 22, 30, 0));
}

.hero-content {
  position: relative;
  width: min(720px, calc(100% - 36px));
  color: white;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--sun);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.hero-content p:not(.eyebrow) {
  width: min(620px, 100%);
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.08rem;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-category-panel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(13, 22, 30, 0.28);
  backdrop-filter: blur(16px);
}

.hero-panel-heading {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.hero-panel-heading strong {
  font-size: 1.05rem;
}

.hero-panel-heading span {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-category-list {
  display: grid;
  max-height: 410px;
  overflow: auto;
  padding: 8px;
}

.hero-category-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 10px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 700;
}

.hero-category-link:hover {
  background: #e5f6f2;
}

.hero-category-link small {
  color: var(--mint-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.primary-button {
  color: white;
  background: var(--mint);
}

.primary-button:hover {
  background: var(--mint-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.hero .secondary-button {
  border-color: rgba(255, 255, 255, 0.44);
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.compact {
  min-height: 38px;
  padding-inline: 14px;
}

.full {
  width: 100%;
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.stats-band div {
  padding: 28px clamp(16px, 4vw, 48px);
  background: var(--paper);
}

.stats-band strong {
  display: block;
  font-size: 1.55rem;
}

.stats-band span {
  color: var(--muted);
}

.section {
  padding: clamp(56px, 8vw, 104px) clamp(18px, 4vw, 56px);
}

.muted {
  background: var(--soft);
}

.section-heading {
  width: min(1180px, 100%);
  margin: 0 auto 28px;
}

.section-description {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
}

.with-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.course-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.search-box span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.search-box input,
.course-tools select {
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
}

.course-tools select {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.category-grid,
.course-layout {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.category-card {
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.category-card:hover {
  border-color: var(--mint);
  box-shadow: var(--shadow);
}

.category-card strong {
  display: block;
  margin-bottom: 8px;
}

.category-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.course-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.course-sidebar {
  position: sticky;
  top: 94px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.sidebar-heading {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar-heading span,
.result-bar {
  color: var(--muted);
  font-size: 0.92rem;
}

.category-menu {
  display: grid;
  padding: 8px;
}

.category-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.category-link:hover,
.category-link.active {
  color: var(--ink);
  background: #e5f6f2;
}

.category-link small {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.filter-toggle-input {
  display: none;
}

.filter-toggle-button {
  display: none;
}

.filter-sidebar-inner {
  display: block;
}

.filter-sidebar {
  border: none;
  background: none;
  overflow: visible;
}

.filter-dropdown-list {
  display: grid;
  gap: 10px;
}

.filter-dropdown {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.filter-dropdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.92rem;
  list-style: none;
}

.filter-dropdown summary::-webkit-details-marker {
  display: none;
}

.filter-dropdown summary::marker {
  content: "";
}

.filter-dropdown-chevron {
  color: var(--muted);
  transition: transform 0.15s ease;
  flex: none;
}

.filter-dropdown[open] > summary .filter-dropdown-chevron,
.taxonomy-fieldset[open] > summary .filter-dropdown-chevron {
  transform: rotate(180deg);
}

.filter-dropdown[open] summary {
  border-bottom: 1px solid var(--line);
}

.filter-options {
  display: grid;
  gap: 6px;
  padding: 12px 16px 14px;
}

.filter-category-list {
  display: grid;
  gap: 7px;
  padding: 10px;
  background: #f8fafc;
}

.filter-category-dropdown {
  border: 1px solid #e1e8f0;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.filter-category-dropdown > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.filter-category-dropdown > summary::-webkit-details-marker {
  display: none;
}

.filter-category-dropdown > summary::marker {
  content: "";
}

.filter-category-dropdown[open] > summary {
  border-bottom: 1px solid #e8edf3;
  background: #f4f8ff;
  color: var(--blue);
}

.filter-category-dropdown[open] > summary .filter-dropdown-chevron {
  transform: rotate(180deg);
}

.filter-category-options {
  display: grid;
  gap: 3px;
  max-height: 280px;
  padding: 8px 10px 10px;
  overflow-y: auto;
}

.filter-category-all {
  margin-bottom: 3px;
  padding-bottom: 7px;
  border-bottom: 1px solid #edf1f5;
  color: var(--blue);
  font-weight: 750;
}

.filter-child-topic {
  padding-left: 9px;
  color: #475569;
  font-size: 0.84rem;
}

.filter-no-children {
  padding: 5px 2px 7px;
  color: var(--muted);
  line-height: 1.45;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.filter-checkbox input {
  width: 16px;
  height: 16px;
  flex: none;
  cursor: pointer;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(var(--container-width, 1180px), 100%);
  margin: 0 auto 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}

.filter-chip:hover {
  border-color: var(--mint);
  color: var(--mint);
}

.filter-chip.clear-all {
  color: #dc2626;
  border-color: #fecaca;
}

.filter-chip.clear-all:hover {
  border-color: #dc2626;
}

.course-results {
  min-width: 0;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.result-bar a {
  color: var(--mint-dark);
  font-weight: 700;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0 auto;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}

.pagination .page-link:hover {
  border-color: var(--mint-dark);
  color: var(--mint-dark);
}

.pagination .page-link.active {
  background: var(--mint-dark);
  border-color: var(--mint-dark);
  color: white;
}

.pagination .page-link.disabled {
  color: var(--muted);
  opacity: 0.5;
  pointer-events: none;
}

.pagination .page-ellipsis {
  padding: 0 4px;
  color: var(--muted);
}

.course-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.course-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
}

.course-thumb::before {
  content: "khoahocpro.com";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  background: white;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--blue, #316bf3);
}

.course-thumb img,
.course-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.course-thumb span {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  border-radius: 6px;
  padding: 4px 8px;
  color: white;
  background: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
}

.discount-tag {
  top: 10px;
  right: 10px;
  left: auto !important;
  background: var(--coral) !important;
}

.course-card {
  position: relative;
}

.wishlist-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.wishlist-toggle.active {
  color: var(--coral);
}

.wishlist-toggle-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  color: var(--ink);
  background: white;
  font-weight: 800;
  cursor: pointer;
}

.wishlist-toggle-line .heart {
  color: var(--coral);
}

.wishlist-toggle-line.active {
  border-color: var(--coral);
}

.course-body {
  display: flex;
  min-height: 270px;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--mint-dark);
  background: #e5f6f2;
  font-size: 0.78rem;
  font-weight: 700;
}

.course-body p {
  color: var(--muted);
}

.course-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.price {
  display: grid;
}

.price del {
  color: var(--muted);
  font-size: 0.84rem;
}

.price strong {
  color: var(--coral);
  font-size: 1.18rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1fr);
  gap: clamp(28px, 6vw, 76px);
  align-items: center;
  width: min(1180px, calc(100% - 36px));
  margin-inline: auto;
  padding-inline: 0;
}

.section-copy p:not(.eyebrow) {
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline div {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timeline strong {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--navy);
}

.learning-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.my-course-list {
  display: grid;
  gap: 12px;
}

.my-course-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.my-course-item button {
  margin-top: 12px;
}

.status {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.lesson-player {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.video-frame {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #0d161e;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.secure-video-shell {
  position: relative;
}

#secureVideoMount {
  width: 100%;
  height: 100%;
}

.secure-video-poster {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: white;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(37, 99, 235, 0.42)),
    #0d161e;
}

.secure-video-poster h2 {
  max-width: 680px;
  margin: 12px auto 8px;
  color: white;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1.1;
}

.secure-video-poster p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.78);
}

.secure-video-watermark {
  position: absolute;
  z-index: 3;
  max-width: min(72%, 420px);
  border-radius: 999px;
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(15, 23, 42, 0.42);
  font-size: 0.78rem;
  font-weight: 800;
  pointer-events: none;
}

.secure-video-watermark.wm-a {
  right: 14px;
  bottom: 12px;
}

.secure-video-watermark.wm-b {
  left: 14px;
  bottom: 12px;
}

.secure-video-watermark.wm-c {
  right: 14px;
  top: 12px;
}

.secure-video-watermark.wm-d {
  left: 14px;
  top: 12px;
}

/* Vi tri duoc do dac truc tiep tren player that (khong doan mo hinh): ten video + avatar kenh
   luon nam TREN-TRAI; am luong/CC/settings/fullscreen goc luon nam TREN-PHAI CUNG HANG; play/pause
   khi bam giua video van hoat dong binh thuong (khong can giu rieng nut play/pause); thanh tua nam
   giua; "Watch on YouTube" + icon rap-chieu-phim nam DUOI-PHAI; nut sao chep link nam DUOI-TRAI.
   Vi vay CHI chan 2 goc tren-trai + duoi-trai + duoi-phai (noi co link/logo dua ra ngoai), con
   cum am luong/CC/settings o tren-phai duoc CO Y de trong - khong duoc chan de dung yeu cau
   "khong chan am luong". Rieng nut fullscreen goc duoc "de" nut rieng cua web (.video-fullscreen-btn)
   nam de len tren, khong can 1 lop chan rong. */
.video-click-shield {
  position: absolute;
  z-index: 4;
  background: rgba(15, 23, 42, 0.01);
  pointer-events: auto;
}

/* Chan ten video + avatar/ten kenh + toan bo khoang trong giua hang tren (tu trai keo sang, dung
   lai TRUOC cum icon tren-phai 160px) - truoc day chi che rong 46%/380px nen phan giua hang van
   ho, bam duoc. Do dac tren player that: cum icon tren-phai nam trong khoang 127-160px tinh tu
   mep phai (CC/settings/fullscreen), rieng am luong nam xa nhat trong cum do (~127-160px) - GIU
   NGUYEN mot khe ho 33px dung ngay vi tri am luong de khong vi pham yeu cau "khong chan am luong". */
.video-click-shield.top-left {
  top: 0;
  left: 0;
  right: 160px;
  height: 64px;
}

/* Chan CC + settings + vung nut fullscreen goc (o duoi da co nut fullscreen rieng cua web de len
   tren nen an toan) - phan con lai cua hang tren, TRU 33px khe ho danh cho am luong (xem ghi chu
   o .top-left). */
.video-click-shield.top-right {
  top: 0;
  right: 0;
  width: 127px;
  height: 64px;
}

/* Chan dai doc sat mep phai, tu duoi vung tren-phai toi vung duoi-phai - phong khi co icon la
   xuat hien khi hover (vd "Xem sau"/"Chia se"). Khong dung o giua vi day la vung video/nut play
   trung tam, khong duoc che. */
.video-click-shield.right {
  top: 64px;
  right: 0;
  bottom: 130px;
  width: 44px;
}

/* Chan nut "sao chep link" (bieu tuong hinh xich) o goc duoi-trai - day chinh la nut nguoi dung
   phan anh la "con nut sao chep link". Dat THAP va HEP de khong cham vao thanh tua phia tren. */
.video-click-shield.bottom-left {
  left: 0;
  bottom: 0;
  width: 112px;
  height: 66px;
}

/* Chan cum "Watch on YouTube" (logo/link nhay ra youtube.com) + icon rap chieu phim canh no,
   o goc duoi-phai. Duoc phep lan mot phan nho vao rangn phai cua thanh tua (chap nhan danh doi -
   hoc vien van tua duoc ~80% dau thanh, chi mat vai % cuoi cung). */
.video-click-shield.corner {
  right: 0;
  bottom: 0;
  width: min(42%, 260px);
  height: 130px;
}

/* Nut phong to rieng cua web, dat de len tren lop chan, phong to nguyen .secure-video-shell
   (giu duoc watermark va lop bao ve khi o che do toan man hinh). Vi tri duoc do lai tu anh
   chup toan bo khung video luc TAM DUNG: nut fullscreen that cua YouTube nam o HANG DUOI CUNG
   (cung hang voi thanh tien trinh/dong ho + logo YouTube + goi y "Video khac"), SAT MEP PHAI -
   khong phai giua-phai nhu truoc. Dat theo % de luon dung ty le du .video-frame co aspect-ratio
   16:9 co dinh, khong lech theo kich thuoc man hinh. */
.video-fullscreen-btn {
  position: absolute;
  z-index: 5;
  top: auto;
  bottom: 16%;
  right: 1.8%;
  transform: none;
  width: 51px;
  height: 51px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 1.61rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.video-fullscreen-btn:hover {
  background: rgba(15, 23, 42, 0.75);
}

.secure-video-shell:fullscreen .video-fullscreen-btn,
.secure-video-shell:-webkit-full-screen .video-fullscreen-btn {
  top: auto;
  bottom: 60px;
  right: 26px;
  transform: none;
}

@media (max-width: 640px) {
  .video-click-shield.top-left {
    right: 110px;
    height: 48px;
  }

  .video-click-shield.top-right {
    width: 90px;
    height: 48px;
  }

  .video-click-shield.right {
    top: 48px;
    bottom: 96px;
    width: 32px;
  }

  .video-click-shield.bottom-left {
    width: 86px;
    height: 52px;
  }

  .video-click-shield.corner {
    width: 60%;
    height: 96px;
  }

  /* Man hinh nho: doi nut phong to rieng cua web xuong DUOI-PHAI (de len tren vung .corner da
     chan san) thay vi tren-phai - vi o kich thuoc nay nut fullscreen "that" cua YouTube trong
     man hinh cho (trang thai tam dung) thuong hien lon va noi bat ngay duoi-phai, canh dong tua,
     khong phai tren-phai nhu luc dang phat. Dat nut cua web de dung vi tri do se che duoc no. */
  .video-fullscreen-btn {
    width: 30px;
    height: 30px;
    top: auto;
    right: 10px;
    bottom: 10px;
    transform: none;
    font-size: 0.95rem;
  }

  .secure-video-shell:fullscreen .video-fullscreen-btn,
  .secure-video-shell:-webkit-full-screen .video-fullscreen-btn {
    top: auto;
    right: 16px;
    bottom: 16px;
    transform: none;
  }
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(300px, 520px);
  gap: clamp(24px, 6vw, 70px);
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding-inline: 0;
}

.contact-section p {
  color: var(--muted);
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 750;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: white;
}

.contact-form textarea {
  min-height: 118px;
  resize: vertical;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  justify-content: flex-end;
  background: rgba(13, 22, 30, 0.45);
}

.drawer.open {
  display: flex;
}

.drawer-panel {
  display: flex;
  width: min(430px, 100%);
  height: 100%;
  flex-direction: column;
  background: white;
  box-shadow: var(--shadow);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  font-size: 1.5rem;
}

.cart-items {
  display: grid;
  gap: 12px;
  flex: 1;
  overflow: auto;
  padding: 18px;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
}

.cart-item img {
  width: 72px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
}

.cart-item strong {
  display: block;
}

.cart-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-summary {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.cart-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal {
  width: min(540px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(13, 22, 30, 0.55);
}

.modal-body {
  position: relative;
  padding: 24px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.bank-box {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.bank-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: white;
}

.bank-box span {
  color: var(--muted);
}

.bank-value {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copy-chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--blue);
  background: white;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.copy-chip:hover {
  border-color: var(--blue);
}

.course-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 6px;
  min-width: 0;
}

.course-quick-buy,
.course-add-cart {
  display: inline-flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  overflow-wrap: break-word;
  text-align: center;
  white-space: normal;
  line-height: 1.2;
}

/* Specificity fix: .course-actions .primary-button (2 classes, defined further below for the
   site-settings button-font-size customization) would otherwise override the font-size above.
   Qualify with .course-card so this wins regardless of source order. */
.course-card .course-actions .course-quick-buy,
.course-card .course-actions .course-add-cart {
  font-size: 0.78rem;
}

[data-add].course-add-in-cart,
[data-add].course-add-owned {
  cursor: default;
  opacity: 1;
}

[data-add].course-add-in-cart {
  border-color: var(--mint);
  background: var(--mint);
  color: white;
}

[data-add].course-add-owned {
  border-color: var(--orange, #f97316);
  background: var(--orange, #f97316);
  color: white;
}

.payment-qr-card {
  grid-column: 1 / -1;
}

.status.status-success {
  color: #0a7d3f;
}

.payment-success-box {
  margin: 20px 0;
  padding: 24px;
  border-radius: 12px;
  background: #eafff3;
  border: 1px solid #b7f0cf;
  text-align: center;
}

.payment-success-box h2 {
  margin: 0 0 8px;
  color: #0a7d3f;
}

.payment-success-box p {
  margin: 0 0 16px;
  color: var(--muted);
}

.qr-payment-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 20px;
  align-items: start;
  margin: 20px 0;
}

.payment-qr-image {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .stats-band,
  .category-grid,
  .course-layout,
  .course-grid,
  .learning-layout,
  .contact-section,
  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-content {
    width: 100%;
  }

  .hero-category-panel {
    max-width: 560px;
  }

  .course-sidebar {
    position: static;
  }

  .category-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .with-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .course-tools {
    justify-content: flex-start;
  }

  .qr-payment-layout {
    grid-template-columns: 1fr;
  }

  .filter-toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 46px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    font-weight: 800;
    cursor: pointer;
  }

  .filter-toggle-button::before {
    content: "☰";
  }

  .filter-sidebar-inner {
    display: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    overflow: hidden;
  }

  .filter-toggle-input:checked ~ .filter-sidebar-inner {
    display: block;
  }

  .filter-toggle-input:checked + .filter-toggle-button::before {
    content: "✕";
  }
}

.site-footer {
  border-top: 1px solid #e8edf5;
  padding: 34px clamp(18px, 5vw, 80px) 42px;
  color: #48566a;
  background: white;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(170px, 0.75fr) minmax(190px, 0.82fr) minmax(220px, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  width: min(1200px, 100%);
  margin: 0 auto;
  align-items: start;
}

.footer-brand,
.footer-column,
.footer-links {
  display: grid;
  gap: 14px;
}

.footer-logo {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  width: fit-content;
  color: var(--blue);
}

.footer-logo-mark {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 3px solid #10b981;
  border-radius: 18px;
  color: var(--blue);
  font-size: 2rem;
  font-weight: 800;
  box-shadow: inset 0 -8px 0 rgba(16, 185, 129, 0.08);
}

.footer-logo-image {
  display: block;
  width: min(270px, 100%);
  max-height: 100px;
  object-fit: contain;
  object-position: left center;
}

.footer-logo strong {
  display: block;
  color: var(--blue);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-logo small {
  display: block;
  margin-top: 2px;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 800;
}

.footer-brand p,
.footer-payment p {
  max-width: 360px;
  margin: 0;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.75;
}

.footer-column h2 {
  margin: 0 0 8px;
  color: #050505;
  font-size: 1.12rem;
  line-height: 1.2;
  font-weight: 800;
}

.footer-links {
  gap: 10px;
}

.site-footer a {
  color: #586579;
  font-size: 0.95rem;
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--blue);
}

.footer-socials {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer-socials a {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  color: #64748b;
  background: #e5e7eb;
  font-weight: 800;
}

.footer-socials a:hover {
  color: white;
  background: var(--blue);
}

.payment-badges {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  gap: 7px;
  width: min(220px, 100%);
  margin-top: 6px;
}

.payment-badges span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid #d6deeb;
  border-radius: 5px;
  color: #3f4b5f;
  background: #f8fafc;
  font-size: 0.76rem;
  font-weight: 800;
  box-shadow: inset 0 -2px 0 rgba(15, 23, 42, 0.04);
}

.checkout-form,
.sepay-panel {
  display: grid;
  gap: 14px;
}

.checkout-form label,
.sepay-panel label {
  display: grid;
  gap: 6px;
  color: #506176;
  font-weight: 700;
}

.checkout-form input,
.sepay-panel input {
  min-height: 42px;
  border: 1px solid #dce5f2;
  border-radius: 8px;
  padding: 0 12px;
}

.copy-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.copy-line button {
  border: 1px solid #dce5f2;
  border-radius: 8px;
  padding: 0 12px;
  color: #2563eb;
  background: white;
  font-weight: 800;
  cursor: pointer;
}

.checkout-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #edf1f6;
  padding: 12px 0;
  color: #506176;
  font-weight: 800;
}

.my-course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.my-course-card {
  overflow: hidden;
  border: 1px solid #e4ebf5;
  border-radius: 16px;
  background: white;
  box-shadow: 0 14px 36px rgba(19, 37, 73, 0.06);
}

.my-course-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.my-course-card div {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.progress-bar {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e8eef8;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.learn-page {
  background: #f7f9fc;
  padding: 28px 0 56px;
}

.learn-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 20px;
  width: min(1300px, calc(100% - 40px));
  margin: 0 auto;
}

.learn-sidebar,
.learn-main {
  border: 1px solid #e4ebf5;
  border-radius: 16px;
  background: white;
  box-shadow: 0 14px 36px rgba(19, 37, 73, 0.06);
}

.learn-sidebar {
  align-self: start;
  padding: 16px;
}

.learn-sidebar h2 {
  margin-bottom: 14px;
  font-size: 1.1rem;
}

#learnLessons {
  display: grid;
  gap: 8px;
}

#learnLessons button {
  display: grid;
  gap: 4px;
  border: 1px solid #e4ebf5;
  border-radius: 10px;
  padding: 10px;
  text-align: left;
  color: #334155;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 700;
}

#learnLessons button.active,
#learnLessons button:hover {
  border-color: #cfe0ff;
  color: var(--blue);
  background: var(--blue-soft);
}

#learnLessons small {
  color: #94a3b8;
  font-size: 0.72rem;
}

.learn-main {
  overflow: hidden;
}

.learn-content {
  padding: 20px;
}

.learn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 920px) {
  .footer-inner,
  .learn-shell {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .my-course-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-inline: 14px;
  }

  .brand span:last-child,
  .cart-button span {
    display: none;
  }

  .hero {
    padding-block: 48px;
  }

  .hero-content {
    margin-inline: 0;
  }

  .hero-category-list {
    max-height: none;
  }

  .stats-band {
    grid-template-columns: repeat(2, 1fr);
  }

  .course-tools,
  .search-box,
  .course-tools select {
    width: 100%;
  }

  .category-menu {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 64px 1fr;
  }

  .cart-item button {
    grid-column: 2;
    width: max-content;
  }
}

/* Shop-style homepage inspired by Vietnamese course marketplaces. */
:root {
  --blue: #316bf3;
  --blue-dark: #1f56d8;
  --blue-soft: #eef4ff;
  --orange: #f97316;
  --shop-bg: #ffffff;
  --shop-soft: #f6f8fc;
}

body {
  background: var(--shop-bg);
}

.promo-bar {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 18px;
  color: white;
  background: var(--blue);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.promo-bar a {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--blue);
  background: white;
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: block;
  padding: 0;
  border-bottom: 1px solid #e8edf5;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.header-main {
  display: grid;
  grid-template-columns: minmax(160px, 220px) auto minmax(280px, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 66px;
  padding: 10px clamp(18px, 3vw, 28px);
}

.header-catalog-button {
  position: static;
}

.brand {
  gap: 9px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ff8a00, var(--blue));
  font-size: 0.76rem;
}

.brand strong {
  display: block;
  color: var(--blue);
  font-size: 0.98rem;
  line-height: 1.15;
  white-space: nowrap;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: #7890ad;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.1;
}

.catalog-button {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  padding: 0 18px;
  color: white;
  background: var(--blue);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(49, 107, 243, 0.2);
}

.catalog-button-chevron {
  display: block;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.main-nav > .catalog-button {
  position: absolute;
  left: clamp(18px, 3vw, 28px);
  top: 4px;
}

.global-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-radius: 11px;
  padding: 0 14px;
  color: #91a1b8;
  background: #eef2f7;
}

.global-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 650;
}

.global-search button {
  border: 0;
  color: #91a1b8;
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
}

.global-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 5px 0;
  border-radius: 8px;
  padding: 0 18px;
  color: white !important;
  background: var(--blue) !important;
  font-size: 0.92rem !important;
  font-weight: 700;
}

.header-actions {
  gap: 18px;
  white-space: nowrap;
}

.plain-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  color: #151b27;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.plain-action.icon-only {
  position: relative;
  gap: 0;
}

.header-action-icon {
  width: 26px;
  height: 26px;
}

.plain-action.icon-only strong {
  position: absolute;
  top: -7px;
  right: -11px;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  background: var(--orange, #f97316);
  color: white;
  font-size: 0.68rem;
}

.plain-action strong {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--orange);
  font-size: 0.76rem;
}

.main-nav {
  position: relative;
  justify-content: space-between;
  gap: clamp(14px, 2.4vw, 30px);
  min-height: 48px;
  border-top: 1px solid #edf1f6;
  padding: 0 clamp(18px, 3vw, 28px);
  color: #222936;
  background: white;
  font-weight: 700;
}

.main-nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
}

.main-nav-links span[aria-hidden] {
  color: var(--blue);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  border-radius: 999px;
  padding: 1px 8px;
  background: var(--orange, #f97316);
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
}

.nav-badge.hot {
  background: #facc15;
  color: #78350f;
}

.main-nav-contact {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.88rem;
  white-space: nowrap;
}

.main-nav-contact strong {
  color: var(--ink);
}

.main-nav a {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  border-bottom: 2px solid transparent;
  padding-inline: 6px;
}

.main-nav a.active,
.main-nav a:hover {
  color: var(--blue);
}

.main-nav a.active {
  border-bottom-color: var(--blue);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, 0.08));
}

.market-showcase {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
  /* Reserve 170px of margin on each side (130px banner + 20px gap + 20px to
     spare) down to the point where mobile stacking takes over (see the
     920px override below), instead of just 20px - so the side banners
     always have room and never get clipped, at the cost of a narrower
     main content column on laptop-size screens. */
  width: min(1240px, calc(100% - 340px));
  margin: 42px auto 0;
  align-items: start;
}

.market-side-banner {
  display: block;
  overflow: hidden;
  position: absolute;
  top: 0;
  z-index: 0;
  width: clamp(130px, calc((100vw - 1240px) / 2 - 20px), 240px);
  border: 1px solid #d9e4f2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.market-side-banner-left {
  right: calc(100% + 20px);
}

.market-side-banner-right {
  left: calc(100% + 20px);
}

.market-category-panel,
.market-latest-panel {
  position: relative;
  z-index: 1;
}

.market-side-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.market-category-panel h2,
.market-latest-panel h2 {
  margin: 0 0 24px;
  color: #375b9b;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  line-height: 1.15;
  text-align: center;
}

.market-category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  max-height: 444px;
  overflow-y: auto;
  padding-right: 5px;
  scrollbar-color: #4e90db #e7eef8;
  scrollbar-width: thin;
}

.market-category-list a {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 8px 10px;
  color: #fff;
  background: #2389df;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.market-category-list a:hover {
  background: var(--blue);
}

/* Icon/arrow are only shown in the mobile card-list layout below; on desktop
   the buttons keep their original plain-text look. */
.market-category-icon,
.market-category-arrow {
  display: none;
}

/* Extra categories past the first 8 are collapsed by default on mobile (see
   .market-category-toggle below) - display:contents keeps them acting as
   direct grid/flex items of .market-category-list once shown (matches the
   unwrapped links), instead of being nested one level deeper inside the
   wrapper div. Desktop always shows everything (overridden further down). */
.market-category-extra:not([hidden]) {
  display: contents;
}

.market-category-toggle {
  display: none;
}

.market-course-carousel {
  overflow: hidden;
}

.market-course-track {
  display: flex;
  transition: transform 0.35s ease;
}

.market-course-slide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 100%;
  min-width: 0;
  gap: 20px;
}

.market-course-card {
  overflow: hidden;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.06);
}

.market-course-thumb {
  position: relative;
  display: block;
  overflow: hidden;
}

.market-course-thumb::before {
  content: "khoahocpro.com";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: white;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--blue, #316bf3);
}

.market-course-thumb img {
  display: block;
  width: 100%;
  height: 138px;
  object-fit: cover;
}

.market-course-thumb span {
  position: absolute;
  top: 12px;
  right: 10px;
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: #f4b21b;
  font-size: 0.72rem;
  font-weight: 800;
}

.market-course-body {
  min-height: 138px;
  padding: 14px 16px 16px;
}

.market-course-body h3 {
  display: -webkit-box;
  min-height: 3.4em;
  margin: 0 0 14px;
  overflow: hidden;
  color: #666;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 1rem;
  line-height: 1.35;
}

.market-course-body h3 a:hover {
  color: var(--blue);
}

.market-course-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
}

.market-course-price del {
  color: #999;
  font-size: 0.88rem;
}

.market-course-price strong {
  color: #e31b23;
  font-size: 1.05rem;
  font-weight: 800;
}

.market-course-controls {
  display: grid;
  justify-items: center;
  gap: 5px;
  margin: 18px 0 14px;
}

.market-course-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.market-course-dots button {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #c9c9c9;
  cursor: pointer;
}

.market-course-dots button[aria-current="true"] {
  width: 20px;
  background: var(--blue);
}

.market-more-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: 0 14px;
  color: #172031;
  background: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.market-more-link:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.market-info-box {
  border-right: 4px solid #1e96e8;
  border-left: 4px solid #1e96e8;
  border-radius: 8px;
  padding: 18px 24px;
  color: #111827;
  background: #eaf6ff;
  text-align: center;
}

.market-info-box h3 {
  margin: 0 0 8px;
  color: #0b69c7;
  font-size: 1.3rem;
  line-height: 1.25;
}

.market-info-box p {
  max-width: 760px;
  margin: 0 auto;
  color: #111827;
  font-size: 0.98rem;
  line-height: 1.55;
}

.home-trust-section {
  width: min(1240px, calc(100% - 40px));
  margin: 40px auto 0;
}

.home-trust-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.home-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.home-trust-icon {
  flex: 0 0 auto;
  font-size: 22px;
}

.home-trust-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.home-membership-section {
  width: min(1240px, calc(100% - 40px));
  margin: 40px auto 0;
}

.home-membership-section > .primary-button {
  display: flex;
  width: fit-content;
  margin: 0 auto;
}

.home-membership-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.home-membership-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  text-align: center;
}

.home-membership-price {
  display: block;
  margin-top: 10px;
  color: var(--blue);
  font-size: 1.4rem;
}

.home-collection-wrap {
  display: grid;
  gap: 54px;
  width: 100%;
  margin: 52px auto 0;
  padding: 42px max(40px, calc((100vw - 1240px) / 2)) 52px;
  background: #f6f6f6;
}

.home-collection-section {
  display: grid;
  gap: 24px;
}

.home-collection-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.home-collection-heading h2 {
  margin: 0 0 6px;
  color: #365a98;
  font-size: clamp(1.55rem, 2.35vw, 2rem);
  font-weight: 850;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-collection-heading p {
  max-width: 760px;
  margin: 0;
  color: #6b7280;
  font-size: 0.96rem;
  line-height: 1.55;
}

.home-collection-more {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #0d73e8;
  border-radius: 999px;
  padding: 0;
  color: #0d73e8;
  background: #fff;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
}

.home-collection-more:hover {
  color: #fff;
  background: #0d73e8;
}

.home-collection-more-label {
  display: none;
}

.home-collection-carousel {
  position: relative;
}

.home-collection-viewport {
  overflow: hidden;
}

.home-collection-track {
  display: flex;
  transition: transform 0.35s ease;
}

.home-collection-track .home-collection-grid {
  flex: 0 0 100%;
  min-width: 0;
}

.home-collection-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border: 1px solid #e5ebf4;
  border-radius: 999px;
  color: #53647c;
  background: white;
  box-shadow: 0 8px 26px rgba(19, 37, 73, 0.12);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

.home-collection-arrow.left {
  left: -20px;
}

.home-collection-arrow.right {
  right: -20px;
}

.home-collection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.home-collection-card {
  display: flex;
  min-height: 302px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.home-collection-card:hover {
  transform: translateY(-3px);
  border-color: #cfd8e6;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.11);
}

.home-collection-thumb {
  position: relative;
  display: block;
  overflow: hidden;
}

.home-collection-thumb::before {
  content: "khoahocpro.com";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: white;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--blue, #316bf3);
}

.home-collection-thumb img {
  display: block;
  width: 100%;
  height: 164px;
  object-fit: cover;
}

.home-collection-thumb span {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ff7a18, #ff3d75);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(255, 92, 72, 0.28);
}

.home-collection-body {
  display: grid;
  flex: 1;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  padding: 14px 16px 14px;
}

.home-collection-body h3 {
  display: -webkit-box;
  min-height: 4.5em;
  margin: 0;
  overflow: hidden;
  color: #5f6368;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.5;
}

.home-collection-body h3 a:hover {
  color: var(--blue);
}

.home-collection-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
}

.home-collection-price del {
  color: #9ca3af;
  font-size: 0.85rem;
}

.home-collection-price strong {
  color: #e11d24;
  font-size: 1rem;
  font-weight: 800;
}

.home-collection-meta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  color: #374151;
  font-size: 0.78rem;
}

.home-collection-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: -2px;
}

.home-collection-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #cfcfcf;
  cursor: pointer;
}

.home-collection-dots .active {
  width: 18px;
  background: #1683e6;
}

:root {
  --collection-accent-1: #ff2a2a;
  --collection-accent-2: #f5b514;
  --collection-accent-3: #22c55e;
  --collection-accent-4: #0ea5e9;
}

.hero {
  width: min(1240px, calc(100% - 40px));
  min-height: 0;
  margin: 86px auto 0;
  padding: 0;
  display: block;
  overflow: visible;
  background: white;
}

.market-showcase + .hero {
  margin-top: 36px;
}

.hero-slider {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.hero-track {
  display: flex;
  width: 100%;
  transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
  touch-action: pan-y;
}

.hero-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.promo-card {
  position: relative;
  display: grid;
  min-height: 378px;
  overflow: hidden;
  border: 1px solid #e7edf6;
  border-radius: 18px;
  background: white;
  box-shadow: 0 16px 40px rgba(19, 37, 73, 0.06);
}

.promo-card .badge {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #bd1d1d;
  background: white;
  font-size: 0.78rem;
  font-weight: 800;
}

.welcome-card {
  grid-template-columns: 1fr 0.88fr;
  align-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 88% 62%, #16c79a 0 40px, transparent 42px),
    radial-gradient(circle at 68% 25%, #1b8cff 0 26px, transparent 28px),
    #fff;
}

.welcome-card h1 {
  margin: 18px 0 14px;
  color: #182234;
  font-size: clamp(1.7rem, 2.2vw, 2.2rem);
  line-height: 1.1;
}

.welcome-card h1 strong,
.feature-card h2 strong,
.mini-card h2 strong {
  color: var(--blue);
}

.welcome-card p,
.feature-card p,
.mini-card p {
  color: #5c6d83;
  font-weight: 650;
}

.welcome-card img {
  align-self: end;
  width: 100%;
  height: 330px;
  border-radius: 18px;
  object-fit: cover;
  object-position: center top;
}

.coupon-box {
  display: grid;
  grid-template-columns: 1fr auto;
  width: min(260px, 100%);
  margin: 18px 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f6f8fc;
  box-shadow: 0 10px 26px rgba(49, 107, 243, 0.12);
}

.coupon-box strong {
  color: var(--blue);
}

.coupon-box span {
  grid-column: 1;
  color: #3d4b60;
  font-size: 0.78rem;
  font-weight: 800;
}

.coupon-box button {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--blue);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.coupon-save-btn.saved {
  background: var(--mint-dark, #087467);
}

.coupon-apply-box {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.coupon-apply-box input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  font: inherit;
  text-transform: uppercase;
}

#checkoutTotalBox del {
  color: #94a3b8;
  margin-right: 6px;
}

.top-right-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(320px, calc(100vw - 32px));
  pointer-events: none;
}

.top-right-toast-container .toast {
  padding: 12px 16px;
  border-radius: 10px;
  color: white;
  background: var(--mint-dark, #087467);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.top-right-toast-container .toast.show {
  opacity: 1;
  transform: translateY(0);
}

.feature-card {
  grid-template-columns: 0.88fr 1fr;
  align-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(238, 244, 255, 0.96), rgba(255, 244, 231, 0.88)),
    #fff;
}

.feature-card h2,
.mini-card h2 {
  margin: 16px 0 12px;
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
  line-height: 1.12;
}

.feature-card img {
  width: 100%;
  height: 300px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 24px 48px rgba(49, 46, 129, 0.18);
}

.mini-card {
  align-content: center;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 237, 213, 0.92)),
    url("https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=520&q=80");
  background-size: cover;
  background-blend-mode: screen;
}

.orange-button {
  display: inline-flex;
  width: max-content;
  min-height: 42px;
  align-items: center;
  border-radius: 8px;
  padding: 0 16px;
  color: white;
  background: var(--orange);
  font-weight: 800;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border: 1px solid #e5ebf4;
  border-radius: 999px;
  color: #53647c;
  background: white;
  box-shadow: 0 8px 26px rgba(19, 37, 73, 0.12);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

.slider-arrow.left {
  left: 12px;
}

.slider-arrow.right {
  right: 12px;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 14px;
}

.slider-dots button {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.slider-dots button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #7aa0f7;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, background 0.3s ease;
}

.slider-dots button[aria-current="true"]::after {
  width: 22px;
  background: var(--blue);
}

.home-categories,
.section {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0;
}

.section-card-heading {
  display: flex;
  width: min(760px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto 24px;
  border: 1px solid #dce8ff;
  border-radius: 16px;
  padding: 18px;
  background: #fbfdff;
  box-shadow: 0 18px 46px rgba(49, 107, 243, 0.08);
}

.section-card-heading h2 {
  color: #172031;
  font-size: 1.45rem;
}

.section-card-heading a {
  display: grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--blue);
  border-radius: 999px;
  color: var(--blue);
  font-weight: 800;
}

.category-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.category-card {
  min-height: 96px;
  border-color: #e4ebf5;
  box-shadow: 0 10px 24px rgba(19, 37, 73, 0.04);
}

.category-card:hover {
  border-color: var(--blue);
}

.muted {
  width: 100%;
  max-width: none;
  background: white;
}

.section.muted > .section-heading,
.section.muted > .course-layout,
.section.muted > .course-grid {
  width: min(1200px, calc(100% - 40px));
}

.home-more-courses {
  display: flex;
  justify-content: center;
  width: min(1200px, calc(100% - 40px));
  margin: 24px auto 0;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading .eyebrow {
  color: var(--blue);
  font-size: 1.25rem;
  letter-spacing: 0;
  text-transform: none;
}

.section-heading h2 {
  font-size: 1.35rem;
}

.course-sidebar,
.result-bar,
.course-card {
  border-color: #e4ebf5;
  box-shadow: 0 10px 24px rgba(19, 37, 73, 0.04);
}

.category-link:hover,
.category-link.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.course-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.course-card {
  border-radius: 14px;
}

.course-card img {
  border-radius: 14px 14px 0 0;
}

.course-body {
  min-height: 248px;
  padding: 14px;
}

.course-body h3 {
  display: -webkit-box;
  min-height: 3.8em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 0.98rem;
  line-height: 1.28;
}

.course-body p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.9rem;
}

.pill {
  color: var(--blue);
  background: var(--blue-soft);
}

.price strong {
  color: var(--orange);
}

.primary-button {
  border-radius: 8px;
  background: var(--blue);
  box-shadow: 0 10px 20px rgba(49, 107, 243, 0.18);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.floating-socials {
  position: fixed;
  left: 12px;
  bottom: 28px;
  z-index: 25;
  display: grid;
  gap: 14px;
}

.floating-socials a {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 5px solid #d7edff;
  border-radius: 999px;
  color: white;
  background: #2f92ee;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(47, 146, 238, 0.2);
}

@media (max-width: 1420px) {
  .market-showcase {
    grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  }

}

@media (max-width: 1180px) {
  .header-main {
    grid-template-columns: minmax(165px, 220px) minmax(0, 1fr) auto;
  }

  .market-showcase {
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  }

  .market-course-slide {
    gap: 14px;
  }

  .course-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .promo-bar {
    flex-direction: column;
    gap: 6px;
  }

  .header-main {
    grid-template-columns: 1fr auto;
    min-height: 0;
    padding-block: 8px;
  }

  .header-catalog-button {
    display: none !important;
  }

  .brand-logo-image {
    width: clamp(140px, 40vw, 190px);
    max-height: 50px;
  }

  .global-search {
    grid-column: 1 / -1;
    order: 3;
    min-height: 36px;
    border-radius: 9px;
    padding: 0 12px;
  }

  .global-search input {
    font-size: 13px;
  }

  .main-nav {
    display: none;
  }

  .mega-menu-links {
    display: flex;
  }

  .header-actions {
    gap: 18px;
  }

  .mobile-search-toggle,
  .mobile-catalog-toggle {
    display: inline-grid;
    width: 38px;
    height: 38px;
  }

  .plain-action span {
    display: none;
  }

  .plain-action {
    font-size: 18px;
  }

  .plain-action strong {
    min-width: 26px;
    height: 26px;
    font-size: 14.6px;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-inline: 16px;
  }

  .market-showcase {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 760px);
    margin-top: 28px;
  }

  /* Lead with the actual course carousel/deals, category browsing follows
     below (collapsed) - matches how course-selling sites usually prioritize
     content over navigation on a phone screen. */
  .market-latest-panel {
    order: 1;
  }

  .market-category-panel {
    order: 2;
  }

  .home-trust-grid {
    grid-template-columns: 1fr;
  }

  .home-membership-grid {
    grid-template-columns: 1fr;
  }

  .market-category-toggle {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    margin-top: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    color: var(--blue);
    font-weight: 700;
  }

  .market-category-toggle span {
    transition: transform 0.15s ease;
  }

  .market-category-toggle.expanded span {
    transform: rotate(180deg);
  }

  .market-side-banner {
    display: none;
  }

  .market-category-panel h2,
  .market-latest-panel h2 {
    margin-bottom: 14px;
    text-align: left;
  }

  .market-category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .market-category-list a {
    justify-content: flex-start;
    gap: 12px;
    min-height: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    color: var(--ink);
    text-align: left;
  }

  .market-category-list a:hover {
    background: white;
  }

  .market-category-icon {
    display: grid;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 999px;
    background: var(--blue-soft, #eef4ff);
    font-size: 18px;
  }

  .market-category-text {
    flex: 1;
    font-weight: 700;
  }

  .market-category-arrow {
    display: block;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 20px;
  }

  .market-course-slide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-collection-wrap {
    width: 100%;
    margin-top: 34px;
    padding-inline: 28px;
  }

  .home-collection-heading {
    flex-direction: column;
    gap: 8px;
  }

  .home-collection-more {
    align-self: flex-start;
    width: auto;
    height: auto;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 700;
  }

  .home-collection-more-label {
    display: inline;
  }

  .home-collection-more:hover {
    color: #0d73e8;
    background: none;
  }

  .home-collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    margin-top: 28px;
  }

  /* Cards stack to full height on mobile - keep arrows below the slide
     (control bar with dots) instead of overlaying mid-content, so they
     never sit on top of the card's title/button. */
  .hero-slider {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    row-gap: 10px;
  }

  .hero-track {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .slider-arrow {
    position: static;
    grid-row: 2;
    transform: none;
  }

  .slider-arrow.left {
    grid-column: 1;
    justify-self: start;
  }

  .slider-arrow.right {
    grid-column: 3;
    justify-self: end;
  }

  .slider-dots {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    margin-top: 0;
  }

  .welcome-card,
  .feature-card {
    grid-template-columns: 1fr;
  }

  .welcome-card {
    /* Decorative dots are positioned by % and land on top of the text
       once the card stacks tall on mobile - drop them here, kept on desktop. */
    background: #fff;
  }

  .welcome-card img,
  .feature-card img {
    height: 220px;
  }

  .category-grid,
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .promo-bar {
    font-size: 0.78rem;
  }

  .brand small {
    display: none;
  }

  .header-actions {
    gap: 18px;
  }

  .plain-action {
    font-size: 1.14rem;
  }

  .hero,
  .home-categories,
  .section.muted > .section-heading,
  .section.muted > .course-layout,
  .section.muted > .course-grid {
    width: min(100% - 24px, 1200px);
  }

  .promo-card {
    min-height: 0;
    padding: 20px;
  }

  .slider-arrow {
    width: 34px;
    height: 34px;
    font-size: 1.5rem;
  }

  .section-card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-grid,
  .course-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .market-course-slide {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Peek-scroll: show ~1.2 cards at once with native touch swipe, instead of
     1 full-width card per view - the arrow/dot controls still jump between
     the underlying groups of 4, this just makes each group itself swipeable
     so the next card is visibly peeking instead of hidden until you tap. */
  .home-collection-grid {
    display: flex;
    grid-template-columns: none;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .home-collection-card {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }

  /* Grid/flex items default to min-width:auto, which lets their content's
     intrinsic width (the horizontally-scrolling card row above) balloon the
     whole ancestor chain instead of respecting the 390px viewport - explicit
     min-width:0 down the chain is the standard fix. */
  .home-collection-section,
  .home-collection-carousel,
  .home-collection-viewport,
  .home-collection-track {
    min-width: 0;
  }

  /* Touch-swipe handles navigation now that cards peek/scroll natively -
     the overlaid arrow buttons just visually collided with card content. */
  .home-collection-arrow {
    display: none;
  }

  .home-collection-arrow.left {
    left: 4px;
  }

  .home-collection-arrow.right {
    right: 4px;
  }

  .home-collection-body h3 {
    min-height: auto;
  }

  .home-collection-wrap {
    padding-inline: 14px;
  }

  .market-category-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .market-course-thumb img {
    height: 176px;
  }

  .market-info-box {
    padding: 16px;
  }

  .floating-socials {
    display: none;
  }
}

/* Phase: mega menu and course detail page. */
.catalog-button {
  border: 0;
  cursor: pointer;
}

.mega-menu {
  position: absolute;
  left: clamp(18px, 3vw, 28px);
  right: clamp(18px, 3vw, 28px);
  top: 114px;
  z-index: 35;
  display: none;
}

.mega-menu.open {
  display: block;
}

.mega-menu-inner {
  overflow: hidden;
  border: 1px solid #e2e9f4;
  border-radius: 16px;
  background: white;
  box-shadow: 0 28px 80px rgba(19, 37, 73, 0.18);
}

.mega-menu-links {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #edf1f6;
}

@media (min-width: 921px) {
  .mega-menu-links {
    display: none;
  }
}

.mega-menu-links a {
  padding: 12px 20px;
  border-bottom: 1px solid #f3f5f9;
  color: var(--ink);
  font-weight: 600;
}

.mega-menu-links a:last-child {
  border-bottom: 0;
}

.mega-menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #edf1f6;
}

.mega-menu-heading strong {
  color: #172031;
  font-size: 1.08rem;
}

.mega-menu-heading span {
  color: #6b7b91;
  font-size: 0.92rem;
}

@media (min-width: 921px) {
  .mega-menu-mobile-header,
  .mega-menu-quick-section {
    display: none;
  }
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  max-height: min(68vh, 560px);
  overflow: auto;
  background: #edf1f6;
}

.mega-category {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 188px;
  padding: 16px;
  background: white;
}

.mega-category-title {
  display: grid;
  gap: 4px;
  border-radius: 10px;
  padding: 10px;
  color: #16202a;
  font-weight: 800;
}

.mega-category-title:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.mega-category-title small {
  color: #7c8ca3;
  font-size: 0.78rem;
}

.mega-subcategory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mega-subcategory-list a {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid #e4ebf5;
  border-radius: 999px;
  padding: 0 10px;
  color: #5d6d84;
  background: #f8fafc;
  font-size: 0.82rem;
  font-weight: 800;
}

.mega-subcategory-list a:hover {
  border-color: #cfe0ff;
  color: var(--blue);
  background: var(--blue-soft);
}

.course-thumb {
  display: block;
}

.course-detail-section {
  width: 100%;
  background: #f7f9fc;
  padding: 36px 0 72px;
}

.course-detail-shell {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--blue);
  font-weight: 800;
}

.course-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
  align-items: start;
}

.course-preview,
.course-purchase-card,
.detail-card {
  border: 1px solid #e4ebf5;
  border-radius: 16px;
  background: white;
  box-shadow: 0 14px 36px rgba(19, 37, 73, 0.06);
}

.course-preview {
  position: relative;
  overflow: hidden;
}

.course-preview::before {
  content: "khoahocpro.com";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: white;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--blue, #316bf3);
}

.course-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-preview-label {
  padding: 14px 16px;
  color: #64748b;
  font-size: 0.92rem;
  font-weight: 800;
  background: #f8fafc;
}

.course-purchase-card {
  position: sticky;
  top: 128px;
  padding: 20px;
}

.course-purchase-card h1 {
  margin: 14px 0 10px;
  color: #172031;
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
  line-height: 1.12;
}

.course-purchase-card p {
  color: #5d6d84;
}

.detail-price {
  display: grid;
  gap: 2px;
  margin: 18px 0;
}

.detail-price del {
  color: #8795aa;
  font-size: 1rem;
  font-weight: 750;
}

.detail-price strong {
  color: var(--orange);
  font-size: 2rem;
  line-height: 1;
}

.detail-actions {
  display: grid;
  gap: 10px;
}

.course-facts {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding-left: 18px;
  color: #56657a;
  font-weight: 750;
}

.course-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.detail-card {
  padding: 20px;
}

.detail-card h2 {
  margin-bottom: 14px;
  color: #172031;
  font-size: 1.35rem;
}

.detail-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: #506176;
  font-weight: 700;
}

.curriculum-card,
.faq-card {
  margin-top: 20px;
}

.detail-card details {
  border-top: 1px solid #edf1f6;
  padding: 12px 0;
}

.detail-card details:first-of-type {
  border-top: 0;
}

.detail-card summary {
  cursor: pointer;
  color: #172031;
  font-weight: 800;
}

.detail-card ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 22px;
  color: #5d6d84;
  font-weight: 700;
}

.faq-card p {
  margin: 10px 0 0;
  color: #5d6d84;
}

.related-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.related-heading a {
  color: var(--blue);
  font-weight: 800;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.related-card {
  display: grid;
  gap: 8px;
  overflow: hidden;
  border: 1px solid #e4ebf5;
  border-radius: 12px;
  background: white;
}

.related-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.related-card strong {
  display: -webkit-box;
  min-height: 2.6em;
  overflow: hidden;
  padding: 0 10px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #172031;
  font-size: 0.9rem;
}

.related-card span {
  padding: 0 10px 10px;
  color: var(--orange);
  font-weight: 800;
}

/* Below ~1550px the absolutely-positioned catalog button collides with the
   centered nav links (not enough room to center them clear of the button) -
   switch the whole row to normal flow + horizontal scroll instead, same fix
   already used for mobile, just extended to cover the common laptop widths
   (1280/1366/1440/1536) where this was silently broken. */
@media (max-width: 1550px) {
  .main-nav > .catalog-button {
    position: static;
    flex: 0 0 auto;
    width: auto;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .main-nav a {
    white-space: nowrap;
  }
}

@media (max-width: 1180px) {
  .catalog-button {
    display: flex;
  }

  .mega-menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .main-nav > .catalog-button {
    position: static;
    flex: 0 0 auto;
    width: auto;
  }

  .global-search {
    order: 4;
  }

  .site-header {
    backdrop-filter: none;
  }

  .mega-menu {
    position: fixed;
    inset: 0;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
  }

  .mega-menu-inner {
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.mega-menu-open {
    overflow: hidden;
  }

  .mega-menu-mobile-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #edf1f6;
  }

  .mega-menu-mobile-icon {
    display: grid;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 10px;
    background: #16202a;
    font-size: 18px;
  }

  .mega-menu-mobile-header > div {
    flex: 1;
    display: grid;
    gap: 2px;
  }

  .mega-menu-mobile-header strong {
    color: #16202a;
  }

  .mega-menu-mobile-header span {
    color: var(--muted);
    font-size: 0.85rem;
  }

  .mega-menu-close {
    display: grid;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #f2f4f8;
    color: var(--ink);
    font-size: 16px;
  }

  .mega-menu-quick-section {
    display: block;
    padding: 16px;
    border-bottom: 1px solid #edf1f6;
  }

  .mega-menu-quick-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .mega-menu-quick-heading a {
    color: var(--blue);
    font-size: 0.85rem;
    font-weight: 700;
  }

  .mega-menu-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mega-menu-quick-grid a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--ink);
    font-weight: 700;
    font-size: 0.9rem;
  }

  .mega-menu-quick-grid span {
    font-size: 18px;
  }

  .mega-menu-links {
    padding-top: 0;
  }

  .mega-menu-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .mega-menu-grid {
    display: flex;
    flex-direction: column;
    max-height: none;
    overflow: visible;
    background: white;
  }

  .mega-category {
    min-height: 0;
    padding: 0;
  }

  .mega-category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 0;
    padding: 14px 16px;
    border-bottom: 1px solid #f3f5f9;
  }

  .mega-category-icon {
    display: grid;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 999px;
    background: var(--blue-soft, #eef4ff);
    font-size: 18px;
  }

  .mega-category-text {
    flex: 1;
    display: grid;
    gap: 2px;
  }

  .mega-category-arrow {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 18px;
  }

  .mega-subcategory-list {
    display: none;
  }

  .course-detail-hero,
  .course-detail-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .course-purchase-card {
    position: static;
  }
}

/* Local app routing: keep the static prototype feeling like real pages. */
.view-category #home,
.view-category .home-categories,
.view-category #roadmap,
.view-category #my-courses,
.view-category #contact,
.view-category #cartPage,
.view-category #ordersPage,
.view-category #policyPage,
.view-course #home,
.view-course .home-categories,
.view-course #courses,
.view-course #roadmap,
.view-course #my-courses,
.view-course #contact,
.view-course #cartPage,
.view-course #ordersPage,
.view-course #policyPage,
.view-cart #home,
.view-cart .home-categories,
.view-cart #courses,
.view-cart #courseDetail,
.view-cart #roadmap,
.view-cart #my-courses,
.view-cart #contact,
.view-cart #ordersPage,
.view-cart #policyPage,
.view-orders #home,
.view-orders .home-categories,
.view-orders #courses,
.view-orders #courseDetail,
.view-orders #roadmap,
.view-orders #my-courses,
.view-orders #contact,
.view-orders #cartPage,
.view-orders #policyPage,
.view-my-courses #home,
.view-my-courses .home-categories,
.view-my-courses #courses,
.view-my-courses #courseDetail,
.view-my-courses #roadmap,
.view-my-courses #contact,
.view-my-courses #cartPage,
.view-my-courses #ordersPage,
.view-my-courses #policyPage,
.view-contact #home,
.view-contact .home-categories,
.view-contact #courses,
.view-contact #courseDetail,
.view-contact #roadmap,
.view-contact #my-courses,
.view-contact #cartPage,
.view-contact #ordersPage,
.view-contact #policyPage,
.view-policy #home,
.view-policy .home-categories,
.view-policy #courses,
.view-policy #courseDetail,
.view-policy #roadmap,
.view-policy #my-courses,
.view-policy #contact,
.view-policy #cartPage,
.view-policy #ordersPage {
  display: none;
}

.view-home #courseDetail,
.view-home #cartPage,
.view-home #ordersPage,
.view-home #policyPage {
  display: none;
}

.standalone-page {
  width: 100%;
  min-height: 62vh;
  padding: 42px 0 80px;
  background: #f7f9fc;
}

.standalone-shell {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.page-heading {
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 0 0 8px;
  color: #172031;
  font-size: clamp(1.3rem, 2.6vw, 1.95rem);
  line-height: 1.05;
}

.page-heading p:not(.eyebrow) {
  color: #64748b;
  font-weight: 700;
}

.commerce-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 20px;
  align-items: start;
}

.commerce-card {
  border: 1px solid #e4ebf5;
  border-radius: 16px;
  padding: 18px;
  background: white;
  box-shadow: 0 14px 36px rgba(19, 37, 73, 0.06);
}

.affiliate-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.affiliate-stats-grid .commerce-card {
  display: grid;
  gap: 8px;
  text-align: center;
}

.affiliate-stats-grid .commerce-card span {
  color: var(--muted);
  font-weight: 700;
}

.affiliate-stats-grid .commerce-card strong {
  font-size: 1.3rem;
  color: var(--ink);
}

.membership-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.membership-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.membership-plan-card.featured {
  border-color: var(--blue);
  box-shadow: 0 14px 36px rgba(49, 107, 243, 0.16);
}

.membership-plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 4px 14px;
  background: var(--blue);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.membership-plan-price {
  font-size: 1.5rem;
  color: var(--blue);
}

.membership-plan-features {
  display: grid;
  gap: 8px;
  margin: 4px 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.membership-plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 0.9rem;
}

.membership-plan-features li span {
  flex: 0 0 auto;
  color: var(--mint-dark, #087467);
  font-weight: 700;
}

.cart-page-item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #edf1f6;
  padding: 14px 0;
}

.cart-page-item:first-child {
  padding-top: 0;
}

.cart-page-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cart-page-item img {
  width: 132px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  object-fit: cover;
}

.cart-page-item h3,
.order-item h3 {
  margin: 8px 0 6px;
  color: #172031;
}

.cart-page-item p,
.order-item p,
.sepay-panel p {
  margin: 0;
  color: #64748b;
}

.cart-page-item > strong,
.order-item > strong {
  color: var(--orange);
  font-size: 1.05rem;
}

.order-summary-card {
  position: sticky;
  top: 128px;
  display: grid;
  gap: 14px;
}

.summary-row,
.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.summary-row {
  color: #64748b;
  font-weight: 800;
}

.summary-total {
  border-top: 1px solid #edf1f6;
  padding-top: 14px;
  color: #172031;
  font-size: 1.12rem;
  font-weight: 800;
}

.summary-total strong {
  color: var(--orange);
  font-size: 1.45rem;
}

.order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #edf1f6;
  padding: 16px 0;
}

.order-item:first-child {
  padding-top: 0;
}

.order-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.order-item small {
  color: #94a3b8;
  font-weight: 700;
}

.order-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
}

.timeline-step {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  background: #eef2f8;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.timeline-step.done {
  color: var(--mint-dark);
  background: #e5f6f2;
}

.timeline-step.current {
  color: white;
  background: var(--blue);
}

.timeline-step.cancelled {
  color: #c0392b;
  background: #fde8e8;
}

.timeline-arrow {
  color: #c3cbd8;
  font-size: 0.78rem;
}

.sepay-panel {
  display: grid;
  gap: 12px;
}

.sepay-panel label {
  display: grid;
  gap: 6px;
  color: #506176;
  font-weight: 700;
}

.sepay-panel input {
  min-height: 42px;
  border: 1px solid #dce5f2;
  border-radius: 8px;
  padding: 0 12px;
}

.webhook-result {
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 12px;
  color: #506176;
  background: #f8fafc;
  font-weight: 800;
}

.webhook-result.success {
  color: #047857;
  background: #ecfdf5;
}

.webhook-result.error {
  color: #b91c1c;
  background: #fef2f2;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.policy-grid p {
  color: #64748b;
  font-weight: 700;
}

.auth-form {
  display: grid;
  max-width: 520px;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #506176;
  font-weight: 700;
}

.auth-form input {
  min-height: 44px;
  border: 1px solid #dce5f2;
  border-radius: 9px;
  padding: 0 12px;
  font: inherit;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  padding-right: 44px;
}

.password-toggle-btn {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  border: none;
  background: none;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.auth-switch {
  margin: 0;
  color: #64748b;
  font-weight: 800;
}

.auth-switch a {
  color: var(--blue);
}

.account-card {
  display: grid;
  max-width: 760px;
  gap: 16px;
}

.account-card h2 {
  margin: 0;
}

.account-actions {
  flex-wrap: wrap;
}

.stacked-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.stacked-form label {
  display: grid;
  gap: 6px;
  color: #506176;
  font-weight: 700;
}

.stacked-form input {
  padding: 10px 12px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  font: inherit;
}

.form-message {
  min-height: 20px;
  font-weight: 700;
  color: #047857;
}

.form-message.error {
  color: #b91c1c;
}

@media (max-width: 920px) {
  .commerce-layout,
  .policy-grid {
    grid-template-columns: 1fr;
  }

  .order-summary-card {
    position: static;
  }

  .cart-page-item {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .cart-page-item img {
    width: 96px;
  }

  .cart-page-item > strong,
  .cart-page-item > button {
    grid-column: 2;
    width: max-content;
  }
}

.admin-body {
  min-height: 100vh;
  margin: 0;
  color: #172031;
  background: #f5f8fc;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #dfe7f3;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.admin-brand,
.admin-nav,
.admin-page-heading,
.admin-card-heading,
.admin-course-cell,
.admin-row-actions {
  display: flex;
  align-items: center;
}

.admin-brand {
  gap: 10px;
  color: #172031;
  text-decoration: none;
}

.admin-brand span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: var(--blue);
  font-weight: 800;
}

.admin-nav {
  flex-wrap: wrap;
  gap: 8px;
}

.admin-nav a,
.admin-card-heading a,
.admin-row-actions button {
  border: 1px solid #dfe7f3;
  border-radius: 8px;
  padding: 9px 12px;
  color: #274268;
  background: white;
  text-decoration: none;
  font-weight: 700;
}

.admin-nav a:hover,
.admin-card-heading a:hover,
.admin-row-actions button:hover {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
}

.admin-shell {
  width: min(1520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 56px;
}

.admin-page-heading {
  align-items: flex-start;
  flex-direction: column;
  margin-bottom: 20px;
}

.admin-page-heading h1 {
  margin: 4px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.admin-page-heading p:last-child {
  max-width: 720px;
  margin: 0;
  color: #64748b;
  font-weight: 750;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.admin-stat-card,
.admin-card {
  border: 1px solid #dfe7f3;
  border-radius: 14px;
  background: white;
  box-shadow: 0 16px 34px rgba(24, 45, 79, 0.06);
}

.admin-stat-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.admin-stat-card span {
  color: #64748b;
  font-weight: 700;
}

.admin-stat-card strong {
  color: var(--blue);
  font-size: 1.75rem;
  line-height: 1;
}

.admin-stat-card.revenue {
  grid-column: span 2;
}

.admin-card {
  padding: 18px;
}

.admin-card-heading {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 16px;
}

.admin-helper-text {
  margin: -4px 0 18px;
  color: #64748b;
  font-size: 0.92rem;
}

.admin-card-heading h2 {
  margin: 0;
}

.admin-card-heading span,
.admin-note-grid p {
  color: #64748b;
  font-weight: 800;
}

.payment-subheading {
  margin-top: 8px;
  border-top: 1px solid #edf1f6;
  padding-top: 16px;
}

.admin-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-form-grid label {
  display: grid;
  gap: 7px;
  color: #506176;
  font-weight: 700;
}

.admin-form-grid .span-2 {
  grid-column: span 2;
}

.admin-form-grid input,
.admin-form-grid select,
.admin-form-grid textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dce5f2;
  border-radius: 9px;
  padding: 0 12px;
  color: #172031;
  background: #fbfdff;
  font: inherit;
}

.admin-toggle {
  display: flex !important;
  align-items: center;
  grid-template-columns: none !important;
  gap: 10px !important;
}

.admin-toggle input {
  width: 18px;
  min-height: 18px;
}

.payment-note-grid {
  grid-template-columns: 1fr;
}

.admin-form-grid textarea {
  min-height: 92px;
  padding-top: 10px;
  resize: vertical;
}

.admin-form-grid .code-textarea {
  min-height: 180px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
  line-height: 1.5;
}

.admin-mini-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid #dce5f2;
  border-radius: 12px;
  background: #f8fafc;
}

.admin-mini-panel select[multiple] {
  min-height: 160px;
}

.admin-course-form {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 14px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #edf1f6;
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: #64748b;
  background: #f8fbff;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.admin-table td small,
.admin-table td del {
  display: block;
  color: #94a3b8;
  font-weight: 750;
}

.admin-course-cell {
  gap: 10px;
  min-width: 260px;
}

.admin-course-cell img {
  width: 72px;
  aspect-ratio: 16 / 10;
  border-radius: 9px;
  object-fit: cover;
}

.admin-row-actions {
  justify-content: flex-end;
  gap: 7px;
}

.admin-row-actions.stacked {
  align-items: stretch;
  flex-direction: column;
}

.admin-row-actions button {
  cursor: pointer;
}

.admin-action-link,
.admin-row-actions .edit-action {
  display: inline-flex;
  justify-content: center;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 7px 10px;
  color: #1d4ed8;
  background: #eff6ff;
  font-weight: 800;
}

.admin-row-actions .edit-action:hover,
.admin-action-link:hover {
  border-color: #2563eb;
  background: #dbeafe;
}

.admin-row-actions .danger:hover,
.admin-row-actions button.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff7f7;
}

.admin-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 10px;
  color: #64748b;
  background: #f1f5f9;
  font-weight: 800;
}

.admin-status.completed,
.admin-status.paid {
  color: #047857;
  background: #ecfdf5;
}

.admin-status.approved {
  color: #1d4ed8;
  background: #eff6ff;
}

.admin-status.on-hold,
.admin-status.pending {
  color: #b45309;
  background: #fffbeb;
}

.admin-status.cancelled,
.admin-status.rejected {
  color: #b91c1c;
  background: #fef2f2;
}

.admin-message {
  min-height: 22px;
  color: #047857;
  font-weight: 700;
}

.admin-message.error {
  color: #b91c1c;
}

.admin-message.info {
  color: #475569;
}

.admin-auth-warning {
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  margin-bottom: 18px;
  padding: 18px;
  color: #1e3a8a;
  background: #eff6ff;
  font-weight: 700;
}

.admin-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-filter-bar input,
.admin-filter-bar select,
.admin-filter-bar button {
  min-height: 38px;
  border: 1px solid #dce5f2;
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  font-weight: 700;
}

.builder-block {
  border: 1px solid #edf1f6;
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
}

.builder-section,
.builder-lesson {
  display: grid;
  gap: 10px;
  border: 1px solid #dfe7f3;
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 12px;
  background: white;
}

.builder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.builder-lesson {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.builder-lesson label:nth-child(2),
.builder-lesson label:nth-child(3) {
  grid-column: span 2;
}

.builder-section button,
.builder-lesson button {
  border: 1px solid #dce5f2;
  border-radius: 8px;
  padding: 8px 12px;
  background: white;
  font-weight: 700;
  cursor: pointer;
}

.admin-taxonomy-groups {
  display: grid;
  gap: 10px;
}

.taxonomy-fieldset {
  border: 1px solid #dfe7f3;
  border-radius: 10px;
  background: white;
  overflow: hidden;
}

.taxonomy-fieldset summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.86rem;
  list-style: none;
}

.taxonomy-fieldset summary::-webkit-details-marker {
  display: none;
}

.taxonomy-fieldset[open] summary {
  border-bottom: 1px solid #dfe7f3;
}

.admin-category-dropdown-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #f8fafc;
}

.admin-category-dropdown {
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.admin-category-dropdown > summary {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.admin-category-dropdown[open] > summary {
  border-bottom: 1px solid #e8edf3;
  color: var(--blue);
  background: #f4f8ff;
}

.admin-category-dropdown[open] > summary .filter-dropdown-chevron {
  transform: rotate(180deg);
}

.admin-category-options {
  display: grid;
  gap: 2px;
  max-height: 300px;
  padding: 8px 10px 10px;
  overflow-y: auto;
}

.admin-category-options .filter-checkbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 31px;
  padding: 6px 2px;
  border-bottom: 1px solid #eef2f7;
}

.admin-category-options .filter-checkbox span {
  flex: 1;
  min-width: 0;
}

.admin-category-options .filter-checkbox input {
  width: 16px;
  height: 16px;
  min-height: 0;
  flex: none;
}

.admin-category-options .admin-category-all {
  color: var(--blue);
  font-weight: 700;
}

.admin-category-options .admin-child-topic {
  padding-left: 12px;
  color: #475569;
}

.admin-legacy-topics {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  color: #92400e;
  background: #fffbeb;
}

.taxonomy-fieldset .taxonomy-checkbox-list {
  padding: 10px 12px;
}

.taxonomy-fieldset > button {
  display: block;
  margin: 0 12px 12px;
}

.taxonomy-checkbox-list {
  display: grid;
  gap: 2px;
}

/* .admin-form-grid label { display: grid } o tren thang cung se de len .filter-checkbox
   (checkbox + ten danh muc) vi day cung la the <label>, khien checkbox bi day xuong dong rieng.
   Ghi de rieng o day (specificity cao hon) de moi dong thang hang, o tich nam sat ben phai.
   Ten danh muc gio luon 1 dong (cat bot bang "..." neu qua dai), co duong ke ngan cach giua
   cac dong cho de nhin, khong bi dinh vao nhau. */
.taxonomy-checkbox-list .filter-checkbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  width: 100%;
  padding: 7px 2px;
  border-bottom: 1px solid #eef2f7;
}

.taxonomy-checkbox-list .filter-checkbox:last-child {
  border-bottom: none;
}

.taxonomy-checkbox-list .filter-checkbox span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taxonomy-checkbox-list .filter-checkbox input {
  /* .admin-form-grid input { width:100%; min-height:42px } cung de len day, khien checkbox
     phinh to choan het cho, day chu ten danh muc ve 0. Reset lai kich thuoc checkbox that. */
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  flex: none;
}

.video-frame {
  position: relative;
}

.lesson-preview-tag {
  display: inline-flex;
  margin-left: 8px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #2563eb;
  background: #eff6ff;
  font-size: 0.75rem;
  font-weight: 800;
}

.curriculum-card li p {
  margin: 6px 0 0;
  color: #64748b;
  font-weight: 700;
}

@media (max-width: 980px) {
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-stats,
  .admin-grid,
  .admin-note-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-stat-card.revenue {
    grid-column: auto;
  }

  .admin-course-form {
    position: static;
  }
}

@media (max-width: 640px) {
  .admin-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-form-grid .span-2 {
    grid-column: auto;
  }
}

/* ===== Site settings overrides (admin-configurable via /admin/site-settings) =====
   Placed last on purpose so these variable-driven rules win over the fixed values
   defined earlier in this file, without having to touch every duplicate rule above. */

body {
  color: var(--text-color, #16202a);
  background: var(--page-bg, #ffffff);
  font-size: var(--base-font-size, 16px);
}

.main-nav {
  font-size: var(--menu-font-size, 15px);
}

.site-header {
  min-height: var(--header-height, 84px);
}

.welcome-card h1 {
  font-size: clamp(1.5rem, 2.4vw, var(--hero-title-size, 36px));
}

.section-heading h2 {
  font-size: clamp(1.3rem, 2vw, var(--section-title-size, 26px));
  font-weight: var(--heading-weight, 800);
}

.course-body h3 {
  font-size: var(--course-title-size, 17px);
}

.section.muted {
  background: var(--section-bg, #f6f8fc);
}

.course-card {
  border-radius: var(--card-radius, 8px);
  box-shadow: var(--card-shadow, none);
}

.standalone-page .page-heading h1 {
  font-size: clamp(1.15rem, 2vw, 1.55rem) !important;
  line-height: 1.18;
}

.mpa-list-page .section-heading h1 {
  font-size: clamp(2.1rem, 5vw, 4.2rem) !important;
  line-height: 1;
}

.section.mpa-list-page {
  width: min(1440px, calc(100% - 48px));
  padding-inline: 0;
}

.mpa-list-page .section-heading,
.mpa-list-page .course-layout {
  width: min(1440px, 100%);
  margin-inline: auto;
}

.mpa-list-page .course-layout {
  grid-template-columns: minmax(240px, 260px) minmax(0, 1fr);
  gap: 24px;
}

.mpa-list-page .course-grid {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 20px;
}

@media (max-width: 1180px) {
  .mpa-list-page .course-layout {
    grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  }

  .mpa-list-page .course-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
}

@media (max-width: 920px) {
  .section.mpa-list-page {
    width: min(100% - 32px, 760px);
  }

  .mpa-list-page .course-layout {
    grid-template-columns: 1fr;
  }

  .mpa-list-page .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .section.mpa-list-page {
    width: min(100% - 24px, 1200px);
  }

  .mpa-list-page .course-grid {
    grid-template-columns: 1fr;
  }
}

.course-thumb {
  border-radius: var(--card-image-radius, 14px) var(--card-image-radius, 14px) 0 0;
}

.course-thumb img {
  height: var(--card-image-height, 190px);
}

.course-body {
  padding: var(--card-padding, 18px);
}

.course-actions .primary-button,
.course-actions .secondary-button {
  font-size: var(--card-button-font-size, 14px);
}

.course-quick-buy,
[data-buy],
#createOrderBtn {
  background: var(--buy-button-color, var(--accent-color, #f97316));
}

body.buttons-vertical .course-actions,
.course-actions.vertical {
  grid-template-columns: 1fr;
}

.category-grid,
.course-layout,
.section-heading {
  width: min(var(--container-width, 1180px), 100%);
}

@media (min-width: 921px) {
  .course-grid {
    grid-template-columns: repeat(var(--courses-per-row, 4), 1fr);
  }

  .hero {
    min-height: var(--hero-height, 460px);
  }

  /* Desktop always shows the full category list (scrollable panel) - the
     collapse/expand toggle is a mobile-only affordance. */
  .market-category-extra[hidden] {
    display: contents;
  }

  .market-category-toggle {
    display: none;
  }
}

/* Course listing page: keep the compact 90%-zoom feel, but let the product
   grid breathe wider and keep the grey shop area full-width. */
.section.muted.mpa-list-page {
  width: 100%;
  max-width: none;
  padding-right: clamp(18px, 4vw, 56px);
  padding-left: clamp(18px, 4vw, 56px);
}

.section.muted.mpa-list-page > .section-heading,
.section.muted.mpa-list-page > .course-layout {
  width: min(1520px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.section.muted.mpa-list-page > .course-layout {
  grid-template-columns: minmax(240px, 260px) minmax(0, 1fr);
  gap: 24px;
}

@media (max-width: 920px) {
  .section.muted.mpa-list-page > .course-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (min-width: 921px) {
  .section.muted.mpa-list-page .course-grid {
    grid-template-columns: repeat(4, minmax(270px, 1fr));
    gap: 22px;
  }
}

@media (max-width: 1180px) and (min-width: 921px) {
  .section.muted.mpa-list-page > .course-layout {
    grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  }

  .section.muted.mpa-list-page .course-grid {
    grid-template-columns: repeat(3, minmax(255px, 1fr));
  }
}

.course-card .discount-tag.price-discount-tag {
  position: static;
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: #fff;
  background: var(--coral) !important;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.sale-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.section.muted.mpa-list-page .course-body {
  min-height: 216px;
  padding: 14px 16px 16px;
}

.section.muted.mpa-list-page .course-body h3 {
  min-height: 3.6em;
  margin-bottom: 10px;
  -webkit-line-clamp: 3;
}

.section.muted.mpa-list-page .course-meta {
  margin-bottom: 10px;
}

/* Admin: /admin/site-settings form + live preview */
.admin-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.admin-settings-group {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.admin-settings-group:first-child {
  padding-top: 0;
}

.admin-settings-group:last-child {
  border-bottom: 0;
}

.admin-settings-group h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.admin-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.admin-settings-actions .primary-button,
.admin-settings-actions .secondary-button {
  width: auto;
}

.switch-field {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 700;
}

.switch-field input {
  width: 18px;
  min-height: 18px;
}

.field-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.admin-settings-preview {
  position: sticky;
  top: 20px;
  align-self: start;
}

.settings-preview-box {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fafbfc;
}

.settings-preview-box .course-card {
  max-width: 280px;
  margin: 0 auto;
  border-radius: var(--preview-radius, 8px);
  box-shadow: var(--preview-shadow, none);
}

.settings-preview-box .course-thumb {
  border-radius: var(--preview-image-radius, 14px) var(--preview-image-radius, 14px) 0 0;
}

.settings-preview-box .course-thumb img {
  height: var(--preview-image-height, 190px);
}

.settings-preview-box .course-body {
  padding: var(--preview-padding, 18px);
}

.settings-preview-box .course-body h3 {
  font-size: var(--preview-title-size, 17px);
}

.settings-preview-box .course-actions .primary-button,
.settings-preview-box .course-actions .secondary-button {
  font-size: var(--preview-button-font, 14px);
}

.settings-preview-box .course-actions.vertical {
  grid-template-columns: 1fr;
}

.settings-preview-box #previewPrimaryBtn {
  background: var(--preview-buy, #f97316);
}

@media (max-width: 980px) {
  .admin-settings-layout {
    grid-template-columns: 1fr;
  }

  .admin-settings-preview {
    position: static;
  }
}

/* ===== Add-to-cart feedback: toast, button success state, cart count bounce ===== */

.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(320px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border-radius: 10px;
  color: white;
  background: #1f2937;
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  word-break: break-word;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--mint-dark, #087467);
}

.toast-info {
  background: var(--blue, #2563eb);
}

.cart-btn-added {
  border-color: var(--mint, #0f9f8f) !important;
  color: white !important;
  background: var(--mint, #0f9f8f) !important;
}

.cart-btn-in-cart {
  border-color: var(--blue, #2563eb) !important;
  color: white !important;
  background: var(--blue, #2563eb) !important;
}

@keyframes cart-count-bump {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.35);
  }

  100% {
    transform: scale(1);
  }
}

#cartCount.bump {
  animation: cart-count-bump 0.4s ease;
}

.fly-to-cart {
  position: fixed;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--buy-button-color, var(--accent-color, #f97316));
  z-index: 10000;
  pointer-events: none;
  transition: left 0.6s cubic-bezier(0.3, 0.6, 0.3, 1), top 0.6s cubic-bezier(0.3, 0.6, 0.3, 1), transform 0.6s ease, opacity 0.6s ease;
}

@media (max-width: 560px) {
  .toast-container {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    width: auto;
  }
}

/* Phase: mobile bottom tab bar (app-style navigation for phones). */
.mobile-tabbar {
  display: none;
}

@media (max-width: 560px) {
  body.mpa-body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 2px 6px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.1;
  }

  .mobile-tab svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-tab.active {
    color: var(--blue);
  }

  .mobile-tab-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 22px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
  }
}

/* Compact desktop rhythm: gan voi cam giac Chrome zoom 90%, nhung khong dung
   CSS zoom/transform scale de tranh tran ngang va cat header. */
@media (min-width: 921px) {
  .promo-bar {
    min-height: 35px;
    padding-block: 6px;
    font-size: 0.86rem;
  }

  .header-main {
    min-height: 58px;
    gap: 12px;
    max-width: 1220px;
    margin-inline: auto;
    padding-block: 8px;
  }

  .brand-logo-image {
    width: clamp(140px, 13.5vw, 205px);
    max-height: 48px;
  }

  .global-search {
    min-height: 42px;
  }

  .main-nav {
    min-height: 44px;
    gap: clamp(18px, 2.8vw, 38px);
    max-width: 1220px;
    margin-inline: auto;
    padding-inline: 0;
  }

  .main-nav > .catalog-button {
    top: 5px;
    min-height: 38px;
    padding-inline: 14px;
  }

  .plain-action {
    font-size: 0.92rem;
  }

  .home-categories,
  .section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .hero {
    margin-top: 44px;
  }

  .promo-card {
    min-height: 285px;
    padding: 28px;
  }

  .welcome-card,
  .feature-card {
    gap: 22px;
  }

  .welcome-card h1 {
    font-size: clamp(1.65rem, 2.15vw, var(--hero-title-size, 32px));
  }

  .welcome-card p,
  .feature-card p {
    font-size: 0.94rem;
  }

  .section-heading {
    margin-bottom: 22px;
  }

  .section-heading .eyebrow {
    font-size: 1.08rem;
  }

  .section-card-heading {
    padding: 16px;
    margin-bottom: 20px;
  }

  .primary-button,
  .secondary-button,
  .cart-button {
    min-height: 38px;
    padding-inline: 16px;
  }

  .course-card .course-actions .course-quick-buy,
  .course-card .course-actions .course-add-cart {
    min-height: 36px;
  }
}


