/* Контейнер для сетки 4 карточки */
.tariffs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin: 30px 0;
}

@media (max-width: 1200px) {
    .tariffs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .tariffs-grid {
        grid-template-columns: 1fr;
    }
}

/* Карточка тарифа */
.tariff-cards {
  position: relative;

  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 20px;
  padding: 20px;

  /* базовые стили */
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;

  box-shadow: 0 2px 10px rgba(16, 24, 40, .05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  z-index: 0;
}

/* hover эффект */
.tariff-cards:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

/* Блок заголовка */
.tariff-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 14px;
}

.tariff-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tariff-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a2e;
}

.tariff-subtitle {
    font-size: 13px;
    color: #8b8b9c;
}

.badge-recommend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-promo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #7700ff, #a855f7);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Блок информации */
.tariff-info {
  padding: 8px 0;
  flex: 1;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.info-row:last-child {
    border-bottom: none;
}

.info-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
}

.info-icon img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.info-content {
    flex: 1;
}

.info-value {
    font-size: 14px;
    color: #1a1a2e;
    line-height: 1.4;
}

.info-value strong {
    font-size: 18px;
    font-weight: 500;
}

.info-sub {
    font-size: 12px;
    color: #8b8b9c;
    margin-top: 2px;
}

/* Выделенный addon-блок (видеонаблюдение) — как отдельная плашка со
   значком услуги над строкой, а не просто ещё один info-row */
.info-addon {
    margin-top: 12px;
    padding: 12px;
    background: #f7f4ff;
    border: 1px solid #ece3ff;
    border-radius: 14px;
}

