.lessons {
  padding: 60px 0;
  background-image: url(/src/img/desk/services/bg.png);
  background-repeat: no-repeat;
  background-position: top right;
  background-size: contain;
}

.lessons__title {
  font-family: sans-serif;
  font-size: clamp(28px, 4vw, 28px);
  font-weight: 300;
  line-height: 1.2;
  text-align: left;
  margin-bottom: 20px;
  width: 70%;
}

.lessons__subtitle {
  font-family: sans-serif;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  text-align: left;
  margin-bottom: 40px;
  width: 50%;
}

.lessons__row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.lessons__row--two {
  justify-content: space-between;
}

.lessons__row--three {
  justify-content: space-between;
}

.lessons__item {
  border-radius: 20px;
  overflow: hidden;
  width: 100%;
  max-width: 500px;
  height: 100px;
  position: relative;
  cursor: pointer;
}

.lessons__item--yellow {
  background-color: #FFF4BF;
}

.lessons__item--purple {
  background-color: #E8E6FF;
}

.lessons__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 20px;
  height: 100%;
}

.lessons__item--yellow .lessons__header {
  background-color: #FFF4BF;
}

.lessons__item--purple .lessons__header {
  background-color: #E8E6FF;
}

.lessons__header-title {
  font-family: sans-serif;
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
  text-align: center;
  padding-right: 40px;
}

.lessons__arrow {
  width: 30px;
  height: 30px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6z"/></svg>') no-repeat center;
  background-size: 20px;
  border-radius: 50%;
  background-color: #000;
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
}

.lessons__image-wrapper {
  width: 100%;
  max-width: 500px;
  height: 100px;
}

.lessons__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.lessons__row--two .lessons__item,
.lessons__row--two .lessons__image-wrapper {
  width: 48%;
  max-width: none;
}

.lessons__row--three .lessons__item,
.lessons__row--three .lessons__image-wrapper {
  width: 30%;
  max-width: none;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal__content {
  padding: 60px 40px 20px; /* Збільшено верхній відступ до 60px, щоб уникнути накладання */
  border-radius: 20px;
  max-width: 800px;
  width: 90%;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.8);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
  background-color: #fff;
}

.modal.active .modal__content {
  transform: scale(1);
  opacity: 1;
  height: auto;
}

.modal__content--yellow {
  background-color: #FFF4BF;
}

.modal__content--purple {
  background-color: #E8E6FF;
}

.modal__close {
  position: absolute;
  top: 20px; /* Збільшено відступ зверху */
  right: 20px;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  color: #000;
  padding: 5px 10px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  z-index: 1001;
}

.modal__title {
  font-family: sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.modal__description {
  font-family: sans-serif;
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 20px;
  text-align: center;
}

.modal__inner {
  display: flex;
  gap: 30px;
  margin-bottom: 30px;
}

.modal__text {
  flex: 1;
}

.modal__list {
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
}

.modal__list li {
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  position: relative;
  padding-left: 30px;
  margin-bottom: 10px;
  text-decoration: none;
}

.modal__list li:before {
  content: "✔";
  position: absolute;
  left: 0;
  color: #ffd400;
  font-size: 20px;
}

.modal__image-wrapper {
  width: 200px;
  height: 150px;
  flex-shrink: 0;
}

.modal__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.modal__button {
  background-color: #000;
  color: #fff;
  border: none;
  padding: 10px 40px;
  border-radius: 50px;
  cursor: pointer;
  font-family: sans-serif;
  font-size: 16px;
  font-weight: 700;
  display: block;
  margin: 0 auto;
}

.modal__form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 400px;
  margin: 0 auto;
}

.modal__label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal__label input {
  padding: 10px 20px 10px 30px;
  border: none;
  border-radius: 50px;
  font-family: sans-serif;
  font-size: 14px;
  background-color: #fff;
}

.modal__label input::placeholder {
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #000;
}

.modal__form-note {
  font-family: sans-serif;
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 20px 0;
}

#success-modal .modal__content {
  text-align: center;
  max-width: 400px;
}

