label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.calc__wrapper-3-column {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.calc__decimals-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.decimals-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.decimals-input {
    width: 60px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 0;
}

.decimals-btn {
    width: 30px;
    height: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    padding: 0;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f0f0f0;
    transition: background-color 0.3s;
    font-family: inherit;
    color: inherit;
}

.decimals-btn:hover {
    background-color: #e0e0e0;
}

.decimals-btn:active {
    background-color: #d0d0d0;
}

.decimals-btn:focus {
    outline: none;
}

.calc__wrapper-2-column {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.calc__input1-wrapper,
.calc__input2-wrapper {
    border: 1px solid #e6e4e4;
    border-radius: 5px;
    padding: 30px 50px;
    flex: 1;
    max-width: 400px;
}

.calc__input1-wrapper {
    margin-right: 40px;
}

.length-converter__swap-btn {
    align-self: center;
    margin: 0 20px;
}

@media (max-width: 940px) {
    .calc__wrapper-2-column {
        flex-direction: column;
        align-items: stretch;
    }

    .calc__input1-wrapper {
        margin-right: 0;
        margin-bottom: 20px;
        max-width: 100%;
    }

    .calc__input2-wrapper {
        max-width: 100%;
    }

    .length-converter__swap-btn {
        margin: 15px 0;
        transform: rotate(90deg);
    }
}

@media (max-width: 655px) {
    .length-converter__swap-btn {
        margin: 15px 0;
        transform: rotate(90deg);
    }
}

.input__select_wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.input__select_wrapper input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 0;
}

.input__select_wrapper select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
    min-width: 150px;
}

.input-error-text {
    color: red;
    font-size: 12px;
    margin-top: 5px;
    min-height: 20px;
}

.sub-btn-zone {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.sub-btn {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.sub-btn:hover {
    background-color: #e0e0e0;
}

.sub-text {
    color: gray;
    font-size: 14px;
    text-align: center;
    margin-top: 20px;
}

.calc__result-main-text {
    font-size: 28px;
    margin: 60px 0;
    color: #0608d8;
    font-weight: bold;
    text-align: center;
}

@media (max-width: 765px) {
    .calc__input1-wrapper {
        margin-right: 20px;
    }

    .calc__input1-wrapper,
    .calc__input2-wrapper {
        padding: 30px 30px;
    }
}

@media (max-width: 655px) {
    .calc__wrapper-2-column {
        flex-wrap: wrap;
    }

    .calc__input1-wrapper {
        margin-bottom: 20px;
        margin-right: 0;
    }

    .calc__input1-wrapper,
    .calc__input2-wrapper {
        width: 100%;
        max-width: 100%;
        text-align: center;
    }

    .sub-btn-zone {
        justify-content: center;
    }

    .input__select_wrapper {
        flex-direction: column;
    }

    .input__select_wrapper input,
    .input__select_wrapper select {
        width: 100%;
    }
}

@media (max-width: 365px) {
    .section {
        padding: 0 20px;
    }

    .calc__input1-wrapper,
    .calc__input2-wrapper {
        padding: 10px 10px;
    }
}

/* Стили для слайдера ссылок */
.length-converter__links-slider-wrapper {
    margin: 20px 0;
    padding: 0 30px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.length-converter__links-slider-wrapper::-webkit-scrollbar {
    height: 8px;
}

.length-converter__links-slider-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.length-converter__links-slider-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.length-converter__links-slider-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.length-converter__links-slider {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    min-width: max-content;
}

.length-converter__link {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    background-color: #e7f3ff;
    border: 1px solid #0056b3;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
}

.length-converter__link:hover {
    background-color: #b3d9ff;
    border-color: #004085;
    color: #002752;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

@media (max-width: 600px) {
    .length-converter__link {
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* Блок автоматического расчета во все единицы */
.all-units-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 1400px) {
    .all-units-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

.units-group {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.units-group-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 8px;
}

.units-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.unit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #fff;
    border-radius: 5px;
    border: 1px solid #ddd;
    transition: background-color 0.2s;
    gap: 15px;
}

.unit-item:hover {
    background-color: #f5f5f5;
}

.unit-name {
    font-weight: 500;
    color: #333;
    flex: 1;
    min-width: 150px;
}

.unit-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 250px;
}

.unit-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: right;
    min-width: 0;
    margin-bottom: 0;
}

.unit-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}


@media (max-width: 768px) {
    .all-units-wrapper {
        grid-template-columns: 1fr;
    }
    
    .unit-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .unit-name {
        min-width: auto;
        width: 100%;
    }
    
    .unit-input-wrapper {
        width: 100%;
        max-width: 100%;
    }
    
    .unit-input {
        text-align: left;
    }
}
