/* =========================
   ГЛОБАЛЬНЫЙ ШРИФТ
   ========================= */
html body {
    font-family: Arial, sans-serif !important;
    font-size: 14px;              /* было без указания — теперь явно мельче */
    margin: 0;
}


/* =========================
   HEADER (как в allWares)
   ========================= */
.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);
}

.logo img {
    height: 50px;
    width: auto;
}

.top-actions-container {
    display: flex !important;
    flex-direction: column;
    gap: 14px;                    /* чуть меньше */
    width: fit-content;
    max-width: 380px;
    margin-left: auto;
    align-self: flex-end;
}

.top-actions {
    width: 100%;
}

.blue-button {
    text-decoration: none;
    padding: 8px 18px;            /* чуть меньше отступов */
    font-size: 13px;              /* было 14px */
    color: #fff !important;
    background: #007bff !important;
    border-radius: 6px;
    display: inline-block;
}

.blue-button:hover {
    background: #007bff !important;
    color: #fff !important;
}


/* =========================
   КОНТЕЙНЕР
   ========================= */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}


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

th, td {
    font-size: 12px;              /* мельче, чем 13px */
    padding: 4px 6px;             /* чуть меньше */
    border-bottom: 1px solid #ddd;
    text-align: center;
}

th {
    background: #e9ecef;
}

/* Подсветка ВСЕЙ строки, включая 1-й столбец */
tbody tr:hover td {
    background-color: #eef5ff;
}

/* Нумерация */
.num-col {
    width: 40px;                  /* более компактная нумерация */
    font-weight: normal;
    background: #f8f9fa;
    text-align: center;
    font-size: 11px;              /* совсем мелко номера */
}

/* Заголовок # по центру */
th.num-col {
    text-align: center;
}

/* Числа справа */
.right {
    text-align: right;
}


/* =========================
   ИТОГО
   ========================= */
.total {
    font-weight: bold;
    font-size: 16px;              /* было 18px */
    text-align: right;
    margin-top: 14px;
}

/* =========================
   КНОПКИ (все зелёные)
   ========================= */
    .buttons {
        margin-top: 14px;
    }

    .buttons button {
        margin-right: 10px;
        padding: 8px 20px;
        font-size: 12px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        background: #28a745; /* зелёный фон для всех кнопок */
        color: white;
    }

    /* при необходимости — убрать индивидуальные цвета для 1‑й/последней */
    .buttons button:first-child,
    .buttons button:last-child {
        background: #28a745;
        color: white;
    }

/* =========================
   МОДАЛЬНОЕ ОКНО EMAIL (общий стиль)
   ========================= */
.modal {
    display: none;                /* ВАЖНО: скрыто по умолчанию */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fff;
    margin: 14% auto;             /* чуть выше/ниже в центре */
    padding: 14px;
    width: 320px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    font-size: 13px;              /* мельче текст модалки */
}

.modal-content input {
    width: 88%;
    padding: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.modal-content button {
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}

/* Универсальный стиль для всех кнопок отправки в модалках */
.modal-content .btn-submit {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    background-color: #28a745;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
    width: auto;
}

.modal-content .btn-submit:hover {
    background-color: #218838; /* Легкое затемнение при наведении */
}

.close {
    position: absolute;
    right: 8px;
    top: 4px;
    font-size: 16px;              /* чуть меньше крестика */
    cursor: pointer;
}

/* ========================================
   МОДАЛКА "Запрос на товар в компанию"
   (уже, компактно, все стили в CSS)
   ======================================== */

/* ОБЩАЯ МОДАЛЬНАЯ ОБЛАСТЬ (уже, под размер содержимого) */
/* прячем модальное окно по умолчанию */
#emailToMetalbaseModal {
    display: none;
}

/* базовые стили для всего модального окна */
#emailToMetalbaseModal .modal-content {
    width: max-content;
    min-width: 320px;
    max-width: 90vw;
    padding: 24px;
    text-align: left;
    margin: 0 auto;      /* 0 сверху — окно прижимается к верху page */
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 85vh;

    /* 3. Все остальные тексты (шрифт, цвет, жирность) */
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-weight: normal;
    color: #000;
}

/* 1. Название окна: "Запрос на звонок от специалиста компании" */
#emailToMetalbaseModal .modal-title:first-child {
    margin: 0 0 16px 0;
    font-size: 1.3em;
    font-weight: bold;
    color: #000;
    text-align: center;
}

#emailToMetalbaseModal h4.modal-title {
    margin: 0 0 16px 0;
    font-size: 1.1em;
    font-weight: normal; /* Сделали нежирным */
    color: #000;
    text-align: left;
}

