/* ==========================================================================
   1. БАЗОВАЯ СЕТКА СТРАНИЦЫ И ОСНОВНЫЕ КОНТЕЙНЕРЫ
   ========================================================================== */

/* Основной контейнер-сетка */
.tarif-main-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 60px;
    align-items: flex-start; /* Чтобы правый блок не растягивался по высоте */
}

/* Левая контентная часть */
.tarif-content-left {
    flex: 1;
    min-width: 65%; /* Занимает основную массу экрана */
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Правая колонка (сайдбар) */
.tarif-sidebar-right {
    width: 280px;
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
    z-index: 10;
}

/* Заголовки */
.single-tarif-title {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    color: #111;
}

.single-tarif-subtitle {
    font-size: 15px;
    color: #666;
    margin-bottom: 30px;
}

/* ==========================================================================
   2. ШАПКА: БЛОК ТЕХНОЛОГИЙ ПОДКЛЮЧЕНИЯ
   ========================================================================== */

.single-tarif-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
    width: 100%;
}

.tarif-tech-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: auto;
}

.tech-block-title {
    font-size: 11px;
    font-weight: 600;
    color: #8c939d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.tarif-tech-badges-grid {
    display: flex;
    flex-wrap: wrap; /* Чтобы на маленьких экранах плашки переносились, если не влезают */
    align-items: center;
    gap: 8px; /* Немного увеличим зазор для лучшей читаемости, на макетах МТС обычно около этого */
    width: 100%;
}

.tech-compact-badge {
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    color: #495057;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tech-compact-badge:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.tech-compact-badge.active {
    background: #e54242;
    border-color: #e54242;
    color: #fff;
}

/* ==========================================================================
   3. ХАРАКТЕРИСТИКИ ПАКЕТА (ИНТЕРНЕТ, ТВ, СИМ)
   ========================================================================== */

.tarif-package-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 25px;
    width: 100%;
}

.features-main-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.features-main-row .feature-card-mini {
    flex: 1;
}

.feature-card-mini {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 12px 16px;
    border-radius: 8px;
}

.feature-mini-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.feature-mini-info {
    display: flex;
    flex-direction: column;
}

.feature-mini-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 2px;
}

.feature-mini-value {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
}

.features-mobile-row {
    width: 100%;
}

.feature-card-mini.full-width {
    width: 100%;
}

.feature-mini-info.mobile-info-flex {
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 15px;
}

.mobile-values-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-val-item {
    font-size: 15px;
    color: #212529;
}

.mobile-val-divider {
    color: #dee2e6;
    font-weight: bold;
}

/* ==========================================================================
   4. КОНСТРУКТОР СКОРОСТЕЙ И ПОДСКАЗКИ
   ========================================================================== */

.single-tarif-speed-selector {
    margin: 30px 0;
    padding: 20px;
    background: #fcfcfc;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
}

.speed-selector-title {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 6px;
    color: #111;
}

.speed-selector-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.speed-options-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.speed-option-wrapper {
    position: relative;
    display: inline-block;
}

.speed-option-btn {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 10px 18px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

.speed-option-btn:hover {
    border-color: #b5b5b5;
    background: #fbfbfb;
}

.speed-option-btn.active {
    border-color: #e54242;
    background: #fff5f5;
}

.speed-btn-value {
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

.speed-option-btn.active .speed-btn-value {
    color: #e54242;
}

.speed-btn-unit {
    font-size: 12px;
    font-weight: 400;
    color: #666;
}

.speed-option-tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #222;
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    width: 220px;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 100;
    pointer-events: none;
}

.speed-option-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #222 transparent transparent transparent;
}

.speed-option-wrapper:hover .speed-option-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tooltip-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tooltip-list li {
    margin-bottom: 4px;
    line-height: 1.4;
}

.tooltip-list li:last-child {
    margin-bottom: 0;
    color: #ff7373;
}

/* ==========================================================================
   5. КОНСТРУКТОР ОБОРУДОВАНИЯ И СВИТЧИ
   ========================================================================== */

.tarif-addons-constructor {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.addon-cards-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.addon-card-box.grid-column {
    flex: 1;
    min-width: 0;
    align-self: flex-start;
}

.addon-card-box {
    background: #ffffff;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s ease;
}

.addon-card-box:hover {
    border-color: #dbe0e6;
}

.addon-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.addon-card-info {
    flex: 1;
}

.addon-card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #111;
}

