:root {
  --d2-primary: var(--primary, #4f46e5);
  --d2-primary-dark: var(--primary-hover, #4338ca);
  --d2-primary-soft: var(--gray-100, #eef2ff);
  --d2-accent: var(--accent, #06b6d4);
  --d2-success: var(--success, #10b981);
  --d2-warning: var(--warning, #f59e0b);
  --d2-danger: var(--danger, #ef4444);
  --d2-info: var(--info, #3b82f6);
  --d2-text: var(--text-color, #1f2937);
  --d2-text-muted: var(--gray-500, #6b7280);
  --d2-heading: var(--dark, #111827);
  --d2-bg: var(--section-bg, #f3f4f6);
  --d2-surface: var(--white, #ffffff);
  --d2-border: var(--gray-200, #e5e7eb);
  --d2-border-strong: var(--gray-300, #d1d5db);
  --d2-radius-sm: 8px;
  --d2-radius: 12px;
  --d2-radius-lg: 16px;
  --d2-radius-xl: 24px;
  --d2-shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --d2-shadow: 0 4px 16px rgba(17, 24, 39, 0.08);
  --d2-shadow-lg: 0 12px 32px rgba(17, 24, 39, 0.12);
  --d2-font: var(--font-family-base, "Segoe UI", Tahoma, Arial, sans-serif);
  --d2-header-height: 68px;
  --d2-container-max: 1240px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--d2-font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--d2-text);
  background-color: var(--d2-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--d2-heading);
  line-height: 1.35;
}

p {
  margin: 0;
}

a {
  color: var(--d2-primary);
  text-decoration: none;
}
a:hover {
  color: var(--d2-primary-dark);
}

.list-unstyled {
  padding-left: 0;
  list-style: none;
}

img {
  max-width: 100%;
  display: inline-block;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input,
select {
  font-family: inherit;
}

.d2-container {
  width: 100%;
  max-width: var(--d2-container-max);
  margin-inline: auto;
  padding-inline: 20px;
}

.d2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--d2-radius);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  transition: all 0.2s ease;
  text-decoration: none;
}
.d2-btn--primary {
  background: linear-gradient(135deg, var(--d2-primary), var(--d2-accent));
  color: #fff;
}
.d2-btn--primary:hover {
  color: #fff;
  filter: brightness(1.08);
  box-shadow: var(--d2-shadow);
}
.d2-btn--ghost {
  background: transparent;
  border-color: var(--d2-border-strong);
  color: var(--d2-text);
}
.d2-btn--ghost:hover {
  border-color: var(--d2-primary);
  color: var(--d2-primary);
}

.d2-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.d2-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--d2-text-muted);
}
.d2-field__input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius-sm);
  background: var(--d2-surface);
  color: var(--d2-text);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.d2-field__input:focus {
  outline: none;
  border-color: var(--d2-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.d2-select {
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius-sm);
  background-color: var(--d2-surface);
  color: var(--d2-text);
  font-size: 14px;
  -moz-appearance: none;
       appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.d2-select:focus {
  outline: none;
  border-color: var(--d2-primary);
}
.rtl .d2-select {
  background-position: left 12px center;
}

.d2-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.d2-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.d2-check__box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--d2-border-strong);
  border-radius: 5px;
  background: var(--d2-surface);
  transition: all 0.15s ease;
  position: relative;
}
.d2-check__label {
  font-size: 14px;
  color: var(--d2-text);
}
.d2-check input:checked + .d2-check__box {
  background: var(--d2-primary);
  border-color: var(--d2-primary);
}
.d2-check input:checked + .d2-check__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.d2-check input:focus-visible + .d2-check__box {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}
.d2-check__box--radio {
  border-radius: 50%;
}
input:checked + .d2-check__box--radio::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border: none;
  background: #fff;
  border-radius: 50%;
}
.d2-check__count {
  margin-inline-start: auto;
  font-size: 12px;
  color: var(--d2-text-muted);
}

.d2-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--d2-header-height);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--d2-border);
}
.d2-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.d2-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.d2-header__logo {
  width: 38px;
  height: 38px;
  -o-object-fit: contain;
     object-fit: contain;
  border-radius: 10px;
}
.d2-header__name {
  font-size: 17px;
  font-weight: 800;
  color: var(--d2-heading);
}
.d2-header__nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.d2-header__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--d2-text-muted);
  transition: color 0.2s ease;
}
.d2-header__link:hover, .d2-header__link.is-active {
  color: var(--d2-primary);
}
.d2-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.d2-header__icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--d2-text-muted);
  border: 1px solid var(--d2-border);
  background: var(--d2-surface);
  transition: all 0.2s ease;
}
.d2-header__icon-link:hover {
  color: var(--d2-primary);
  border-color: var(--d2-primary);
}
.d2-header__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.d2-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  -o-object-fit: cover;
     object-fit: cover;
  border: 2px solid var(--d2-primary);
}
.d2-header__username {
  font-size: 14px;
  font-weight: 700;
  color: var(--d2-heading);
}

.d2-footer {
  margin-top: 80px;
  background: var(--d2-heading);
  color: #cbd5e1;
}
.d2-footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-block: 48px;
}
.d2-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 14px;
}
.d2-footer__logo {
  width: 34px;
  height: 34px;
  -o-object-fit: contain;
     object-fit: contain;
  border-radius: 8px;
}
.d2-footer__name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}
.d2-footer__desc {
  font-size: 14px;
  line-height: 1.8;
  max-width: 320px;
  color: #94a3b8;
}
.d2-footer__title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}
.d2-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.d2-footer__links li a {
  color: #94a3b8;
  font-size: 14px;
  transition: color 0.2s ease;
}
.d2-footer__links li a:hover {
  color: #fff;
}
.d2-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: 18px;
}
.d2-footer__bottom span {
  font-size: 13px;
  color: #94a3b8;
}

