/* ================================
   БАЗОВЫЕ СТИЛИ (для всех экранов)
   ================================ */

/* Основной контейнер страницы */
.tariffs-container {
  height: calc(100vh - clamp(60px, 9vh, 100px) - 60px);
  padding: 0 clamp(16px, 5vw, 80px);
  padding-bottom: clamp(100px, 14vh, 160px); /* место под нижнее меню/плашку */
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-y: auto;
  width: 100%;
  max-width: 400px;
  margin: clamp(15px, 4vh, 50px) auto;
  overflow: visible;
}

/* Заголовок страницы */
.tariffs-title {
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 600;
  color: #3B0031;
  margin: 0;
  text-align: center;
}

/* Контент тарифов */
.tariffs-content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  overflow: visible;
}

/* Контейнер слайдера */

/* Слайдер */
.tariffs-slider {
  position: relative;
  width: 100%;
  overflow: visible; /* не обрезаем карточку при hover */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tariff-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 12px 0;
  width: 100%;
  overflow-x: auto;
  padding: 0 4px;
}

.tariff-tab {
  flex: 1;
  padding: 8px 8px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tariff-tab.active {
  background: #b230cc;
  color: #fff;
}

.tariff-tab:not(.active):hover {
  background: rgba(178, 48, 204, 0.2);
}

/* Слайды */
.tariff-slide {
  display: none;
  width: 100%;
}

.tariff-slide.active {
  display: block;
}

/* Кнопки навигации */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(40px, 6vw, 56px);
  height: clamp(40px, 6vw, 56px);
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  background: transparent;
  transform: translateY(-50%) scale(1.1);
}

.nav-btn img {
  width: clamp(40px, 6vw, 56px);
  height: clamp(40px, 6vw, 56px);
}

.nav-left {
  left: 8px;
}

.nav-right {
  right: 8px;
}

/* Карточка тарифа */
.tariff-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 350px;
  min-width: 220px;
  flex-shrink: 0;
}

/* Основная карточка */
.tariff-card-main {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  border: 2px solid #D479D5;
  justify-content: space-between;
  position: relative; /* для позиционирования стрелок внутри карточки */
}

.tariff-card-main:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Специальные стили для карточки Enterprise (Пакеты) */
.tariff-card-enterprise .tariff-card-main {
  background: #B230CC;
  color: white;
}

.tariff-card-enterprise .tariff-title {
  color: white;
}

.tariff-card-enterprise .price-amount {
  color: white;
}

.tariff-card-enterprise .price-period {
  color: white;
}

.tariff-card-enterprise .tariff-description {
  color: rgba(255, 255, 255, 0.9);
}

/* Заголовок тарифа */
.tariff-header {
  text-align: left;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tariff-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.tariff-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(12px, 3vw, 16px);
  font-weight: 500;
  color: #3B0031;
  margin: 0;
}

/* Цена */
.tariff-price {
  margin: 16px 0;
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 2px;
}

.price-amount {
  font-family: 'Inter', sans-serif;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 900;
  color: #1E293B;
  line-height: 1;
}

.price-period {
  font-family: 'Inter', sans-serif;
  font-size: clamp(14px, 2.5vw, 18px);
  font-weight: 400;
  color: #1E293B;
  line-height: 1;
}

/* Специальные стили для Premium тарифа */
.tariff-card-premium .price-amount {
  color: #B230CC;
}

.tariff-card-premium .price-period {
  color: #B230CC;
}

/* Описание тарифа */
.tariff-description {
  font-family: 'Inter', sans-serif;
  font-size: clamp(10px, 2.5vw, 12px);
  font-weight: 400;
  color: #485059;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.tariff-description small {
  font-size: clamp(8px, 2vw, 10px);
  color: #7c3aed;
  font-weight: 500;
}

/* Кнопки тарифов */
.tariff-button {
  width: 100%;
  padding: 10px 24px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: clamp(12px, 2.5vw, 16px);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid #B230CC;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  background: white;
  color: #3B0031;
  flex-shrink: 0;
}

.tariff-button:hover {
  background: #B230CC;
  color: white;
}

.tariff-button-outline {
  background: white;
  color: #3B0031;
  border: 2px solid #B230CC;
}

