/* styles.css */

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    text-align: center;
    margin-bottom: 30px;
}

.calculator-table, .size-table, .info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.calculator-table th, .calculator-table td,
.size-table th, .size-table td,
.info-table th, .info-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

.calculator-table th, .size-table th, .info-table th {
    background-color: #f0f0f0;
}

.calculator-table tr:nth-child(even),
.size-table tr:nth-child(even),
.info-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.calculator-table input[type="number"],
.size-table input[type="number"],
.info-table input[type="number"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

td.fbs, td.express, td.fby {
    /* Стили для ячеек с результатами */
    background-color: #e6f7ff;
    font-weight: bold;
    width: 12%; /* FBS, Экспресс, FBY столбцы */
}

/* Убираем скрытие полей ввода */
.info-table input {
    /* display: none; */ /* Убрано скрытие полей ввода */
    width: 90%; /* Настройка ширины, если необходимо */
    padding: 5px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

.size-table input[type="number"] {
    width: 100%;
    padding: 6px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Стилизация кнопки "Рассчитать" */
.calculate-button {
    text-align: center;
    margin-bottom: 60px; /* Увеличенный отступ после кнопки */
}

.calculate-button button {
    padding: 20px 40px; /* Увеличенный размер кнопки */
    font-size: 20px; /* Увеличенный размер шрифта */
    background-color: #28a745; /* Зелёный фон */
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 400px;
}

.calculate-button button:hover {
    background-color: #218838; /* Темно-зелёный при наведении */
}

/* Увеличенные отступы между блоками */
.size-block {
    margin-top: 60px; /* Увеличенный отступ перед таблицей размеров */
}

.info-table-block {
    margin-top: 60px; /* Увеличенный отступ перед информационной таблицей */
}

/* Стилизация обязательных полей */
.required {
    color: red;
    margin-left: 5px;
}

/* Стилизация ошибок */
input.error {
    border-color: red;
    background-color: #ffe6e6;
}

/* Дополнительные стили для Объёмного веса и Сравнения */
#volumetricWeight, #weightComparison {
    padding: 8px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: bold;
}

/* Стили для выделения строк */
tr.highlight-standard td {
    background-color: #d1ecf1 !important; /* Светло-голубой фон */
}

tr.highlight-reverse td {
    background-color: #fff3cd !important; /* Светло-жёлтый фон */
}

/* Изменение ширины столбцов */
.calculator-table th:first-child,
.calculator-table td:first-child {
    width: 29%; /* Название поля */
}

.calculator-table th:nth-child(2),
.calculator-table td:nth-child(2) {
    width: 29%; /* Значение */
}

.calculator-table th:nth-child(3),
.calculator-table th:nth-child(4),
.calculator-table th:nth-child(5),
.calculator-table td:nth-child(3),
.calculator-table td:nth-child(4),
.calculator-table td:nth-child(5) {
    width: 14%;
    text-align: center;
    box-sizing: border-box;
}

/* Стилизация комиссии маркета */
.double-input {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Отступ между полями */
}

/* Равная ширина столбцов в таблице размеров */
.size-table th,
.size-table td {
    width: 50%;
}

/* Исправление цвета ячейки объемного веса */
#volumetricWeight {
    background-color: #fff;
}

/* Центрирование и ширина столбцов FBS, Экспресс, FBY */
td.fbs, td.express, td.fby,
th:nth-child(3), th:nth-child(4), th:nth-child(5) {
    width: 14%;
    text-align: center;
    box-sizing: border-box;
    max-width: 14%;
}

/* Унифицируем стили для всех информационных иконок */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    position: relative;
    top: -1px;
}

.info-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #0d6efd;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.info-icon:hover svg {
    stroke: #0a4fb9;
}

/* Стили для всплывающего окна */
.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* Стили для инструкции */
.instruction {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    line-height: 1.6;
}

.instruction h3 {
    color: #007bff;
    margin-bottom: 15px;
}

/* Стили для таблиц в попапах */
.popup-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.popup-table th,
.popup-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.popup-table th {
    background-color: #f0f0f0;
}

