/* Калькулятор стоимости перевозки (шаблон price_calculator).
   Отдельный файл, чтобы не пересекаться со styles.css.
   Единицы — rem, как во всём проекте: 1rem = 10/1920 * 100vw. */

.pc-calculator-bg {
    width: 100%;
    background-color: #F4F4F4;
}

.pc-calculator {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    font-family: HyndaiSans-Regular, sans-serif;
    color: #333333;
}

.pc-form {
    padding: 8.9rem 11.5rem;
}

.pc-title {
    font-size: 4rem;
    line-height: 1.2;
    margin: 0;
    color: #333333;
}

.pc-subtitle {
    margin: 1.6rem 0 0;
    max-width: 52rem;
    font-size: 1.6rem;
    line-height: 1.6;
    color: #666666;
}

.pc-fields {
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
    margin-top: 4.4rem;
    max-width: 52rem;
}

.pc-field {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.pc-label {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333333;
}

/* Поле ввода с единицей измерения справа */
.pc-input {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    background-color: #fff;
    border: 1px solid #D9D9D9;
    padding: 0 1.8rem;
    transition: border-color 0.15s ease;
}

.pc-input:focus-within {
    border-color: #00a7c6;
}

.pc-input input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 1.6rem;
    color: #333333;
    padding: 1.6rem 0;
    -moz-appearance: textfield;
}

.pc-input input::-webkit-outer-spin-button,
.pc-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pc-unit {
    flex: 0 0 auto;
    font-size: 1.6rem;
    color: #999999;
}

.pc-field.invalid .pc-input {
    border-color: #C8102E;
}

.pc-error {
    display: none;
    font-size: 1.3rem;
    color: #C8102E;
}

.pc-field.invalid .pc-error {
    display: block;
}

/* Переключатель «Город / Трасса» на радиокнопках */
.pc-route {
    display: flex;
    flex-direction: row;
    gap: 0;
}

.pc-route input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pc-route label {
    flex: 1 1 0;
    padding: 1.6rem 0;
    text-align: center;
    font-size: 1.6rem;
    color: #333333;
    background-color: #fff;
    border: 1px solid #D9D9D9;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pc-route label + input + label {
    border-left: none;
}

.pc-route input:checked + label {
    background-color: #003B70;
    border-color: #003B70;
    color: #fff;
}

.pc-route input:focus-visible + label {
    outline: 2px solid #00a7c6;
    outline-offset: 2px;
}

.pc-submit {
    margin-top: 0.8rem;
    width: 100%;
    padding: 1.8rem 0;
    border: none;
    background-color: #003B70;
    color: #fff;
    font-family: inherit;
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.pc-submit:hover {
    background-color: #00539B;
}

.pc-note {
    margin: 3.2rem 0 0;
    max-width: 52rem;
    font-size: 1.3rem;
    line-height: 1.6;
    color: #888888;
}

/* Правая колонка — результаты */
.pc-results {
    padding: 8.9rem 11.5rem;
    background-color: #D9D9D9;
}

.pc-results[hidden] {
    display: none;
}

.pc-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8.9rem 11.5rem;
    background-color: #D9D9D9;
    font-size: 1.6rem;
    color: #777777;
    text-align: center;
}

.pc-placeholder[hidden] {
    display: none;
}

.pc-result-list {
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pc-result {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
}

.pc-result-label {
    font-size: 1.6rem;
    color: #555555;
}

.pc-result-value {
    font-size: 2rem;
    color: #333333;
    text-wrap: nowrap;
    white-space: nowrap;
}

/* Главный показатель — ₸/т·км */
.pc-result.primary {
    padding: 2.4rem 0;
    border-top: 1px solid #BFBFBF;
    border-bottom: 1px solid #BFBFBF;
}

.pc-result.primary .pc-result-label {
    font-size: 1.8rem;
    color: #333333;
}

.pc-result.primary .pc-result-value {
    font-size: 3.2rem;
    color: #003B70;
}

/* Структура затрат */
.pc-breakdown {
    margin-top: 3.2rem;
    border-top: 1px solid #BFBFBF;
}

.pc-breakdown summary {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 2.4rem 0 0;
    font-size: 1.6rem;
    color: #333333;
    cursor: pointer;
    list-style: none;
}

.pc-breakdown summary::-webkit-details-marker {
    display: none;
}

.pc-breakdown summary::after {
    content: "";
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    border-right: 2px solid #333333;
    border-bottom: 2px solid #333333;
    transform: rotate(45deg) translate(-0.2rem, -0.2rem);
    transition: transform 0.15s ease;
}

.pc-breakdown[open] summary::after {
    transform: rotate(-135deg) translate(-0.2rem, -0.2rem);
}

.pc-breakdown ul {
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.pc-breakdown li {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
    font-size: 1.5rem;
    color: #555555;
}

.pc-breakdown li.total {
    padding-top: 1.4rem;
    border-top: 1px solid #BFBFBF;
    font-size: 1.6rem;
    color: #333333;
}

.pc-extra {
    margin-top: 2.4rem;
    padding-top: 2.4rem;
    border-top: 1px solid #BFBFBF;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
    font-size: 1.4rem;
    color: #777777;
}

@media (max-width: 1024px) {
    .pc-calculator {
        grid-template-columns: minmax(0, 1fr);
    }

    .pc-placeholder {
        order: 1;
        margin-bottom: 2rem;
    }

    .pc-results,
    .pc-placeholder {
        padding: 4.8rem 2.2rem;
    }

    .pc-form {
        order: 2;
        padding: 0;
    }

    .pc-title {
        font-size: 3rem;
    }

    .pc-fields,
    .pc-subtitle,
    .pc-note {
        max-width: none;
    }

    .pc-result.primary .pc-result-value {
        font-size: 2.8rem;
    }
}
