/* Основные стили для калькулятора */
.calculator-container {
    max-width: 940px;
    margin: 0 auto;
    overflow: hidden;
}

/* Адаптивные стили для основного контейнера */
@media (max-width: 991px) {
    .calculator-container {
        max-width: 100%;
        margin: 0 15px;
    }
}

@media (max-width: 576px) {
    .calculator-container {
        margin: 0 10px;
        border-radius: 10px;
    }
}

@media (max-width: 390px) {
    .calculator-container {
        margin: 0 5px;
        border-radius: 8px;
    }
}

/* Стили для селектора периодов */
.period-selector {
    display: flex;
    background-color: #f0f2f5;
    border-radius: 10px;
    /* overflow: hidden; */
    margin-bottom: 15px;
    padding: 4px;
}

.period-item {
    flex: 1;
    z-index: 10;
    position: relative;
    text-align: center;
    padding: 15px 0;
    cursor: pointer;
    transition: all 0.3s ease, border-color 0.3s ease;
    background-color: #f0f2f5;
    border-left: 1px solid transparent;
    border-right: 1px solid transparent;
}

.period-item.with-left-border {
    border-left: 1px solid #e5e7eb;
}

.period-item.with-right-border {
    border-right: 1px solid #e5e7eb;
}

.period-item h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.period-item {
    position: relative; /* Добавляем position: relative ко всем вкладкам */
}

.period-item.active {
    background-color: #fff;
    border-radius: 10px;
}

.period-item.active h5 {
    font-weight: 600;
}

/* Стили для шильдиков скидок */
.discount-badge {
    position: absolute;
    top: -10px;
    right: 5px;
    background-color: #dc3545;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 99999999; /* Добавляем z-index, чтобы шильдики всегда были видны */
}

/* Адаптивные стили для периодов на мобильных устройствах */
@media (max-width: 576px) {
    .period-item h5 {
        font-size: 16px;
    }
}

@media (max-width: 390px) {
    .period-item h5 {
        font-size: 14px;
        white-space: nowrap;
    }
    
    .period-item {
        padding: 10px 0;
    }
}

/* Стили для содержимого калькулятора */
.calculator-content {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.calculator-left {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.calculator-right {
    flex: 1;
    min-width: 300px;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .calculator-content {
        flex-direction: column;
    }
    
    .calculator-left {
        padding-right: 0;
        margin-bottom: 30px;
        width: 100%;
    }
    
    .calculator-right {
        width: 100%;
    }
    
    .summary-box {
        padding: 20px;
    }
}

@media (max-width: 390px) {
    .calculator-content {
        padding: 15px 10px;
    }
    
    .calculator-left {
        margin-bottom: 20px;
    }
    
    .summary-box {
        padding: 15px;
    }
}

/* Стили для строки с ценой тарифа */
.tariff-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 20px;
    flex-wrap: wrap;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.tariff-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.tariff-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

/* Стили для счетчиков */

.counter-block {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}

.counter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 20px 20px;
    flex-wrap: wrap;
}

.counter-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-right: 10px;
}

.counter-control {
    display: flex;
    align-items: center;
}

/* Адаптивные стили для счетчиков на мобильных устройствах */
@media (max-width: 480px) {
    .counter-row {
        margin-bottom: 15px;
    }
    
    .counter-label {
        margin-bottom: 10px;
    }
    
    .counter-control {
        margin-left: auto;
    }
    
    .price-note {
        margin-left: auto;
        margin-top: 5px;
    }
}

@media (max-width: 390px) {
    .tariff-price-row {
        margin-bottom: 20px;
    }
    
    .counter-row {
        margin-bottom: 10px;
    }
    
    .counter-label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .tariff-label {
        font-size: 14px;
    }
    
    .tariff-value {
        font-size: 14px;
    }
    
    .price-note {
        font-size: 12px;
        margin-bottom: 20px;
    }
    
    input[type="number"] {
        width: 40px;
        height: 28px;
    }
    
    .btn-minus, .btn-plus {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

.btn-minus, .btn-plus {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #28a745;
    background-color: transparent;
    color: #28a745;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
}

.btn-minus:hover, .btn-plus:hover {
    background-color: #28a745;
    color: white;
}

.btn-plus {
    background-color: #28a745;
    color: white;
}

input[type="number"] {
    width: 50px;
    height: 30px;
    text-align: center;
    margin: 0 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.price-note {
    font-size: 16px;
    color: #6c757d;
    padding: 0 20px 33px 20px;
    margin: 0;
    width: 100%;
}

/* Стили для блока с итогами */
.summary-box {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.summary-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-right: 10px;
    text-align: left;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.one-time-note {
    font-size: 17px;
    color: #6c757d;
    margin-top: 5px;
    font-weight: 400;
}

.separator {
    height: 1px;
    background-color: #e5e7eb;
    margin: 10px 0;
    width: 100%;
}

.total-row .summary-label {
    font-weight: 600;
}

.total-row .summary-value {
    font-weight: 700;
    font-size: 32px;
    text-align: left;
}

.economy-row {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    flex-wrap: wrap;
}

.economy-label {
    font-size: 16px;
    font-weight: 500;
    color: #28a745;
}

.economy-value {
    font-size: 16px;
    font-weight: 700;
    color: #28a745;
    text-align: right;
}

.monthly-payment {
    color: #dc3545;
    font-size: 16px;
    text-align: left;
    margin: 10px 0;
    font-weight: 500;
}

/* Адаптивные стили для блока с итогами на мобильных устройствах */
@media (max-width: 480px) {
    .summary-row {
        margin-bottom: 15px;
    }
    
    .monthly-payment {
        font-size: 14px;
    }
}

@media (max-width: 390px) {
    .summary-row {
        margin-bottom: 12px;
    }
    
    .summary-label {
        font-size: 14px;
    }
    
    .summary-value {
        font-size: 14px;
    }
    
    .one-time-note {
        font-size: 10px;
    }
    
    .monthly-payment {
        font-size: 13px;
        margin: 15px 0;
    }
    
    .submit-button {
        padding: 10px;
        font-size: 14px;
    }
    
    .separator {
        margin: 15px 0;
    }
}

.submit-button {
    width: 100%;
    padding: 12px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.submit-button:hover {
    background-color: #218838;
}