/* ================================================
   КОМПАКТНЫЙ КАЛЬКУЛЯТОР В ОДНОЙ РАМКЕ
   АДАПТИВНАЯ ВЕРСИЯ
   ================================================ */

.asc-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border: 1px solid #d0dbe8;
    border-radius: 12px;
    padding: 20px 25px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Увеличиваем расстояние между буквами для всего текста */
.asc-container,
.asc-container * {
    letter-spacing: 0.3px;
}

/* Шапка */
.asc-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5eef5;
}

.asc-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a3c5e;
    margin: 0 0 5px 0;
    letter-spacing: 0.5px;
}

.asc-header p {
    font-size: 12px;
    color: #7a8e9e;
    margin: 0;
}

/* Сетка 2 колонки */
.asc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Секции */
.asc-section {
    margin-bottom: 20px;
}

.asc-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1a3c5e;
    margin: 0 0 12px 0;
    padding-left: 8px;
    border-left: 3px solid #4a90d9;
    letter-spacing: 0.5px;
}

/* Поля */
.asc-field {
    margin-bottom: 12px;
}

.asc-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #4a627a;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.asc-input,
.asc-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0dbe8;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    box-sizing: border-box;
    letter-spacing: 0.3px;
}

.asc-input:focus,
.asc-select:focus {
    outline: none;
    border-color: #4a90d9;
}

.asc-readonly {
    background: #f8fafd;
    color: #2c4c6e;
}

/* Строка с двумя полями */
.asc-row-2col {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.asc-row-2col .asc-field {
    flex: 1;
    margin-bottom: 0;
}

/* Радио в строку */
.asc-radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.asc-radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    font-size: 12px;
    margin-bottom: 0;
}

/* Результаты */
.asc-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid #eef2fa;
    font-size: 13px;
}

.asc-result-row span {
    color: #4a627a;
}

.asc-result-row strong {
    color: #1a3c5e;
    font-size: 16px;
}

/* Таблица */
.asc-table {
    width: 100%;
    margin: 10px 0;
    font-size: 12px;
}

.asc-table td {
    padding: 6px 0;
    border-bottom: 1px solid #eef2fa;
}

.asc-table td:first-child {
    color: #4a627a;
}

.asc-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #1a3c5e;
}

/* Кнопка ремонта */
.asc-repair-btn {
    background: none;
    border: 1px solid #4a90d9;
    color: #4a90d9;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    letter-spacing: 0.3px;
}

.asc-repair-btn:hover {
    background: #4a90d9;
    color: white;
}

/* Блок ремонта */
.asc-repair-block {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eef2fa;
}

.asc-repair-block.show {
    display: block;
}

/* Итог */
.asc-total {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #e5eef5;
    text-align: center;
}

.asc-total-label {
    font-size: 14px;
    color: #4a627a;
    letter-spacing: 0.5px;
}

.asc-total-amount {
    font-size: 28px;
    font-weight: 800;
    color: #1a3c5e;
    letter-spacing: 1px;
}

.asc-total-note {
    font-size: 10px;
    color: #8ba0b5;
    margin-top: 5px;
}

/* Кнопка PDF */
.asc-pdf-btn {
    background: #1a3c5e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    letter-spacing: 0.5px;
}

.asc-pdf-btn:hover {
    background: #0f2b44;
}

/* Порты */
.asc-ports {
    display: flex;
    gap: 20px;
    margin: 8px 0;
}

.asc-ports label {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Таблица таможенных платежей */
.asc-customs-table {
    width: 100%;
    margin: 12px 0;
    font-size: 13px;
    border-collapse: collapse;
}

.asc-customs-table td {
    padding: 6px 0;
    border-bottom: 1px solid #eef2fa;
}

.asc-customs-table td:first-child {
    color: #4a627a;
}

.asc-customs-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #1a3c5e;
}

.customs-value {
    font-weight: 600;
    color: #1a3c5e;
}

/* Стиль для disabled select */
#shipping-city:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Разделитель */
.asc-separator {
    text-align: center;
    margin: 15px 0;
    position: relative;
    border-top: 1px solid #eef2fa;
}