.tariff-button-outline:hover {
  background: #B230CC;
  color: white;
}

.tariff-button-filled {
  background: #B230CC;
  color: white;
}

.tariff-button-filled:hover {
  background: #9a1fb3;
}

.tariff-button-free {
  background: white;
  color: #3B0031;
  border: 2px solid #B230CC;
  text-decoration: none;
}

.tariff-button-free:hover {
  background: #B230CC;
  color: white;
}

.tariff-button-enterprise {
  background: #D479D5;
  color: white;
}

.tariff-button-enterprise:hover {
  background: #c066c1;
}

/* Бейдж скидки */
.discount-badge {
  background: #F1F0FB;
  color: #B230CC;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

/* Список функций тарифа */
.tariff-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px 0;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-image: url('../../images/tariff_done.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.feature-text {
  font-family: 'Inter', sans-serif;
  font-size: clamp(11px, 2.5vw, 14px);
  font-weight: 500;
  color: white;
  line-height: 1.4;
}

/* Общие возможности */
.common-features {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  width: 100%;
}

.common-features-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: clamp(12px, 2vw, 16px) clamp(16px, 3vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
  max-width: 100%;
}

.common-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.common-feature-item .feature-check {
  width: clamp(14px, 2vw, 20px);
  height: clamp(14px, 2vw, 20px);
  flex-shrink: 0;
  background-image: url('../../images/tariff_done.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.common-feature-item .feature-text {
  font-family: 'Inter', sans-serif;
  font-size: clamp(10px, 1vw, 14px);
  font-weight: 600;
  color: white;
  line-height: 1.4;
}

/* ================================
   МОБИЛЬНАЯ ВЕРСИЯ (< 500px)
   ================================ */

@media (max-width: 499px) {
  .tariffs-container {
    max-width: calc(100vw);
  }
  
  .tariff-tabs {
    display: flex;
  }
  
  .nav-btn {
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
  }
  
  .nav-left {
    left: -20px;
  }
  
  .nav-right {
    right: -20px;
  }
  
  .common-features-content {
    max-width: 100%;
  }
}

/* ================================
   ПЛАНШЕТНАЯ ВЕРСИЯ (500px - 1023px)
   ================================ */

@media (min-width: 500px) and (max-width: 1023px) {
  .tariffs-container {
    max-width: 800px;
  }
  
  .tariff-tabs {
    display: flex;
  }
  
  .tariffs-slider {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: stretch;
  }
  
  .tariff-slide {
    display: none;
    height: 100%;
  }
  
  .tariff-slide.active {
    display: block;
  }
  
  .tariff-card {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  .tariff-card-main {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .tariff-features {
    margin-top: auto;
  }
  
  .nav-left {
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
  }
  
  .nav-right {
    right:-20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
  }
  
  .tariff-block {
    width: calc(100vw - 120px);
    max-width: 400px;
    min-width: 220px;
  }
}

/* ================================
   ДЕСКТОПНАЯ ВЕРСИЯ (>= 1024px)
   ================================ */

@media (min-width: 1024px) {
  .tariff-tabs {
    display: none;
  }
  
  .nav-btn {
    display: none;
  }
  
  .tariffs-container {
    max-width: 1440px;
    margin: clamp(15px, 4vh, 50px) auto; /* сохраняем вертикальный зазор и центрирование */
  }
  
  .tariffs-slider {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
  }

  /* ширина плашки = две карточки + промежуток между ними (20px) */
  .common-features-content {
    max-width: calc(((100% - 60px) / 4) * 2 + 20px);
    width: 100%;
  }
  
  .tariff-slide {
    display: block !important;
    height: 100%;
  }
  
  .tariff-card {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  .tariff-card-main {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .tariff-features {
    margin-top: auto;
  }
}

/* ================================
   ДОПОЛНИТЕЛЬНАЯ АДАПТИВНОСТЬ
   ================================ */

@media (max-width: 768px) {
  .tariff-card {
    padding: 24px;
    max-width: 100%;
  }
  
  .tariff-title-row {
    flex-direction: row;
    gap: 8px;
    align-items: center;
  }
}