.toast-container {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-notification {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 320px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: var(--d2-radius);
  color: #fff;
  box-shadow: var(--d2-shadow-lg);
  overflow: hidden;
}
.toast-notification .toast-icon-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}
.toast-notification .toast-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}
.toast-notification .toast-message {
  font-size: 13px;
  opacity: 0.95;
}
.toast-notification .toast-close {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  background: none;
  border: none;
  padding: 4px;
  color: #fff;
  opacity: 0.8;
}
.toast-notification .toast-progress {
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
}

.js-lists-body {
  position: relative;
  transition: opacity 0.2s ease;
}
.js-lists-body.is-loading {
  opacity: 0.45;
  pointer-events: none;
}
.js-lists-body.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  z-index: 2;
}

.d2-filters-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--d2-surface);
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius-xl);
  padding: 16px 24px;
  box-shadow: var(--d2-shadow-sm);
}
.d2-filters-top__checks {
  display: flex;
  align-items: center;
  gap: 28px;
}
.d2-filters-top__sort {
  display: flex;
  align-items: center;
  gap: 12px;
}

.d2-filters-side {
  background: var(--d2-surface);
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius-lg);
  padding: 8px 20px 20px;
  box-shadow: var(--d2-shadow-sm);
}
.d2-filters-side__item {
  padding-block: 18px;
  border-bottom: 1px solid var(--d2-border);
}
.d2-filters-side__item:first-child {
  padding-top: 12px;
}
.d2-filters-side__title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 14px;
}
.d2-filters-side__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.d2-filters-side__price {
  display: flex;
  gap: 12px;
}
.d2-filters-side__apply {
  width: 100%;
  margin-top: 20px;
}

.d2-pagination {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}
.d2-pagination__list {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.d2-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--d2-radius-sm);
  border: 1px solid var(--d2-border);
  background: var(--d2-surface);
  color: var(--d2-text);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.d2-pagination__link:hover {
  border-color: var(--d2-primary);
  color: var(--d2-primary);
}
.d2-pagination .is-active .d2-pagination__link {
  background: linear-gradient(135deg, var(--d2-primary), var(--d2-accent));
  color: #fff;
  border-color: transparent;
}
.d2-pagination .is-disabled .d2-pagination__link {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.d2-seo-content {
  background: var(--d2-surface);
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius-lg);
  padding: 24px;
  margin-top: 32px;
}
.d2-seo-content h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
}
.d2-seo-content div {
  font-size: 14px;
  color: var(--d2-text-muted);
  line-height: 1.8;
}

.d2-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--d2-primary);
}
.d2-price--old {
  font-size: 13px;
  font-weight: 500;
  color: var(--d2-text-muted);
  text-decoration: line-through;
}

.d2-rate-stars {
  display: inline-flex;
  gap: 2px;
  color: var(--d2-warning);
}

@media (max-width: 992px) {
  .d2-bundles-layout {
    grid-template-columns: 1fr !important;
  }
  .d2-bundles-sidebar {
    position: static !important;
  }
  .d2-bundles-hero__title {
    font-size: 30px !important;
  }
  .d2-bundles-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .d2-more-filters {
    grid-template-columns: repeat(2, 1fr);
  }
  .d2-courses-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .d2-courses-rows {
    grid-template-columns: 1fr !important;
  }
  .d2-course-row {
    grid-template-columns: 240px 1fr !important;
  }
}
@media (max-width: 768px) {
  .d2-header__nav {
    display: none;
  }
  .d2-header__username {
    display: none;
  }
  .d2-filters-top {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .d2-footer__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .d2-bundles-grid {
    grid-template-columns: 1fr !important;
  }
  .d2-bundle-card__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .d2-bundles-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .d2-bundles-toolbar__sort {
    width: 100%;
  }
  .d2-bundles-toolbar__sort .d2-select {
    width: 100%;
  }
  .d2-bundles-toolbar__more-body {
    position: static !important;
    width: 100% !important;
  }
  .d2-courses-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .d2-courses-toolbar__sort {
    width: 100%;
  }
  .d2-courses-toolbar__sort .d2-select {
    width: 100%;
  }
  .d2-courses-toolbar__more-body {
    position: static !important;
    width: 100% !important;
  }
  .d2-more-filters {
    grid-template-columns: 1fr;
  }
  .d2-bundles-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .d2-courses-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .d2-stat-card:last-child {
    grid-column: 1/-1;
  }
  .d2-featured__card {
    grid-template-columns: 1fr;
  }
  .d2-featured__media {
    min-height: 200px;
  }
  .d2-bundles-header {
    padding: 24px;
  }
  .d2-bundles-header__title {
    font-size: 24px;
  }
  .d2-courses-header {
    padding: 24px;
  }
  .d2-courses-header__title {
    font-size: 24px;
  }
  .d2-courses-grid {
    grid-template-columns: 1fr !important;
  }
  .d2-course-row {
    grid-template-columns: 1fr !important;
  }
  .d2-course-row__media {
    min-height: 180px;
  }
  .d2-course-card__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
@media (max-width: 576px) {
  .d2-bundles-page__body {
    padding-inline: 12px;
  }
  .d2-filters-side__price {
    flex-direction: column;
  }
  .d2-bundles-stats {
    grid-template-columns: 1fr !important;
  }
  .d2-courses-stats {
    grid-template-columns: 1fr !important;
  }
  .d2-more-filters__price {
    flex-direction: column;
  }
  .d2-more-filters__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .d2-courses-page__body {
    padding-inline: 12px;
  }
  .d2-course-row__meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