.info-addon-badge {
    display: inline-block;
    background: linear-gradient(135deg, #7700ff, #a855f7);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.info-addon-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-addon-row .info-icon {
    background: #fff;
}

/* Технология в одной строке со скоростью */
.info-tech {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    background: #f5f5f7;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.tech-icon {
    font-size: 12px;
    color: #999;
    cursor: default;
}

/* Блок цены и кнопок */
.tariff-footer {
  padding: 5px 16px 5px;
  background: #fff;
  margin-top: auto;
  border-radius: 20px;
}

.price-block {
    margin-bottom: 16px;
    text-align: center;
}

/* Обычная цена (без скидки) */
.price-block.regular .price-current-value {
    font-size: 32px;
    font-weight: 600;
    color: #1a1a2e;
}

/* Промо блок */
.price-label {
    font-size: 13px;
    color: #8b8b9c;
    margin-bottom: 6px;
}

.price-block.promo .price-current {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}

.price-old-value {
    font-size: 16px;
    color: #b3b3bd;
    text-decoration: line-through;
}

.price-block.promo .price-current-value {
  font-size: 36px;
  font-weight: 700;
  color: #1a1a2e;
}

.price-current-mb {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.price-block.regular .price-current-mb {
    color: #333;
}

.price-after {
    font-size: 13px;
    color: #8b8b9c;
    margin-top: 6px;
}

/* Бейдж периода скидки */
.promo-period {
    margin-top: 8px;
}

.promo-period-badge {
    display: inline-block;
    background: linear-gradient(90deg, #7700ff, #ff4f12);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    text-align: center;
}

/* Кнопки */
.tariff-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-connect {
    display: block;
    text-align: center;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgb(119, 0, 255) 0%, rgb(255, 79, 18) 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 18px;
    transition: opacity 0.2s;
}

.btn-connect:hover {
    opacity: .9;
    color: #fff;
}

.btn-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 8px 12px;
    color: #8d00ff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.btn-detail:hover {
    color: #ff6b00;
}

.btn-detail-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Спецкласс для игрового тарифа */
.tariff-gaming .price-block.promo .price-current-value {
    color: #ff8c42;
}

.tariff-gaming .price-label,
.tariff-gaming .price-after {
    color: rgba(255,255,255,0.6);
}

.tariff-gaming .price-current-mb {
    color: rgba(255,255,255,0.7);
}

/* Спецклассы */
.tariff-gaming {
    background: #101828;
    position: relative;
    isolation: isolate; /* Создает новый контекст наложения */
}

.tariff-gaming::after {
  content: '';
  position: absolute;
  bottom: 5%;
  right: 0;
  width: 80%;
  height: 85%;
  background-image: url('/image/bg-igrovoi.svg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  z-index: -1;
  opacity: 0.4;
}


.tariff-gaming .tariff-title,
.tariff-gaming .info-value,
.tariff-gaming .price-current-value {
    color: #fff;
}


.tariff-gaming .price-block.regular .price-current-value {
  color: #fff;
}

.tariff-gaming .price-block.regular .price-current-mb {
  color: #fff;
}

.tariff-gaming .info-value strong {
  font-size: 18px;
  font-weight: 500;
  color: #ff6b00;
}

.tariff-gaming .info-sub,
.tariff-gaming .price-old-label,
.tariff-gaming .price-old-value {
    color: rgba(255,255,255,0.6);
}

.tariff-gaming .info-row {
    border-bottom-color: rgba(255,255,255,0.1);
}

.tariff-gaming .tariff-footer {
    background: rgba(255,255,255,0.05);
    border-top-color: rgba(255,255,255,0.1);
}

.tariff-gaming .info-icon {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}

.tariff-gaming .info-icon img {
    filter: brightness(0) invert(1);
}

.tariff-cloud .info-tech {
    background: rgba(100, 100, 200, 0.1);
    color: #5a67d8;
}

.tariff-promo {
  background: linear-gradient(
    135deg,
    rgba(255, 122, 0, 0.08) 0%,
    rgba(168, 85, 247, 0.05) 100%
  );
}


/* Контейнер фильтров */
#filters-container {
    margin-bottom: 30px;
}

/* На десктопе - одна строка, прижата к правому краю */
@media (min-width: 769px) {
    .tech-grid {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        gap: 30px;
        flex-wrap: wrap;
    }
    
    .filter-group {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    
    .filter-label {
        font-weight: 600;
        font-size: 14px;
        color: #333;
        margin: 0;
        white-space: nowrap;
    }
    
    .filter-buttons {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: visible;
    }
    
    /* На десктопе показываем все фильтры */
    .filter-group.house-group,
    .filter-group.tech-group {
        display: flex;
    }
}

/* На мобильных - только скорость */
@media (max-width: 768px) {
    .tech-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .filter-group {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    /* Скрываем тип жилья и технологии на мобильных */
    .filter-group.house-group,
    .filter-group.tech-group {
        display: none;
    }
    
    .filter-label {
        font-weight: 600;
        font-size: 14px;
        color: #333;
        margin: 0;
        padding-left: 4px;
    }
    
    .filter-buttons {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 4px 0 8px 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    /* Стилизация скроллбара */
    .filter-buttons::-webkit-scrollbar {
        height: 3px;
    }
    
    .filter-buttons::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 10px;
    }
    
    .filter-buttons::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 10px;
    }
}

/* Общие стили для кнопок (работают на всех устройствах) */
.filter-btn {
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.filter-active {
    background: #7700d8;
    color: #fff;
    border-color: #7700d8;
}

.filter-active:hover {
    background: #6600b8;
    border-color: #6600b8;
}

/* Тумблеры "оборудование" (роутер/ТВ-приставка) и счётчик доп. SIM —
   общие для страницы тарифа (tarif/detail.php) и конструктора тарифа
   на главной (index.php). */
.addon-cards-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .addon-cards-row { grid-template-columns: 1fr; } }
.addon-card-box { background: #faf8ff; border: 1px solid #ece3ff; border-radius: 12px; padding: 18px 20px; }
.addon-card-box--wide { grid-column: 1 / -1; }
.addon-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.addon-card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.addon-card-desc { font-size: 13px; color: #777; }
.addon-card-price-hint { margin-top: 10px; font-size: 13px; color: #7700ff; font-weight: 600; }

.addon-switch-label { position: relative; flex-shrink: 0; display: inline-flex; width: 44px; height: 24px; margin-left: 15px; }
.addon-switch-label input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.addon-switch-slider { position: absolute; inset: 0; background: #ddd; border-radius: 24px; transition: background .2s ease; }
.addon-switch-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s ease; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.addon-switch-label input:checked ~ .addon-switch-slider { background: linear-gradient(135deg, #7700ff, #ff4f12); }
.addon-switch-label input:checked ~ .addon-switch-slider::before { transform: translateX(20px); }

.sim-counter-flex { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sim-counter-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #cbb3ff; background: #fff; color: #7700ff; cursor: pointer; font-size: 16px; line-height: 1; }
.sim-counter-btn:disabled { opacity: .4; cursor: not-allowed; }
.sim-counter-input { width: 32px; text-align: center; border: none; background: transparent; padding: 0; font-weight: 600; }

/* Варианты цены оборудования (рассрочка/аренда/покупка) — те же классы,
   что и в конструкторе тарифа на главной (index.php). */
.tc-equip-options { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #ece3ff; }
.tc-equip-option { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #444; cursor: pointer; }
.tc-equip-option input { accent-color: #7700ff; margin: 0; cursor: pointer; }
.tc-equip-option strong { color: #7700ff; }

.camera-counters { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #ece3ff; }
.camera-counter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.camera-counter-label { font-size: 14px; color: #444; font-weight: 500; }