.addon-card-desc {
  font-size: 14px;
  color: #404a52;
  margin: 0;
  line-height: 1.5;
}

.addon-switch-label {
    display: inline-block;
    position: relative;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.addon-switch-label input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.addon-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.addon-switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

input:checked + .addon-switch-slider {
    background-color: #28a745;
}

input:checked + .addon-switch-slider:before {
    transform: translateX(22px);
}

.addon-card-options {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #eef0f2;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.addon-radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
}

.addon-radio-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 2px solid #ced4da;
    border-radius: 50%;
    margin-right: 12px;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.addon-radio-option:hover input ~ .radio-custom {
    border-color: #adb5bd;
}

.addon-radio-option input:checked ~ .radio-custom {
    border-color: #e54242;
    background-color: #fff;
}

.radio-custom:after {
    content: "";
    position: absolute;
    display: none;
    top: 4px; left: 4px; width: 6px; height: 6px;
    border-radius: 50%;
    background: #e54242;
}

.addon-radio-option input:checked ~ .radio-custom:after {
    display: block;
}

.radio-text strong {
    color: #111;
}

.sim-counter-flex {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 4px;
    flex-shrink: 0;
}

.sim-counter-btn {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #e4e8ec;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.2s;
}

.sim-counter-btn:hover:not(:disabled) {
    background: #e54242;
    color: #fff;
    border-color: #e54242;
}

.sim-counter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sim-counter-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 700;
    color: #111;
    outline: none;
}

/* ==========================================================================
   6. ФИКСИРОВАННЫЙ БЛОК ДЕТАЛИЗАЦИИ ТАРИФА (ОПТИМИЗИРОВАНО!)
   ========================================================================== */

/* Раздел характеристик и опций */
.tarif-features-section {
    margin-top: 40px;
    margin-bottom: 30px;
    width: 100%;
}

/* Заголовок секции */
.features-section-title {
    font-size: 29px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

/* Сетка для карточек опций */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Элемент карточки опции */
.feature-card-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column; /* Элементы выстраиваются строго сверху вниз */
    gap: 14px; /* Ровный отступ между шапкой и текстом */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    border: 1px solid #f1f3f5;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Строка заголовка карточки: Иконка + Название в один ряд */
.feature-card-header-row {
    display: flex;
    align-items: center; /* Выравнивание по центру по вертикали */
    gap: 14px;
    width: 100%;
}

/* Контейнер иконки */
.feature-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 15px;
}

/* Заголовок внутри карточки */
.feature-card-title {
  font-size: 19px;
  font-weight: 500;
  color: #111111;
  margin: 0;
  line-height: 1.2;
}

/* Текст описания опции на всю ширину под заголовком */
.feature-card-desc {
    font-size: 13px;
    line-height: 1.5;
    color: #5c6470;
    margin: 0;
    width: 100%; /* Занимает всю ширину карточки */
}

/* ==========================================================================
   7. САЙДБАР: СТИЛИ СТОИМОСТИ И ИТОГОВЫХ ПАРАМЕТРОВ
   ========================================================================== */

