.reviews-section {
  overflow: hidden;
  margin-top: 102px !important;
  margin-bottom: 72px !important;
  padding-bottom: 72px;
  flex-direction: column;
  gap: 32px !important;
}


.send-rev-con {
  display: flex;
}

.rev-head {
  opacity: 1;
  text-align: left !important;
  padding-left: 20px;
}

.reviews-cards-cont {
  padding: 20px;
}

.bg-img {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 0;
  opacity: 0.5;
}

.bg-img-botm {
  align-content: center
}

.review-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.review-images img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #ccc;
}

input[type="file"] {
  margin-bottom: 10px;
}

.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.image-preview .thumb {
  position: relative;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.image-preview .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview .thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  color: rgb(0, 0, 0);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 18px;
  line-height: 18px;
  text-align: center;
}

.reviews-card-body {
  z-index: 1;
  background-color: #F5F5F5;
  justify-content: space-between;
}

.review-content-text {
  max-height: 140px;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  padding-right: 4px;
}

.stars {
  margin-bottom: 10px;
  gap: 8px;
  display: flex;
}

.send-rev-sec {
  margin-top: 72px;
  margin-bottom: 300px;
}

.custom-file-upload input[type="file"] {
  display: none; 
}

.send_rev_form {
  width: 60%;
  display: flex;
  padding: 32px 24px;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--padding-padding-11, 18px);
  flex: 1 0 0;
  border-radius: 19px;
  margin: 30px;
  box-shadow: 0 4px 11.8px 0 #CECBC9;
}

.rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  font-size: 2rem;
  unicode-bidi: bidi-override;
  margin-bottom: 20px;
}

.rating input {
  display: none;
}

.rating label {
  cursor: pointer;
  color: lightgray;
  transition: color 0.2s;
}

.rating label {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: url("../icons/star_empt.svg") no-repeat center/contain;
  cursor: pointer;
}

input[type="radio"]:checked ~ label {
  background-image: url("../icons/star.svg");
}

.rating label:hover,
.rating label:hover ~ label {
  background-image: url("../icons/star.svg");
}

.input-container-rev {
  height: 216px;
  max-width: 100%; 
  word-wrap: break-word;
  word-break: break-word;
}

.pagination-container {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 20px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.pagination-btn {
  padding: 12px 20px;
  background: rgba(236, 233, 231, 1);
  border-radius: 4px;
  color: black;
  cursor: pointer;
  border: 1px;
  transition: all 0.3s ease;
  font-weight: 500;
  min-width: 50px;
  text-align: center;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(144, 151, 133, 1);
  color: white;
  transform: translateY(-2px);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pagination-btn.active {
  background: rgba(144, 151, 133, 1);
  color: white;
}

.pagination-info {
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

#pageNumbers {
  display: flex;
  gap: 10px;
}

#nextBtnP::before {
  content: "Следующая"; /* или \2192 / \25B6 */
  font-size: 12px;
}

#prevBtnP::before {
  content: "Предыдущая"; /* или \2192 / \25B6 */
  font-size: 12px;
}

