/* Вкладки квартиры/приватный сектор - начало */
.tab,
.tariff-tabs {
  display: flex;
  max-width: 610px;
  width: 100%;
  overflow: hidden;
  border: 1px solid #ccc;
  background-color: #f1f1f1;
  border-radius: 5px;
  margin: 10px auto;
}

.tab button,
.tariff-tabs .tariff-tab-btn {
  background-color: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 16px;
  width: 100%;
  transition: 0.3s;
  text-align: center;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab button:hover,
.tariff-tabs .tariff-tab-btn:hover {
  background-color: #d93b3f;
  transition: 0.3s;
}

.tab button.active {
  background-color: #cccccc;
}

.tariff-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tariff-tabs .tariff-tab-btn:focus-visible {
  outline: 2px solid rgba(217, 59, 63, 0.9);
  outline-offset: -2px;
}

/* Активная вкладка */
.tariff-tab-input:checked ~ .tariff-tabs .tariff-tab-btn.active {
  background-color: #cccccc;
}

/* Контейнер для табов */
.tariff {
  position: relative;
}

/* Табы - скрываем неактивные */
.tariff > .tabcontent {
  display: none;
  animation: fadeIn 0.4s ease;
}

/* Активный таб - показывается через JS (tariff.js sync) */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tariff .tabcontent {
  justify-content: center;
  align-items: center;
}

.tariff-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.carousel {
  width: 100%;
  max-width: 1200px;
  height: 630px;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

.slides {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.slide {
  user-select: none;
  width: 480px;
  height: 510px;
  position: absolute;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.slide .block {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Стили для тарифного блока внутри слайда карусели */
.slide .block.tariff {
  display: flex;
  flex-direction: column;
}

.slide .block.tariff ul {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.slide .block.tariff ul li:last-child {
  margin-top: auto;
}

.slide.center {
  transform: translateX(0) scale(1);
  opacity: 1;
  filter: blur(0);
  z-index: 10;
  pointer-events: auto;
}

.slide.left {
  transform: translateX(-350px) scale(0.8);
  opacity: 1;
  filter: blur(5px);
  z-index: 5;
  /* Чтобы боковые (перекрывающиеся) слайды не "съедали" клики по центру */
  pointer-events: none;
}

.slide.right {
  transform: translateX(350px) scale(0.8);
  opacity: 1;
  filter: blur(5px);
  z-index: 5;
  pointer-events: none;
}

.slide.hide-left {
  transform: translateX(-1000px) scale(0.7);
  opacity: 0;
  pointer-events: none;
}

.slide.hide-right {
  transform: translateX(1000px) scale(0.7);
  opacity: 0;
  pointer-events: none;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 239, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(10px);
  user-select: none;
  transition: .3s;
}

.arrow:hover {
  background: rgba(217, 59, 63, 0.6);
  transform: translateY(-50%) scale(1.1);
}

.arrow.left {
  left: 20px;
}

.arrow.right {
  right: 20px;
}

.arrow::before {
  content: "";
  width: 20px;
  height: 20px;
  border-left: 4px solid white;
  border-bottom: 4px solid white;
}

.arrow.left::before {
  transform: rotate(45deg);
}

.arrow.right::before {
  transform: rotate(-135deg);
}

.tariff h4 {
  font-size: 28px;
  width: 100%;
  text-align: center;
}

.tariff ul {
  list-style: none;
}

.tariff li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  color: #3351b5;
}

.dotted {
  content: '';
  flex: 1;
  border-bottom: 1px dotted #aaa;
  margin: 0 5px;
}

.char-name,
.char-value {
  white-space: nowrap;
}

.price {
  border-radius: 50%;
  background-color: #d93b3f;
  display: flex;
  width: 150px;
  height: 150px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  font-size: 33px;
  color: #ffffff;
}

.price span {
  font-size: 14px;
}

ul button {
  font-family: "lato";
  color: #ffffff;
  border: 0;
  font-size: 25px;
  font-weight: 400;
  letter-spacing: 1.25px;
  transition: all 0.5s ease-in-out;
  padding: 8px 30px;
  border-radius: 5px;
  margin: 0 auto;
  cursor: pointer;
}

.tariff-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

.tariff-actions button {
  font-family: "lato";
  color: #ffffff;
  border: 0;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 1px;
  transition: all 0.5s ease-in-out;
  padding: 8px 24px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-tariff-details {
  /* background-image: linear-gradient(75deg, #3b82f6 0%, #3b82f6 15%, #1d4ed8 86%, #1d4ed8 100%); */
  background-image: linear-gradient(75deg, #d678f8 0%, #d678f8 14%, #7005bb 67%, #7005bb 100%);
}

.btn-tariff-details:hover {
  filter: brightness(1.15);
}

.block {
  padding: 30px;
  border: 1px solid #cccccc;
  overflow: hidden;
  background-color: #ffffff;
}

.block.tariff {
  display: flex;
  flex-direction: column;
}

.block.tariff ul {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.block.tariff ul li:last-child {
  margin-top: auto;
}

/* Вкладки квартиры/приватный сектор - конец */

/* Тарифы - адаптив: свайп вместо "вертушки" */
@media screen and (max-width: 1180px),
screen and (pointer: coarse) {
  .carousel {
    width: 100%;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
  }

  .carousel::-webkit-scrollbar {
    display: none;
  }

  .carousel.active-drag {
    cursor: grabbing;
    scroll-snap-type: none;
    user-select: none;
  }

  .slides {
    position: relative;
    height: auto;
    width: max-content;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    padding: 16px;
    gap: 16px;
  }

  .slide {
    position: relative;
    flex: 0 0 auto;
    width: 85vw;
    max-width: 380px;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
    transition: none;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    scroll-snap-align: center;
  }

  .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
  }

  .slide .block.tariff {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .slide .block.tariff ul {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
  }

  .slide .block.tariff ul li:last-child {
    margin-top: auto;
  }

  .arrow {
    display: none;
  }

  .price {
    width: 120px;
    height: 120px;
    font-size: 28px;
  }

  .tariff h4 {
    font-size: 28px;
  }

  ul button {
    font-size: 20px;
    padding: 10px 22px;
  }

  .tariff-actions {
    flex-direction: column;
    gap: 8px;
  }

  .tariff-actions button {
    font-size: 18px;
    padding: 10px 20px;
    width: 100%;
    margin-bottom: 5px;
  }

  /* Адаптив текста характеристик: перенос на две строки */
  .tariff li {
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 10px;
    /* line-height: 1.3; */
  }

  .dotted {
    display: none;
  }

  .tariff li .char-name {
    width: 100%;
    font-size: 13px;
    color: #888;
  }

  .tariff li .char-value {
    width: 100%;
    font-size: 15px;
    font-weight: 600;
    color: #3351b5;
    white-space: normal;
    word-break: break-word;
  }

  .block {
    padding: 20px;
  }

  /* Мобильная адаптация табов */
  .tariff {
    position: relative;
    min-height: auto;
  }

  .tariff > .tabcontent {
    display: none;
    animation: fadeIn 0.4s ease;
  }

  /* Активный таб - показывается через JS (tariff.js sync) */
}