/* 2. "Металлобаза" и "Ваши данные" */
#emailToMetalbaseModal .modal-label-big {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: bold;
    color: #000;
}

/* остальной текст в модальном окне (подсказки, подсказки в полях и т.п.) */
#emailToMetalbaseModal {
    color: #000;
}

/* Лейблы полей ввода */
#emailToMetalbaseModal .form-label {
    display: block;
    font-weight: normal;
    color: #000;
    margin-bottom: 6px;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

/* Группы полей */
#emailToMetalbaseModal .form-group {
    margin-bottom: 16px;
}

/* Поле "Металлобаза" */
#emailToMetalbaseModal select#baseSelect {
    width: 240px;
    max-width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Поле "Телефон" */
#emailToMetalbaseModal input#phoneInput {
    width: 200px;
    max-width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Поле "Email" */
#emailToMetalbaseModal input#emailInput2 {
    width: 240px;
    max-width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Поле "Комментарий" */
#emailToMetalbaseModal .comment-input,
#emailToMetalbaseModal input::placeholder,
#emailToMetalbaseModal textarea::placeholder{
    width: 100%;
    min-height: 90px;
    box-sizing: border-box;
    resize: both;
    overflow: auto;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

/* Красная рамка только вокруг полей ввода, без групп и заголовков */
#emailToMetalbaseModal .field-error {
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15);
}

/* отключаем красную обводку у форм‑групп */
#emailToMetalbaseModal .form-group.error {
    outline: none;
}

/* отключаем красную рамку у полей в error-состоянии (если больше не нужно) */
#emailToMetalbaseModal .form-group.error input,
#emailToMetalbaseModal .form-group.error select {
    border-color: #ccc;
}

/* отступ под кнопкой "Отправить запрос" на всех устройствах */
#emailToMetalbaseModal .form-actions {
    text-align: center;
    margin-top: 16px;
    margin-bottom: 30px;
}

#emailToMetalbaseModal .btn-submit {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    background-color: #28a745;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0.6;
}

#emailToMetalbaseModal .btn-submit[disabled] {
    opacity: 0.6;
    cursor: default;
}

/* =========================
   IFRAME АДАПТАЦИЯ (добавить в конец)
   ========================= */
/* Только для 1200px и меньше, НО сохраняем прижимание к верху */
@media screen and (max-width: 1200px) {
    html body {
        font-size: 13px !important;
        padding: 8px 4px !important;
    }

    .container {
        max-width: 100% !important;
        padding: 10px !important;
    }

    .page-header {
        padding: 8px 10px !important;
    }

    th, td {
        padding: 3px 5px !important;
        font-size: 11px !important;
    }

    .num-col {
        width: 36px !important;
    }

    .blue-button,
    .buttons button {
        padding: 7px 14px !important;
        font-size: 12px !important;
    }

    .total {
        font-size: 15px !important;
    }

    /* планшеты: оставляем общий стиль, но уменьшаем ширину модалки */
    .modal-content {
        max-width: 300px;
        padding: 12px !important;
        /* margin удаляем / оставляем как в основном стиле */
    }

    #emailToMetalbaseModal .form-actions {
        margin-bottom: 60px;
    }
}

@media screen and (max-width: 768px) {
    html body {
        font-size: 12px !important;
    }

    th, td {
        padding: 2px 4px !important;
        font-size: 10px !important;   /* самое мелкое на маленьких экранах */
    }

    .container {
        padding: 6px !important;
    }

    .buttons {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 80px; /* больше отступа под кнопкой */
    }

    .buttons button {
        margin-bottom: 14px;
        margin-right: 0;
        width: max-content;        /* только под текст */
        min-width: 160px;          /* минимальная ширина, чтобы кнопка не стала слишком узкой */
    }

    /* нижняя кнопка — больше отступа снизу для удобного тапа */
    .buttons button:last-child {
        margin-bottom: 30px;
    }

    #emailToMetalbaseModal .modal-content {
        margin: 8% 10px 10px 10px;
        max-height: 85vh;
        padding: 16px 14px;
        margin-top: 40px;       /* отступ сверху на мобильных */
    }

    #emailToMetalbaseModal select#baseSelect,
    #emailToMetalbaseModal input#phoneInput,
    #emailToMetalbaseModal input#emailInput2 {
        width: 100%;
        max-width: 100%;
    }

    #emailToMetalbaseModal .form-actions {
        margin-bottom: 60px; /* больше отступа под кнопкой "Отправить запрос" */
    }
}