.modal__success-icon {
  display: inline-block;
  font-size: 40px;
  color: #ffd400;
  margin-bottom: 10px;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#success-modal.active .modal__success-icon {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 1024px) {
  .lessons {
      padding: 40px 0;
      background-size: 40%;
  }

  .lessons__title {
      font-size: clamp(24px, 4vw, 36px);
      width: 60%;
  }

  .lessons__subtitle {
      font-size: clamp(16px, 2vw, 18px);
      width: 60%;
  }

  .lessons__row--two .lessons__item,
  .lessons__row--two .lessons__image-wrapper,
  .lessons__row--three .lessons__item,
  .lessons__row--three .lessons__image-wrapper {
      width: 48%;
      max-width: none;
  }

  .lessons__row--three {
      flex-wrap: wrap;
  }

  .lessons__row--three .lessons__item,
  .lessons__row--three .lessons__image-wrapper {
      width: 48%;
  }

  .lessons__header {
      padding: 15px;
  }

  .lessons__header-title {
      font-size: clamp(18px, 2.5vw, 20px);
  }

  .modal__content {
      padding: 50px 20px 20px; /* Збільшено верхній відступ */
      max-width: 90%;
      max-height: 90vh;
  }

  .modal__close {
      top: 15px;
      right: 15px;
  }

  .modal__inner {
      flex-direction: column;
      gap: 20px;
  }

  .modal__image-wrapper {
      width: 100%;
      height: 200px;
  }
}

@media (max-width: 768px) {
  .lessons {
      padding: 30px 0;
      background-size: 30%;
  }

  .lessons__title {
      font-size: clamp(20px, 4vw, 28px);
      width: 100%;
  }

  .lessons__subtitle {
      font-size: clamp(14px, 2vw, 16px);
      width: 100%;
  }

  .lessons__row {
      flex-direction: column;
      gap: 15px;
  }

  .lessons__row--two .lessons__item,
  .lessons__row--two .lessons__image-wrapper,
  .lessons__row--three .lessons__item,
  .lessons__row--three .lessons__image-wrapper {
      width: 100%;
      max-width: none;
  }

  .lessons__header {
      padding: 10px;
  }

  .lessons__header-title {
      font-size: clamp(16px, 2.5vw, 18px);
  }

  .modal__content {
      padding: 40px 15px 15px; 
      max-width: 90%;
      max-height: 85vh;
  }

  .modal__title {
      font-size: 20px;
  }

  .modal__description {
      font-size: 14px;
  }

  .modal__list li {
      font-size: 12px;
  }

  .modal__button {
      font-size: 14px;
  }

  .modal__label input {
      font-size: 12px;
  }

  .modal__label input::placeholder {
      font-size: 12px;
  }

  .modal__form-note {
      font-size: 10px;
  }

  .modal__close {
      top: 10px;
      right: 10px;
      font-size: 20px;
      padding: 3px 8px;
  }

  .modal__inner {
      gap: 15px;
  }

  .modal__image-wrapper {
      height: 150px;
  }
}

@media (max-width: 480px) {
  .lessons {
      padding: 20px 0;
      background-size: 20%;
  }

  .lessons__title {
      font-size: clamp(18px, 4vw, 24px);
  }

  .lessons__subtitle {
      font-size: 14px;
  }

  .lessons__header {
      padding: 8px;
  }

  .lessons__header-title {
      font-size: 16px;
  }

  .modal__content {
      padding: 30px 10px 10px; /* Збільшено верхній відступ */
      max-width: 90%;
      max-height: 80vh;
  }

  .modal__title {
      font-size: 18px;
  }

  .modal__description {
      font-size: 12px;
  }

  .modal__list li {
      font-size: 10px;
      padding-left: 20px;
  }

  .modal__list li:before {
      font-size: 16px;
  }

  .modal__button {
      font-size: 12px;
      padding: 8px 30px;
  }

  .modal__label input {
      font-size: 10px;
      padding: 8px 15px;
  }

  .modal__label input::placeholder {
      font-size: 10px;
  }

  .modal__form-note {
      font-size: 8px;
  }

  .modal__close {
      top: 10px;
      right: 10px;
      font-size: 18px;
      padding: 2px 6px;
  }

  .modal__image-wrapper {
      height: 120px;
  }
}