@media (max-width: 767px) {
  .reviews-cards-cont {
      display: flex;
      flex-direction: column;
  }

  #nextBtnP::before {
      content: "⯈"; /* или \2192 / \25B6 */
      font-size: 12px;

    }

  #prevBtnP::before {
  content: "⯇";  /* изначально вправо */
  font-size: 12px;
  }  

  .pagination-container {
      justify-content: center;
    }

  .custom-file-upload {
      width: 100%;
      display: contents;
  }  

  #reviews_btn {
      color: #727967 !important;
  }

  .reviews-cards-cont {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .reviews-card-body {
    padding: 20px;
  }

  .filter-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .rev-head {
      text-align: center !important;
  }

  .pagination-controls {
    flex-wrap: wrap;
    gap: 10px;
  }

  .card-meta {
    gap: 8px;
  }

  .meta-tag {
    font-size: 11px;
    padding: 4px 8px;
  }

  .gallery-thumbnail {
    width: 60px;
    height: 60px;
  }

  .photo-modal {
    align-content: center;
    z-index: 1501 !important;
  }

  .photo-modal-content {
      margin-top: 0px !important;
      max-height: fit-content;
      align-content: center;
  }

  .photo-modal-close {
    top: 20px !important;
    right: 20px;
    font-size: 30px;
    z-index: 1501 !important;
  }

  .photo-navigation {
    padding: 10px 15px;
    font-size: 20px;
    z-index: 1501 !important;
    font-size: 20px !important;
    /* background: transparent !important; */
    
  }

  .container-reviews {
      width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {

  .photo-modal {
      align-content: center !important;
      z-index: 1501 !important; 
    }

  .photo-modal-close {
  top: 20px !important;
  right: 20px;
  font-size: 30px;
  }

  .photo-navigation {
      padding: 10px 15px;
      font-size: 20px;
      z-index: 1501;
      font-size: 35px !important;
      /* background: transparent !important; */
    }

  .photo-modal-content {
      margin-top: 0px !important;
      max-height: fit-content;
      align-content: center;
      max-height: fit-content;
  }
}    

.fade-in {
  animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Панель фильтрации */
.filter-panel {
  background: #F5F5F5;
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.filter-row {
  display: flex;
  padding: 20px;
  gap: 20px;
}

.filter-panel {
  display: none;
}


  .filter-group {
  position: relative;
  width: 200px;
  margin-bottom: 15px;
}

.filter-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 22px;
  border: 1px solid #909785;
  cursor: pointer;
  display: flex;
  height: 44px;
  padding: 4px 24px;
  align-items: center;
  gap: 8px;
  color: #909785;
  font-family: "AA Stetica";
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  background: #F5F5F5;
  }

.filter-checkbox-group {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  background: #F5F5F5;
  border: 1px solid #909785;
  border-radius: 6px;
  padding: 10px;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.filter-group.open .filter-checkbox-group {
  display: block;
}

/* Кастомные чекбоксы */
.filter-checkbox-group {
  max-height: 250px;
  overflow-y: auto;
  border: 2px solid #909785;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
}

.filter-group.open .filter-icon {
  transform: rotate(180deg);
}

.filter-checkbox-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 4px 0;
}

.filter-checkbox-item:last-child {
  margin-bottom: 0;
}

.filter-checkbox {
  margin-right: 10px;
  width: 16px;
  height: 16px;
  accent-color: #909785;
}

.filter-checkbox-label {
  font-size: 14px;
  color: black;
  cursor: pointer;
  user-select: none;
}

.filter-checkbox-label:hover {
  color: #909785;
}


/* Мета-информация карточки */
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.meta-tag {
  background: #f1f5f9;
  color: black;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: "AA Stetica";
}

.meta-tag.city { background: #ECE9E7; color: black; }
.meta-tag.practice { background: #E0E7D5; color: black; }
.meta-tag.source { background: #F6E2DB; color: black; }

/* Галерея фотографий */
.review-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.gallery-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #e9ecef;
}

.gallery-thumbnail:hover {
  transform: scale(1.05);
  border-color: #6366f1;
}

/* Модальное окно для фото */
.photo-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s;
  z-index: 1501 !important; 
}

.photo-modal-content {
  position: relative;
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  margin-top: 5%;
  border-radius: 8px;
}

.photo-modal img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.photo-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  padding: 10px 15px;
  line-height: 1;
  z-index: 1501 !important; 
}

.photo-navigation {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  padding: 15px 20px;
  font-size: 24px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s;
  z-index: 1501 !important; 
}

.photo-navigation:hover {
  background: rgba(0, 0, 0, 0.9);
}

.photo-prev {
  left: 20px;
}

.photo-next {
  right: 20px;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.no-results h3 {
  color: #2c3e50;
  margin-bottom: 15px;
}

/* Счетчики выбранных фильтров */
.filter-counter {
  background: #909785;
  color: black;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 600;
  align-content: center;
  justify-content: center;
}