/* =========================
   BOTTOM BUTTONS
   ========================= */

.exercise-bottom-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 40px 0 74px;
}

.exercise-bottom-nav__btn {
  padding: 20px 16px;
  border-radius: 10px;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}

.exercise-bottom-nav__btn:nth-child(1) {
  background: #f5bc5b;
}

.exercise-bottom-nav__btn:nth-child(2) {
  background: #b060ae;
}

.exercise-bottom-nav__btn:nth-child(3) {
  background: #3482a2;
}

.exercise-bottom-nav__btn:hover {
  background: #1f2f52;
}

/* =========================
   MODAL BASE (ВАЖНО)
   ========================= */

.exercise-bottom-modal {
  position: fixed;
  inset: 0;
  display: none;              /* ← ключевое */
  z-index: 9999;
}

.exercise-bottom-modal.is-open {
  display: flex;              /* показываем */
}

/* overlay */
.exercise-bottom-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

/* panel */
.exercise-bottom-modal__panel {
  position: relative;
  margin: auto;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 2;
}

/* close */
.exercise-bottom-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
}

/* title */
.exercise-bottom-modal__title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
}

/* =========================
   TASKS (вкладки)
   ========================= */

.exercise-bottom-modal__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exercise-bottom-modal__tab {
  padding: 8px 12px;
  border-radius: 8px;
  background: #f1f3f7;
  text-decoration: none;
  color: #16233b;
  font-size: 13px;
}

.exercise-bottom-modal__tab.is-active {
  background: #16233b;
  color: #fff;
}

/* =========================
   TOPICS (карточки)
   ========================= */

.exercise-bottom-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.exercise-bottom-topic {
  display: block;
  text-decoration: none;
  color: #16233b;
  background: #f8f9fc;
  border-radius: 12px;
  overflow: hidden;
  transition: 0.2s;
}

.exercise-bottom-topic:hover {
  transform: translateY(-2px);
}

.exercise-bottom-topic__img {
  width: 100%;
  height: 80px;
  object-fit: cover;
}

.exercise-bottom-topic__title {
  display: block;
  padding: 8px;
  font-size: 13px;
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 480px) {
  .exercise-bottom-modal__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .exercise-bottom-nav {
    flex-direction: column;
    gap: 10px;
    padding: 0 12px;
    margin: 70px 0 24px;
  }

  .exercise-bottom-nav__btn {
    width: 100%;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    border-radius: 12px;
  }
}