.asc-separator span {
    background: white;
    padding: 0 10px;
    position: relative;
    top: -10px;
    font-size: 11px;
    color: #8ba0b5;
}

/* Стили для поиска города */
.asc-suggestions {
    position: absolute;
    background: white;
    border: 1px solid #d0dbe8;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: calc(100% - 24px);
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.asc-suggestions div {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.asc-suggestions div:hover {
    background: #f5f8fc;
    color: #4a90d9;
}

.asc-suggestions .selected {
    background: #e8f0fe;
    color: #4a90d9;
}

.asc-field {
    position: relative;
}

/* Таблица дополнительных услуг */
.asc-services-table {
    width: 100%;
    margin: 12px 0;
    font-size: 13px;
    border-collapse: collapse;
}

.asc-services-table td {
    padding: 6px 0;
    border-bottom: 1px solid #eef2fa;
}

.asc-services-table td:first-child {
    color: #4a627a;
}

.asc-services-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #1a3c5e;
}

/* ================================================
   АДАПТИВНОСТЬ ДЛЯ ПЛАНШЕТОВ И МОБИЛЬНЫХ
   ================================================ */

/* Планшеты (до 768px) */
@media (max-width: 768px) {
    .asc-container {
        padding: 15px;
    }
    
    .asc-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .asc-section {
        margin-bottom: 25px;
    }
    
    .asc-result-row strong {
        font-size: 15px;
    }
    
    .asc-total-amount {
        font-size: 24px;
    }
    
    /* Увеличиваем отступы для touch */
    .asc-input, .asc-select, .asc-repair-btn, .asc-pdf-btn {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .asc-radio-group label {
        font-size: 13px;
        padding: 4px 0;
    }
    
    .asc-ports label {
        font-size: 13px;
    }
    
    /* Таблицы на планшете */
    .asc-customs-table td,
    .asc-services-table td {
        padding: 8px 0;
        font-size: 13px;
    }
}

/* Мобильные телефоны (до 600px) */
@media (max-width: 600px) {
    .asc-container {
        padding: 12px;
        border-radius: 8px;
    }
    
    .asc-header h2 {
        font-size: 18px;
    }
    
    .asc-header p {
        font-size: 11px;
    }
    
    .asc-section h3 {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    /* Две колонки внутри секции превращаем в одну */
    .asc-row-2col {
        flex-direction: column;
        gap: 10px;
    }
    
    .asc-row-2col .asc-field {
        margin-bottom: 0;
    }
    
    /* Радио-группы в столбик, если не влезают */
    .asc-radio-group {
        gap: 12px;
    }
    
    /* Результаты: уменьшаем шрифт */
    .asc-result-row {
        font-size: 12px;
        padding: 6px 0;
    }
    
    .asc-result-row strong {
        font-size: 14px;
    }
    
    /* Таможенные таблицы */
    .asc-customs-table td,
    .asc-services-table td {
        font-size: 12px;
        padding: 6px 0;
    }
    
    /* Итоговая сумма */
    .asc-total-amount {
        font-size: 22px;
    }
    
    /* Кнопки на всю ширину, увеличенные */
    .asc-repair-btn, .asc-pdf-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    /* Поля ввода удобнее для пальцев */
    .asc-input, .asc-select {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    /* Поиск подсказок */
    .asc-suggestions div {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Очень маленькие экраны (до 400px) */
@media (max-width: 400px) {
    .asc-container {
        padding: 10px;
    }
    
    .asc-header h2 {
        font-size: 16px;
    }
    
    .asc-total-amount {
        font-size: 20px;
    }
    
    .asc-customs-table td:first-child,
    .asc-services-table td:first-child {
        font-size: 11px;
    }
    
    .asc-customs-table td:last-child,
    .asc-services-table td:last-child {
        font-size: 12px;
    }
    
    /* Радио кнопки могут быть в две строки, но это допустимо */
    .asc-radio-group {
        gap: 8px;
    }
}