.sticky-order-box {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.sticky-price-row {
    margin-bottom: 20px;
    text-align: left;
}

.sticky-price-label {
    font-size: 13px;
    color: #888;
    display: block;
    margin-bottom: 4px;
}

.sticky-old-price {
    text-decoration: line-through;
    color: #aaa;
    font-size: 15px;
    margin-right: 8px;
}

.sticky-current-price {
    font-size: 26px;
    font-weight: 700;
    color: #111;
}

.sticky-current-price.sale {
    color: #e54242;
}

.sticky-info-rows {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-bottom: 25px;
    text-align: left;
}

.sticky-info-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

.sticky-info-line.total-line {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px dashed #ddd;
    color: #111;
    font-size: 15px;
}

.sticky-info-line.total-line strong {
    font-size: 18px;
    color: #e54242;
}

.sticky-btn-submit {
    width: 100%;
    background: #e54242;
    color: #fff;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(229, 66, 66, 0.2);
}

.sticky-btn-submit:hover {
    background: #c93333;
}

.sticky-phone-block {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.phone-label {
    font-size: 12px;
    color: #999;
    display: block;
    margin-bottom: 6px;
}

.phone-number {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    text-decoration: none;
    transition: color 0.2s;
}

.phone-number:hover {
    color: #e54242;
}

/* Временный блок вывода переменных */
.debug-variables-list h3 {
    margin-top: 0;
    color: #e54242;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.debug-variables-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.debug-variables-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f9f9f9;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* Новые стили для вывода цен внутри карточек преимуществ */
.feature-card-price-block {
    margin-top: auto; /* Автоматически прижимает блок цены к самому низу карточки, если тексты разной длины */
    padding-top: 3px;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.feature-card-price-block.flex-price {
    gap: 2px;
}

.price-row-lines {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

/* Префикс "от" */
.feature-price-label-prefix {
    font-size: 14px;
    color: #111111;
    font-weight: 500;
}

/* Актуальная цена жирным */
.feature-price-current {
    font-size: 18px;
    font-weight: 700;
    color: #111111;
}

/* Старая зачеркнутая цена */
.feature-price-old {
    font-size: 14px;
    text-decoration: line-through;
    color: #e54242; /* Фирменный красный для акцента на скидке */
    font-weight: 500;
}

/* Маленький серый текст "За каждого участника" */
.feature-price-subtext {
    font-size: 11px;
    color: #8c939d;
    margin-top: 2px;
}

/* Модификатор карточки кубика, убирающий левый отступ под иконку */
.feature-card-item.cube-card .feature-card-header-row {
    display: block; /* Сбрасываем флекс-ряд, заголовок теперь один на всю строку */
}

.feature-card-item.cube-card .feature-card-title {
    font-size: 19px;
    color: #111111;
    line-height: 1.3;
}

/* Красивый знак плюс (+) после мини-иконок в маркетплейсах */
.app-mini-plus-sign {
  font-size: 26px;
  color: #737d8c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding-left: 3px;
  user-select: none;
}


.apps-mini-inline-row img{
  width: 32px;
  border-radius: 12px;
}


/* ======================================================== */
/* СТИЛИ ДЛЯ АККОРДЕОНА (ПОДРОБНАЯ ИНФОРМАЦИЯ)              */
/* ======================================================== */
.accordion-container {
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-top: 20px;
}

.accordion-item {
    border-bottom: 1px solid #f2f3f5;
}

.accordion-item:last-child {
    border-bottom: none;
}

/* Кнопка заголовка */
.accordion-header {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    padding: 22px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background-color: #fafbfc;
}

.accordion-header span {
  font-size: 17px;
  color: #111111;
  padding-right: 40px;
}

/* Фирменная стрелочка в базовом (закрытом) состоянии */
.accordion-arrow {
    background-image: url(/image/arrow-min-red.webp);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
    width: 24px;
    height: 24px;
    position: absolute;
    right: 30px;
    top: 50%;
    margin-top: -12px;
    filter: grayscale(90%); /* Делаем серой по умолчанию */
    opacity: 0.7;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                filter 0.3s ease, 
                opacity 0.3s ease; /* Плавное возвращение цвета */
}

/* Состояние при раскрытии — поворот + возвращение родного красного цвета */
.accordion-item.active .accordion-arrow {
    transform: rotate(180deg);
    filter: none; /* Полностью убираем серость, стрелка становится красной */
    opacity: 1;   /* Делаем максимально яркой */
}

/* Контейнер скрытого контента (для плавной JS-анимации) */
.accordion-collapse {
    height: 0;
    overflow: hidden;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Внутренний контент секции */
.accordion-body {
    padding: 15px 30px;
    font-size: 14px;
    line-height: 1.6;
    color: #4a5464;
}

/* ==========================================================================
   8. ОБЪЕДИНЕННЫЙ И ОПТИМИЗИРОВАННЫЙ БЛОК АДАПТИВНОСТИ (MEDIA QUERIES)
   ========================================================================== */

@media (max-width: 991px) {
    .tarif-main-layout {
        flex-direction: column;
    }
    .tarif-content-left {
        width: 100%;
        min-width: 100%;
    }
    .tarif-sidebar-right {
        width: 100%;
        position: static; /* Отключаем прилипание на мобильных */
    }
}

@media (max-width: 767px) {
    .addon-cards-row {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 575px) {
    .single-tarif-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .features-main-row {
        flex-direction: column;
        gap: 12px;
    }
    .feature-mini-info.mobile-info-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .mobile-values-group {
        margin-top: 2px;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .feature-card-item {
        padding: 20px;
    }
}