/* Базовые стили */
.calculator {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
    font-family: 'Fira Sans Condensed', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    background-color: #fff;
    border: 1px solid #e9ecef;
}

/* Логотип */
.calculator__logo-wrapper {
    width: 250px;
    margin: 0 auto;
}

.calculator__logo {
    width: 100%;
    padding-left: 60px;
    background: url('https://nevatk.ru/local/templates/tk1/img/logo.png') no-repeat center left;
    background-size: 50px;
    margin-bottom: 20px;
    box-sizing: border-box;
    line-height: 1;
    display: block;
    text-decoration: none;
}

.calculator__logo::before {
    display: none;
}

.calculator__logo-name {
    font-size: 20px;
    font-weight: 700;
    color: #007A5D;
    display: block;
    text-decoration: none;
}

.calculator__logo-desc {
    font-size: 13px;
    color: #666;
    display: block;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-decoration: none;
}

/* Экран */
.calculator__screen {
    display: none;
}

.calculator__screen--active {
    display: block;
}

/* Форма */
.calculator__form-group {
    margin-bottom: 12px;
}

.calculator__label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.calculator__input {
    width: 100%;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.calculator__input:focus {
    outline: none;
    border-color: #4B8B8B;
    box-shadow: 0 0 0 2px rgba(75, 139, 139, 0.1);
}

/* Стили для ошибок валидации */
.calculator__error {
    font-size: 11px;
    color: #dc3545;
    margin-top: 0;
    min-height: 14px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    line-height: 1;
    position: absolute;
    top: 7px;
    right: 0;
}

.calculator__error--visible {
    opacity: 1;
    transform: translateY(0);
}

/* Стили для загрузчика */
.calculator__loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
    border-radius: 8px;
    max-height: 100%;
}

.calculator__loader--active {
    opacity: 1;
    visibility: visible;
}

.calculator__loader>div {
    font-size: 14px;
    color: #666;
    text-align: center;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Позиционирование для формы */
.calculator__form-group {
    position: relative;
    margin-bottom: 16px;
}

/* Стили для полей в одну строку */
.calculator__form-group--row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.calculator__form-field {
    flex: 1;
    min-width: 0;
}

/* Пропорции для полей веса и объема */
.calculator__form-field:first-child {
    flex: 1;
    /* 1/3 */
}

.calculator__form-field:last-child {
    flex: 2;
    /* 2/3 */
}

/* Адаптивность для мобильных устройств */
/* @media (max-width: 768px) {
    .calculator__form-group--row {
        flex-direction: column;
        gap: 12px;
    }

    .calculator__form-field {
        flex: none;
    }
} */

.calculator__screen {
    position: relative;
}

/* Компактные стили для полей с ошибками */
.calculator__input.error-field {
    border-color: #dc3545;
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.1);
}

.calculator__select {
    width: 100%;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* Чекбокс группа */
.calculator__checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 3px;
}

.calculator__checkbox {
    width: auto;
    margin-right: 6px;
    transform: scale(0.9);
}

.calculator__checkbox-label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
    font-size: 13px;
    color: #555;
}

/* Переключатель габаритов */
.calculator__toggle-container {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.calculator__toggle-link {
    text-decoration: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
    box-sizing: border-box;
    line-height: 1.4;
}

.calculator__toggle-link+.calculator__toggle-link {
    margin-left: 10px;
}

.calculator__toggle-link:hover {
    text-decoration: underline;
}

.calculator__toggle-link--active {
    text-decoration: underline;
    font-weight: 700;
}

/* Габариты */
.calculator__dimensions {
    display: none;
    width: 100%;
}

.calculator__dimensions--active {
    display: block;
}

.calculator__dimensions-input {
    flex: 1;
    min-width: 0;
    padding: 8px 2px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
}

.calculator__dimensions-input:focus {
    outline: none;
    border-color: #4B8B8B;
}

/* Объем */
.calculator__volume-group {
    display: none;
}

.calculator__volume-group--visible {
    display: block;
}

/* Контейнер для объема с переключателем */
.calculator__volume-container {
    width: 100%;
}

.calculator__volume-input-wrapper {
    width: 100%;
}

/* Контейнер для габаритов с переключателем */
.calculator__dimensions-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}

.calculator__dimensions-wrapper {
    flex: 1;
    display: flex;
    gap: 4px;
    min-width: 0;
}

/* Кнопки */
.calculator__button {
    background-color: #4B8B8B;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: block;
    text-align: center;
    box-sizing: border-box;
    line-height: 1.2;
}

.calculator__button:hover {
    background-color: #386868;
}

.calculator__button--secondary {
    margin-top: 8px;
    background-color: transparent;
    color: #4B8B8B;
    border: 1px solid #4B8B8B;
}

.calculator__button--secondary:hover {
    background-color: rgba(75, 139, 139, 0.1);
}

.calculator__button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Результаты */
.calculator__result {
    margin: 16px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #4B8B8B;
}

.calculator__result-item {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calculator__result-item:last-child {
    margin-bottom: 0;
}

.calculator__result-label {
    font-weight: 400;
    font-size: 13px;
    color: #333;
    max-width: 50%;
    flex-shrink: 0;
}

.calculator__result-value {
    font-weight: 400;
    font-size: 14px;
    color: #4B8B8B;
    text-align: right;
    flex: 1;
}

.calculator__result-item--total .calculator__result-label {
    font-weight: 700;
    font-size: 14px;
}

.calculator__result-item--total .calculator__result-value {
    font-weight: 700;
    font-size: 16px;
}


/* Скрытые поля */
.calculator__hidden {
    display: none;
}

/* Стили для подсказок автодополнения */
.autocomplete-suggestions {
    position: absolute;
    max-height: 210px;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 2px;
}

.autocomplete-suggestion {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f8f8f8;
    transition: background-color 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.autocomplete-selected {
    background-color: #f5f7fa;
    color: #333;
}

.autocomplete-suggestion span {
    color: #888;
    font-size: 12px;
    font-weight: 400;
}

.autocomplete-suggestion:hover span,
.autocomplete-suggestion.autocomplete-selected span {
    color: #666;
}

/* Стилизация скроллбара для подсказок */
.autocomplete-suggestions::-webkit-scrollbar {
    width: 4px;
}

.autocomplete-suggestions::-webkit-scrollbar-track {
    background: #f8f8f8;
    border-radius: 2px;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Анимация появления подсказок */
.autocomplete-suggestions {
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность для мобильных устройств */
/* @media (max-width: 768px) {
    .autocomplete-suggestions {
        max-height: 250px;
        font-size: 16px;
    }

    .autocomplete-suggestion {
        padding: 12px 14px;
    }

    .autocomplete-suggestion span {
        font-size: 13px;
    }
} */

/* Стили для блока индивидуального расчета */
.calculator__individual-notice {
    margin-top: 20px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.calculator__individual-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.calculator__individual-text {
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
}

/* Адаптивность для мобильных устройств */
/* @media (max-width: 768px) {
    .calculator__individual-notice {
        padding: 14px;
        gap: 10px;
    }

    .calculator__individual-text {
        font-size: 13px;
    }
} */

/* Адаптивность для мобильных устройств */
/* @media (max-width: 768px) {
    .calculator__error {
        font-size: 11px;
        margin-top: 3px;
        min-height: 14px;
    }

    .calculator__loader>div {
        font-size: 13px;
        padding: 6px 12px;
    }

    .calculator__form-group {
        margin-bottom: 14px;
    }

    .calculator__screen {
        min-height: 380px;
    }
} */

/* Стили для label с переключателями */
.calculator__label--volume {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.calculator__label-text {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}