/* Обновленные стили для таблиц в попапах */
.popup-table, .delivery-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.popup-table th,
.popup-table td,
.delivery-table th,
.delivery-table td {
    width: 50%;
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

/* Стили для информационных таблиц в попапах */
.delivery-table {
    width: 100%;
    margin: 15px 0;
    border-collapse: collapse;
}

.delivery-table th,
.delivery-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.delivery-table th {
    background-color: #f8f9fa;
}

.delivery-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Стили для окна авторизации */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-window {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.auth-window h2 {
    margin-bottom: 20px;
    color: #333;
}

.auth-window input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.auth-window button {
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.auth-window button:hover {
    background-color: #218838;
}

.auth-error {
    color: red;
    margin-top: 10px;
    display: none;
}

/* Стили для блока поиска товаров */
.product-search-block {
    margin: 40px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.search-container button {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#loadingIndicator {
    padding: 20px;
    text-align: center;
    background: #fff3cd;
    border-radius: 4px;
    margin-bottom: 20px;
}

#searchResults {
    display: grid;
    gap: 20px;
}

.shop-block {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.shop-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #0d6efd;
}

.product-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
}

.detail-label {
    color: #666;
}

.detail-value {
    font-weight: 500;
}

/* Обновляем стили для контейнера пароля */
.password-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    display: flex;
    align-items: center; /* Выравнивание по центру по вертикали */
}

.password-container input {
    width: 100%;
    padding: 12px 40px 12px 12px; /* Увеличиваем padding справа для иконки */
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    display: flex;
    align-items: center; /* Выравнивание по центру по вертикали */
}

/* Удаляем стили для иконки глаза */
.password-toggle {
    display: none;
}


.shop-search-block {
    margin: 40px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-container.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.shop-select {
    display: flex;
    width: 100%;
}

.shop-select select {
    width: 100%;
    height: 42px; /* Высота как у input */
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: #fff;
    appearance: none; /* Убираем стандартную стрелку */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
}

.shop-search-block .product-search {
    display: flex;
    gap: 10px;
}

.shop-search-block .product-search input {
    flex: 1;
    height: 42px; /* Та же высота что и у select */
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.shop-search-block .product-search button {
    height: 42px; /* Та же высота что и у input/select */
    padding: 0 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.shop-search-block .product-search button:hover {
    background-color: #218838;
}

#shopLoadingIndicator {
    padding: 20px;
    text-align: center;
    background: #fff3cd;
    border-radius: 4px;
    margin: 20px 0;
    display: none;
}

#shopSearchResults {
    margin-top: 20px;
}



/* Стили для поиска по магазинам */
.shop-search-block {
    margin: 40px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-container.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.shop-select select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: #fff;
}

.shop-search-block .product-search {
    display: flex;
    gap: 10px;
}

.shop-search-block .product-search input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.shop-search-block .product-search button {
    padding: 12px 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.shop-search-block .product-search button:hover {
    background-color: #218838;
}

#shopLoadingIndicator {
    padding: 20px;
    text-align: center;
    background: #fff3cd;
    border-radius: 4px;
    margin: 20px 0;
    display: none;
}

#shopSearchResults {
    margin-top: 20px;
}



/* Обновляем стили для кнопок поиска */
.product-search-block .search-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.product-search-block input,
.shop-search-block input {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.product-search-block button,
.shop-search-block button {
    height: 42px;
    padding: 0 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
    transition: background-color 0.3s;
}

.product-search-block button:hover,
.shop-search-block button:hover {
    background-color: #218838;
}


.product-search-block input,
.shop-search-block input,
.shop-search-block select {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 42px;
}

.product-search-block button,
.shop-search-block button {
    height: 42px;
    padding: 0 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
    transition: background-color 0.3s;
}


/* Обновляем стили для информационной иконки */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    position: relative;
    top: -1px;
}

.info-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #0d6efd;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.info-icon:hover svg {
    stroke: #0a4fb9;
}

/* Обновляем стили для полей ввода и выбора в блоке поиска по магазинам */
.shop-search-block .search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.shop-search-block input {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 42px;
}

.shop-search-block button {
    height: 42px;
    padding: 0 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
    transition: background-color 0.3s;
}

.shop-select {
    display: flex;
    height: 42px; /* Фиксированная высота */
}

.shop-select select,
.shop-search-block input,
.product-search-block input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 42px;
    box-sizing: border-box;
}

.shop-search-block .product-search {
    display: flex;
    gap: 10px;
    height: 42px; /* Фиксированная высота */
}

.shop-search-block button,
.product-search-block button {
    height: 42px;
    padding: 0 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
    transition: background-color 0.3s;
    line-height: 42px;
}

/* Удаляем дублирующиеся стили */
.product-search-block .search-container,
.shop-search-block .search-container.split {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Обновляем стили для полей ввода и селекта в блоке поиска */
.search-container.split {
    display: grid;
    grid-template-columns: 50% 50%; /* Фиксируем ширину 50% для каждой колонки */
    gap: 20px;
    align-items: center;
}

.shop-select {
    width: 100%;
    height: 42px;
}

.shop-select select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 42px;
    box-sizing: border-box;
}

.shop-search-block .product-search {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
}

.shop-search-block .product-search input {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 42px;
    box-sizing: border-box;
}

.shop-search-block button {
    height: 42px;
    padding: 0 24px;
    line-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Унифицированные стили для всех информационных иконок */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    position: relative;
    top: -1px;
}

.info-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #0d6efd;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.info-icon:hover svg {
    stroke: #0a4fb9;
}

/* Добавить стили для выпадающего списка комиссии за выплату */
.payout-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: inherit;
    line-height: 1.5;
}

.payout-select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

