/* ===============================
   HERO SECTION
================================ */

.courses-lists-hero {
  position: relative;          /* ✅ REQUIRED */
  width: 100%;
  height: 320px;
  overflow: hidden;            /* ✅ prevents overlap */
}

.courses-lists-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hero mask */
.courses-lists-hero__mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    1deg,
    rgba(18, 31, 62, 0.9) 0%,
    rgba(18, 31, 62, 0) 100%
  );
  backdrop-filter: blur(8px);
}

.dark-mode .courses-lists-hero__mask {
  background: linear-gradient(
    1deg,
    rgba(170, 184, 197, 0.9) 0%,
    rgba(170, 184, 197, 0) 100%
  );
}

/* ===============================
   HEADER SECTION
================================ */

.courses-lists-header {
  position: relative;          /* ✅ FIX */
  z-index: 5;
  margin-top: -80px;           /* reduced overlap */
  padding-top: 80px;
}

/* Header mask */
.courses-lists-header__mask {
  position: absolute;
  inset: 8px;
  border-radius: 32px;
  opacity: 0.5;
  background: var(--white);
  z-index: -1;                 /* ✅ behind content */
}

/* Overlay image */
.courses-lists-header__overlay-img {
  position: absolute;
  width: 280px;
  height: 280px;
  right: 16px;
  bottom: 16px;
  z-index: 2;
}

@media (max-width: 991px) {
  .courses-lists-header {
    margin-top: -40px;
    padding-top: 40px;
  }

  .courses-lists-header__overlay-img {
    width: 140px;
    height: 140px;
    top: 8px;
    bottom: auto;
  }
}

.rtl .courses-lists-header__overlay-img {
  right: auto;
  left: 16px;
}

/* ===============================
   FEATURED SECTION
================================ */

.courses-lists-featured {
  position: relative;          /* ✅ FIX */
  min-height: 470px;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
}

.courses-lists-featured__arrow {
  position: absolute;
  top: 12px;
  right: 48px;
  width: 59px;
  height: 52px;
  z-index: 2;
}

.rtl .courses-lists-featured__arrow {
  right: auto;
  left: 48px;
}

@media (max-width: 991px) {
  .courses-lists-featured {
    min-height: auto;
    padding-bottom: 24px;
  }
}

/* ===============================
   FILTERS SECTION
================================ */

.courses-lists-filters {
  position: relative;          /* ✅ FIX */
  z-index: 3;
}

.courses-lists-filters__mask {
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  opacity: 0.5;
  background: var(--white);
  z-index: -1;                 /* ✅ prevents overlap */
}

.courses-lists-filters .courses-lists-sort-input {
  width: 220px;
}

.courses-lists-filters .courses-lists-card-view input {
  display: none;
}

.courses-lists-filters .courses-lists-card-view input:checked + label {
  color: var(--primary) !important;
}

.courses-lists-filters .courses-lists-card-view label {
  color: var(--gray-400);
}

.courses-lists-filters .courses-lists-card-view label:hover {
  background-color: var(--gray-100) !important;
}
