:root {
  --primary: #7c4dff;
  --primary-dark: #6236e8;
  --primary-light: #a78bfa;
  --accent: #f4c542;
  --accent-dark: #eab308;
  --bg: #ffffff;
  --bg-soft: #f8f7fc;
  --bg-section: #f3f0ff;
  --text-dark: #17152b;
  --text-medium: #5e5b75;
  --text-light: #8d89a6;
  --border: #e8e5f5;
  --shadow-sm: 0 4px 12px rgba(124, 77, 255, 0.08);
  --shadow-md: 0 8px 24px rgba(124, 77, 255, 0.12);
  --shadow-lg: 0 15px 40px rgba(124, 77, 255, 0.15);
  --gradient-primary: linear-gradient(135deg, #7c4dff 0%, #8b5cf6 50%, #a855f7 100%);
  --gradient-hero: linear-gradient(135deg, #6d28d9 0%, #7c3aed 50%, #9333ea 100%);
}

.cart-page {
  min-height: 70vh;
  background:
    linear-gradient(180deg, var(--bg-section) 0, rgba(243, 240, 255, 0) 330px),
    var(--bg);
  color: var(--text-dark);
  padding: 44px 0 72px;
}

.cart-wrapper {
  max-width: 1200px;
  width: min(100% - 32px, 1200px);
  margin: 0 auto;
  padding: 0;
}

.cart-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.cart-eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.cart-hero h1 {
  color: var(--text-dark);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 8px;
}

.cart-hero p {
  color: var(--text-medium);
  font-size: 1rem;
  margin: 0;
}

.cart-hero-count {
  min-width: 112px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.cart-hero-count strong {
  display: block;
  color: var(--primary-dark);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.cart-hero-count span {
  color: var(--text-medium);
  font-size: 0.8rem;
  font-weight: 700;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.cart-items {
  display: grid;
  gap: 16px;
}

.cart-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.cart-card:hover {
  border-color: rgba(124, 77, 255, 0.35);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.cart-card-main {
  min-width: 0;
}

.cart-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.type-pill,
.duration-chip,
.variant-pill,
.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.type-pill {
  background: var(--gradient-primary);
  color: #ffffff;
}

.duration-chip {
  background: #fff8dc;
  border: 1px solid rgba(234, 179, 8, 0.32);
  color: #8a6500;
}

.cart-title {
  color: var(--text-dark);
  font-size: 1.24rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}

.instructor-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  min-width: 0;
}

.instructor-photo-wrap {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 18px rgba(124, 77, 255, 0.16);
}

.instructor-photo {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  border: 3px solid #ffffff;
  object-fit: cover;
  background: var(--bg-section);
}

.instructor-initial {
  align-items: center;
  color: var(--primary-dark);
  display: flex;
  font-size: 1.45rem;
  font-weight: 900;
  justify-content: center;
  text-transform: uppercase;
}

.instructor-copy {
  min-width: 0;
}

.instructor-label {
  color: var(--primary);
  display: block;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.instructor-copy h3 {
  color: var(--text-dark);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.instructor-copy p {
  color: var(--text-medium);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

.organization {
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 6px;
}

.cart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-pill {
  background: var(--bg-section);
  border: 1px solid var(--border);
  color: var(--primary-dark);
}

.credit-badge {
  background: #fff8dc;
  border: 1px solid rgba(234, 179, 8, 0.32);
  color: #8a6500;
}

.cart-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.price-wrapper {
  text-align: right;
}

.price-wrapper span {
  color: var(--text-light);
  display: block;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.price-wrapper strong {
  color: var(--text-dark);
  display: block;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.1;
}

.remove-btn {
  align-items: center;
  background: #fff1f2;
  border: 1px solid #ffe4e6;
  border-radius: 8px;
  color: #be123c;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 38px;
  padding: 9px 12px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.remove-btn:hover {
  background: #ffe4e6;
  border-color: #fecdd3;
  color: #9f1239;
}

.cart-assurance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
}

.assurance-item {
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-medium);
  display: flex;
  gap: 9px;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 800;
}

.assurance-item i {
  color: var(--primary);
  font-size: 1rem;
}

.summary-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  position: sticky;
  top: 20px;
}

.summary-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.summary-header span {
  color: var(--primary);
  display: block;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.summary-header h2 {
  color: var(--text-dark);
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1.15;
  margin: 0;
}

.summary-count {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--primary-dark) !important;
  font-size: 0.76rem !important;
  letter-spacing: 0 !important;
  padding: 7px 10px;
  text-transform: none !important;
  white-space: nowrap;
}

.summary-details {
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0;
  max-height: 230px;
  overflow-y: auto;
  padding: 8px 0;
}

.summary-details::-webkit-scrollbar {
  width: 6px;
}

.summary-details::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 8px;
}

.summary-item {
  align-items: start;
  color: var(--text-medium);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 9px 0;
}

.summary-item span {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.summary-item strong {
  color: var(--text-dark);
  flex: 0 0 auto;
  font-size: 0.92rem;
  font-weight: 900;
}

.summary-total {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0;
}

.summary-total span {
  color: var(--text-dark);
  display: block;
  font-size: 0.92rem;
  font-weight: 900;
}

.summary-total small {
  color: var(--text-light);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 3px;
}

.summary-total strong {
  color: var(--primary-dark);
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.btn-checkout,
.continue-btn,
.btn-browse {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 900;
  gap: 9px;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-checkout {
  background: var(--gradient-primary);
  box-shadow: 0 10px 22px rgba(124, 77, 255, 0.22);
  color: #ffffff;
  width: 100%;
}

.btn-checkout:hover {
  box-shadow: 0 14px 28px rgba(124, 77, 255, 0.3);
  color: #ffffff;
  transform: translateY(-2px);
}

.continue-btn {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-medium);
  margin-top: 10px;
  width: 100%;
}

.continue-btn:hover {
  background: var(--bg-section);
  color: var(--primary-dark);
}

.trust-badges {
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  margin-top: 18px;
  padding-top: 18px;
}

.payment-icon {
  display: block;
  max-width: 180px;
  width: 100%;
  height: auto;
  opacity: 0.72;
}

.help-card {
  align-items: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding: 18px;
}

.help-card i {
  color: var(--primary);
  font-size: 1.35rem;
}

.help-card h2 {
  color: var(--text-dark);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 4px;
}

.help-card p {
  color: var(--text-medium);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}

.help-card a {
  color: var(--primary-dark);
  font-weight: 900;
  text-decoration: none;
}

.help-card a:hover {
  text-decoration: underline;
}

.empty-cart {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  margin: 32px auto 0;
  max-width: 520px;
  padding: 44px 28px;
  text-align: center;
}

.empty-cart-icon {
  align-items: center;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--primary);
  display: flex;
  height: 86px;
  justify-content: center;
  margin: 0 auto 18px;
  width: 86px;
}

.empty-cart-icon i {
  font-size: 2.25rem;
}

.empty-cart h2 {
  color: var(--text-dark);
  font-size: 1.55rem;
  font-weight: 900;
  margin: 0 0 8px;
}

.empty-cart p {
  color: var(--text-medium);
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 22px;
}

.btn-browse {
  background: var(--gradient-primary);
  color: #ffffff;
}

.btn-browse:hover {
  box-shadow: var(--shadow-md);
  color: #ffffff;
  transform: translateY(-2px);
}

.custom-alert {
  align-items: center;
  background: rgba(23, 21, 43, 0.56);
  bottom: 0;
  display: none;
  justify-content: center;
  left: 0;
  padding: 20px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 9999;
}

.custom-alert.show {
  display: flex;
}

.alert-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(23, 21, 43, 0.22);
  max-width: 420px;
  padding: 28px;
  text-align: center;
  width: 100%;
}

.alert-icon {
  align-items: center;
  border-radius: 50%;
  display: flex;
  height: 64px;
  justify-content: center;
  margin: 0 auto 16px;
  width: 64px;
}

.alert-icon.danger {
  background: #fff1f2;
  color: #be123c;
}

.alert-icon i {
  font-size: 1.8rem;
}

.alert-text h4 {
  color: var(--text-dark);
  font-size: 1.25rem;
  font-weight: 900;
  margin: 0 0 8px;
}

.alert-text p {
  color: var(--text-medium);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 20px;
}

.alert-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.alert-btn {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
}

.alert-btn.cancel {
  background: var(--bg-soft);
  color: var(--text-medium);
}

.alert-btn.confirm {
  background: #be123c;
  color: #ffffff;
}

@media (max-width: 1024px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .summary-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .cart-page {
    padding: 28px 0 48px;
  }

  .cart-wrapper {
    width: min(100% - 24px, 1200px);
  }

  .cart-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .cart-hero h1 {
    font-size: 2rem;
  }

  .cart-hero-count {
    width: 100%;
  }

  .cart-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .cart-card-side {
    align-items: stretch;
    border-top: 1px solid var(--border);
    padding-top: 14px;
  }

  .price-wrapper {
    text-align: left;
  }

  .remove-btn {
    width: 100%;
  }

  .cart-assurance {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .cart-hero h1 {
    font-size: 1.72rem;
  }

  .cart-title {
    font-size: 1.08rem;
  }

  .instructor-card {
    align-items: flex-start;
  }

  .instructor-photo-wrap {
    flex-basis: 58px;
    height: 58px;
    width: 58px;
  }

  .summary-card,
  .empty-cart,
  .help-card {
    padding: 16px;
  }

  .summary-total {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .alert-actions {
    flex-direction: column;
  }

  .alert-btn {
    width: 100%;
  }
}
