/* ============================================
КАЛЬКУЛЯТОРЫ ТИПОГРАФИИ - СТИЛИ
============================================ */
.pc-calculator {
    max-width: 1000px;
    margin: 0 auto;
    background: transparent;
    padding: 0;
}
.pc-calculator h1 {
    display: none;
}
.pc-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #EBECEC;
}
.pc-section:last-child {
    border-bottom: none;
}
.pc-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ИСПРАВЛЕНИЕ: используем flexbox вместо grid */
.pc-options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

/* Базовые стили кнопок - ОГРАНИЧЕННАЯ ШИРИНА */
.pc-option-btn {
    padding: 8px 16px;
    border: 2px solid #EBECEC;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
    text-align: center;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    outline: none;
    /* ОГРАНИЧЕННАЯ ШИРИНА - не растягиваться */
    min-width: 140px;
    max-width: 220px;
    flex: 0 0 auto; /* не растягиваться */
}
.pc-option-btn:hover {
    border-color: #FF5C15;
}
.pc-option-btn.active {
    background: #FF5C15;
    color: white;
    border-color: #FF5C15;
    font-weight: 600;
}
.pc-option-btn:focus {
    outline: none;
    box-shadow: none;
}
.pc-option-btn .pc-size-info {
    display: inline;
    font-size: 13px;
    opacity: 0.8;
    margin-left: 6px;
}

/* Специфичные ширины для разных секций */
#nb-spiralColor .pc-option-btn {
    max-width: 180px;
}
#nb-format .pc-option-btn {
    max-width: 200px;
}
#nb-orientation .pc-option-btn {
    max-width: 240px;
}
#nb-coverMat .pc-option-btn {
    max-width: 260px;
}
#nb-frontCover .pc-option-btn,
#nb-backCover .pc-option-btn {
    max-width: 240px;
}
#nb-blockPaper .pc-option-btn {
    max-width: 220px;
}
#nb-blockColor .pc-option-btn {
    max-width: 220px;
}

/* Контейнер количества */
.pc-quantity-control {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.pc-quantity-input {
    display: flex;
    align-items: center;
    border: 2px solid #EBECEC;
    border-radius: 6px;
    overflow: hidden;
}
.pc-quantity-input button {
    width: 40px;
    height: 40px;
    border: none;
    background: #EBECEC;
    cursor: pointer;
    font-size: 18px;
    color: #FF5C15;
    transition: background 0.2s;
    outline: none;
}
.pc-quantity-input button:hover {
    background: #FF5C15;
    color: white;
}
.pc-quantity-input button:focus {
    outline: none;
    box-shadow: none;
}
.pc-quantity-input input {
    width: 100px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    outline: none;
}
.pc-quantity-input input:focus {
    outline: none;
    box-shadow: none;
}
.pc-quantity-presets {
    display: flex;
    gap: 10px;
    flex: 1;
}
.pc-quantity-presets button {
    padding: 10px 16px;
    border: 2px solid #EBECEC;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    height: 40px;
    flex: 1;
    min-width: 60px;
    max-width: 120px;
    outline: none;
}
.pc-quantity-presets button:hover,
.pc-quantity-presets button.active {
    border-color: #FF5C15;
    background: #FF5C15;
    color: white;
}
.pc-quantity-presets button:focus {
    outline: none;
    box-shadow: none;
}

/* Ошибки валидации */
.pc-validation-error {
    margin-top: 12px;
    padding: 12px 16px;
    background: #FFF1EC;
    border: 1px solid #FFC9B0;
    border-left: 4px solid #FF5C15;
    border-radius: 6px;
    color: #C7390A;
    font-size: 14px;
    line-height: 1.5;
}
.pc-validation-error div + div {
    margin-top: 4px;
}

/* Пустое состояние результатов */
.pc-empty-state {
    padding: 20px;
    text-align: center;
    color: #999;
}

/* Итоговый блок */
.pc-totals {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dcdcdc;
}
.pc-totals-row {
    font-size: 15px;
    color: #333;
    margin-bottom: 5px;
}
.pc-totals-row--sub {
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
}
.pc-totals-value {
    color: #FF5C15;
    font-size: 20px;
}
.pc-totals-value--sub {
    font-size: 16px;
}

/* Результаты */
.pc-results {
    margin-top: 30px;
    background: #EBECEC;
    border-radius: 12px;
    padding: 25px;
}
.pc-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: white;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: default;
    border: 2px solid transparent;
}
.pc-result-item.best-price {
    border-color: #FF5C15;
    background: #FFF5F2;
}
.pc-result-time {
    font-weight: 600;
    color: #000;
}
.pc-result-price {
    font-size: 20px;
    font-weight: 700;
    color: #FF5C15;
}
.pc-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #FF5C15;
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 10px;
}
.pc-info-block {
    background: #EBECEC;
    border-left: 4px solid #FF5C15;
    padding: 15px;
    border-radius: 0 6px 6px 0;
    margin-top: 20px;
    font-size: 13px;
    color: #000;
}
.pc-info-block a {
    color: #FF5C15;
    text-decoration: none;
    font-weight: 600;
}
.pc-info-block a:hover {
    text-decoration: underline;
}

/* ============================================
АДАПТИВНОСТЬ
============================================ */
@media (max-width: 768px) {
    .pc-calculator {
        padding: 0;
    }
    .pc-options-grid {
        justify-content: center;
    }
    .pc-option-btn {
        max-width: 100%;
        flex: 1 1 100%;
    }
    .pc-quantity-control {
        flex-direction: column;
        align-items: stretch;
    }
    .pc-quantity-input {
        width: auto;
        align-self: flex-start;
        margin-bottom: 10px;
    }
    .pc-option-btn {
        height: 44px;
    }
    .pc-quantity-presets {
        flex-wrap: wrap;
        gap: 8px;
        display: flex;
        width: 100%;
    }
    .pc-quantity-presets button {
        flex: 0 0 calc(25% - 6px);
        padding: 10px 4px;
        font-size: 13px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .pc-quantity-presets button {
        flex: 0 0 calc(50% - 6px);
        padding: 12px 8px;
        font-size: 14px;
    }
}