:root {
  --max-width: 1200px;
  --text-light: #555; 
}

/* --- Модальное окно (Modal) --- */
.modal {
  display: none; 
  position: fixed;
  margin: auto;
  z-index: 999;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.7); 
  align-items: center; 
  justify-content: center; 
}

.modal-content {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  margin: auto;
  padding: 10px 30px 30px;
  max-width: var(--max-width);
  max-height: 95vh; 
  overflow-y: auto;  
  border-radius: 8px;
}

.modal-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem; 
}

.modal_image-box {
  width: 100%;
  height: 50vh; 
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 12px;
  background-color: #f0f0f0; 
}

.modal_image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  object-position: center;
}

.close {
  display: flex;
  justify-content: flex-end; 
  align-items: center; 
  color: #aaa;
  font-size: 2rem;
  cursor: pointer;
}

.close:hover {
  color: black;
}


.modal-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 24px;
  padding-top: 16px; /* важный момент */
  overflow-y: auto;
  box-sizing: border-box;
  max-height: calc(90vh - 300px);
  gap: 1.5rem;
}

#modal-title {
  padding: 10px 0;
  font-size: 36px;
  font-weight: bold;
  color: #222;
}

#modal-description {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 700;
  color: #333;
  background-color: #f9f9f9;
  padding: 15px 20px;
  border-left: 4px solid #0077ff;
  border-radius: 6px;
  width: 100%;
}

#modal-extra-info {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}




/* --- Адаптивность для модального окна --- */
@media (min-width: 768px) {
  .modal-wrapper {
    flex-direction: row; 
  }

  .modal-wrapper > div {
    flex: 1; 
  }
  
  #modal-title {
    text-align: center;
    padding: 15px;
    font-size: 18px; 
  }
}



/* --- Стили для карточек (position-card) --- */
.position-card {
  display: flex; /* <-- СДЕЛАЙТЕ position-card FLEX-КОНТЕЙНЕРОМ */
  flex-direction: column;
  justify-content: space-between; 
  align-items: flex-start; 
  background-color: white;
  border-top-right-radius: 25px;
  border-top-left-radius: 25px;
  border-bottom-right-radius: 10px;
  border-bottom-left-radius: 10px;
  box-shadow: 2px 2px 5px rgba(150, 150, 150, 0.2);
  /* НЕ УСТАНАВЛИВАЙТЕ ЗДЕСЬ ВЫСОТУ! Swiper будет управлять ею. */
  height: 100%; /* Убедитесь, что слайд занимает всю высоту, которую ему дает Swiper */
}

.position-card img {
  width: 100%;
  height: 250px; 
  object-fit: cover; 
  object-position: center;
  display: block;
  border-radius: 20px 20px 5px 5px;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-description {
  display: flex;
  flex-grow: 1; /* <-- ЭТОТ flex-grow: 1 ТЕПЕРЬ БУДЕТ РАБОТАТЬ! */
  padding: 15px 15px 0;
   /* <-- Добавьте display: flex, чтобы содержимое внутри тоже выравнивалось */
  flex-direction: column;
}
/* Если у вас очень длинное описание, и оно не должно растягиваться,
   можете добавить max-height и overflow-y: auto для #modal-description */


.card-description h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.card-description p {
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-light);
}

.card-divider {
  width: 92%;
  height: 1px;
  margin: 0 auto;
  margin-top: 10px;
  background: linear-gradient(90deg, 
    rgba(0, 146, 215, 0.1), 
    rgba(0, 146, 215, 0.4) 20%, 
    rgba(0, 146, 215, 0.6) 50%, 
    rgba(0, 146, 215, 0.4) 80%, 
    rgba(0, 146, 215, 0.1)
  );
}

.card-actions {
  border-bottom-right-radius: 10px;
  border-bottom-left-radius: 10px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1rem;
}

.card-actions div {
  width: 45%; 
}

.view-button {
  width: 100%;
  padding: 8px;
  border-radius: 14px;
  color: var(--text-light, #555);
  background-color: #f2f4f7;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  border: solid;
  border-width: 0.01px;
  z-index: 1;
  transition: transform 0.3s ease;
}

.view-button:hover {
  transform: translateY(-2px);
}

.card-actions a {
  display: block;
  width: 100%;
  padding: 8px;
  border-radius: 14px;
  color: white;
  background-color: #0092D7;
  text-decoration: none;
  font-size: 12px;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.card-actions a:hover {
  background-color: #007bb3;
  transform: translateY(-2px);
}

/* --- Адаптивность для карточек и контейнера Swiper --- */

/* Это основной контейнер Swiper. Важно, чтобы он имел максимальную ширину и авто-отступы */
.section__container {
  max-width: var(--max-width);
  margin: auto;
  padding: 2rem 1rem; 
}

/* Адаптивность кнопок на маленьких экранах */
@media screen and (max-width: 480px) {
  .card-actions {
    gap: 0.75rem;
  }
  
  .card-actions div {
    width: 100%; 
  }
}


/* Swiper class */
.swiper-button-prev:after,
.swiper-button-next:after {
  content: "";
}

.swiper-button-prev,
.swiper-button-next {
  width: initial;
  height: initial;
  font-size: 3rem;
  color: var(--second-color);
  display: none;
}

.swiper-button-prev {
  left: 0;
}

.swiper-button-next {
  right: 0;
}

.swiper-pagination-bullet {
  background-color: hsl(212, 32%, 40%);
  opacity: 1;
}

.swiper-pagination-bullet-active {
  background-color: var(--second-color);
}

/* For medium devices */
@media screen and (min-width: 768px) {

  .swiper-button-next,
  .swiper-button-prev {
    display: block;
  }
 

}
@media screen and (max-width: 768px) {  
  .modal-content {
  padding: 60px 30px 30px;
}

}

/* For large devices */
@media screen and (min-width: 1120px) {
  .swiper-button-prev {
    left: -1rem;
  }
  .swiper-button-next {
    right: -1rem;
  }
}