body {
    font-family: Arial, sans-serif;
    font-size: 15px;
    padding-bottom: 220px;        /* было 80px → увеличить, чтобы не прижимать к нижнему краю */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ================= ГОРОД ================= */
.city-selector {
    margin: 16px 0;               /* чуть меньше отступа */
    padding: 12px 16px;
    background: #eef3ff;
    border-radius: 10px;
    display: flex;
    gap: 24px;
    align-items: center;
    font-size: 16px;              /* было 18px */
}

/* ================= ГРУППЫ ================= */
.section {
    margin-top: 30px;
    position: relative;
}

.section h2 {
    background: linear-gradient(135deg,#007bff,#0056b3);
    color: #fff;
    padding: 13px 18px;           /* чуть меньше */
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    user-select: none;
}

.content {
    display: none;
    border: 1px solid #ddd;
    border-top: none;
    background: #f9f9f9;
    padding: 20px;
}

.content.show {
    display: block;
}

/* ================= ТАБЛИЦА ================= */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

th, td {
    font-size: 13px;              /* чуть мельче */
    padding: 3px 5px;
}

th {
    background: #e9ecef;
}

.content table {
    position: relative;
    z-index: 1;
}

/* ================= ВЫРАВНИВАНИЕ ================= */
.center {
    text-align: center;
}

.right {
    text-align: right;
}

.num-col {
    width: 50px;
    background: #f8f9fa;
    text-align: center;
}

th.num-col {
    text-align: center;
}

/* ================= ЦЕНА ================= */
.price-cell {
    font-weight: bold;
    color: #28a745;
    font-size: 13px;              /* мельче */
}

/* ================= INPUT ================= */
.qty-input {
    width: 60px;                  /* чуть уже */
    text-align: right;
    padding: 4px;                 /* чуть меньше */
}

.qty-input.zero {
    background: #eee;
    color: #888;
}

/* ================= HOVER ================= */
tbody tr:hover td {
    background-color: #eef5ff;
}

tr.selected {
    background: #d4edda;
}

/* ================= FLOAT PANEL ================= */
/* панель внизу справа */
.selected-products {
    position: fixed;

    /* просто поднимаем выше */
    bottom: calc(60px + env(safe-area-inset-bottom));

    right: 14px;

    /* ВАЖНО: возвращаем компактную ширину */
    width: auto;

    background: #e7f3ff;
    padding: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));

    border-radius: 12px;
    box-shadow: 0 0 12px rgba(0,0,0,.2);

    display: none;
    z-index: 9999;
    font-size: 14px;
}

.count-button {
    margin-top: 8px;
    padding: 10px 26px;
    font-size: 14px;              /* было 16px */
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.clear-button {
    margin-top: 8px;
    padding: 8px 24px;
    font-size: 13px;              /* было 14px */
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* ================= HEADER ================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 3px solid #007bff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* логотип */
.logo img {
    height: 50px;
    width: auto;
}

/* блок выбора города */
.city-selector-header {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #007bff;
}

.city-selector-header label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: 500;
}

.city-selector-header input[type="radio"] {
    margin: 0;
}

/* кнопка в правом блоке */
.top-actions-container {
    white-space: nowrap;
}

.top-actions {
    display: inline-block;
}

.blue-button {
    text-decoration: none;
    padding: 8px 18px;            /* было 14px */
    font-size: 13px;
    color: #fff !important;
    background: #007bff !important;
    border-radius: 6px;
    display: inline-block;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
    transition: all 0.2s ease;
}

.blue-button:hover {
    background: #0056b3 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.4);
}

/* ================= UI ================= */
.arrow {
    margin-right: 6px;
}

/* ================= ПОДГРУППЫ ================= */
.subgroup-title {
    cursor: pointer;
    margin: 8px 0;
    padding: 8px 14px;            /* чуть меньше */
    background: #e8f2ff;
    border-radius: 6px;
    font-weight: 600;
    color: #1b4f91;
    font-size: 14px;              /* мельче */
    transition: background .2s ease;
}

.subgroup-title:hover {
    background: #dbeaff;
}

.subgroup-title .arrow {
    margin-right: 6px;
}

/* ================= КАЛЬКУЛЯТОР ЗАБОРА ================= */
.calc-form {
    max-width: 420px;
    margin: 16px 0;
    padding: 16px;
    background: linear-gradient(135deg, #eef3ff 0%, #e8f2ff 100%);
    border: 1px solid #dbeaff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,123,255,0.1);
    font-size: 16px;              /* было 14px → +2 ед. */
}

.form-row {
  display: flex;
  gap: 24px;
  align-items: flex-end;  /* Поля в одной строке по нижнему краю */
}

.form-group {
  flex: 1;
}

.form-label, .label-hint, .unit {
    font-size: 15px !important;   /* было 13px → +2 ед. */
    font-weight: 500;
}

.input-wrapper {
  position: relative;
  justify-content: center;
  display: flex;
  align-items: center;
}

.form-input {
    flex: 1;
    max-width: 80px;              /* чуть уже */
    height: 34px;                 /* чуть ниже */
    padding: 5px 7px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;              /* было 14px → +2 ед. */
    font-weight: 500;
    background: #fff;
    text-align: center;
    transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}

.form-input:hover {
  border-color: #007bff;
}

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

.form-input {
  -moz-appearance: textfield;
}

/* ================= ПОЯСНЕНИЕ К РАСЧЕТУ ================= */
.calculation-hint {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 13px;              /* было 14px */
    color: #856404;
    line-height: 1.5;
}

.calculation-hint strong {
    color: #665d33;
}

.hint-container {
    margin: 16px 0;
}

.hint-toggle {
    display: inline-block;
    cursor: pointer;
    font-size: 13px;
    color: #000000;          /* Изменили цвет на черный */
    font-weight: bold;
    user-select: none;
    padding: 4px 0;
}

.hint-toggle:hover {
    color: #333333;          /* Слегка меняем оттенок при наведении для UX */
    text-decoration: underline;
}

.hint-content {
    display: none;
    margin-top: 8px;
    padding: 12px;           /* Увеличили отступ для соответствия */
    background: #f8f9fa;     /* Светло-серый фон */
    border: 1px solid #dee2e6; /* Серый контур */
    border-radius: 6px;
    font-size: 13px;
    color: #555;             /* Серый цвет текста */
    line-height: 1.5;
    text-align: left;        /* Выравнивание по левому краю */
}

.hint-content.show {
    display: block;
}

/* Центрирование лейблов над полями ввода */
.calc-form .form-label {
    display: block;
    text-align: center;
    margin-bottom: 6px;
}

/* при необходимости — чуть сузить общий отступ сверху/снизу строки */
.calc-form .form-row {
    gap: 14px;
}

h1 {
    text-align: center;
    margin: 16px 0 24px;          /* чуть больше нижний отступ */
}

@media (max-width: 768px) {

    /* ===== ОБЩИЙ ОТСТУП СНИЗУ (главный фикс) ===== */
    body {
        padding-bottom: 260px;
    }

    /* ===== HEADER ===== */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        padding: 15px 20px;
    }

    .page-header > .logo,
    .page-header > .city-selector-header,
    .page-header > .top-actions-container {
        margin-bottom: 10px;
    }

    .top-actions-container {
        text-align: center;
    }

    .top-actions {
        display: block;
        width: 100%;
    }

    .blue-button {
        display: inline-block;
        width: fit-content;
        margin: 0 auto;
        padding: 8px 18px;
        font-size: 13px;
    }

    /* ===== КАЛЬКУЛЯТОР ===== */
    .calc-form {
        margin: 14px;
        padding: 14px;
    }

    .form-input {
        max-width: 70px;
    }

    /* ===== ПАНЕЛЬ С ВЫБРАННЫМИ (главный фикс UX) ===== */
    .selected-products {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .count-button,
    .clear-button {
        width: 100%;
        margin-top: 10px;
        font-size: 16px;
    }
}

