/* Практичный дизайн корзины */

/* Убираем все ограничения ширины */
main {
    max-width: none !important;
    width: 100% !important;
}

/* Основной контейнер корзины - на всю ширину */
.cart-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    min-height: calc(100vh - 120px);
    background: #f8f9fa;
    padding: 20px;
    margin: -20px;
    width: 100vw;
    box-sizing: border-box;
    max-width: none;
}

/* Боковая панель с корзинами */
.carts-sidebar {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e6ed;
    height: fit-content;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.carts-sidebar h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* Список активных корзин */
.active-carts {
    margin-bottom: 20px;
}

.cart-item {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.cart-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.cart-item.active {
    background: #e3f2fd;
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.cart-item a {
    display: block;
    padding: 12px 35px 12px 15px;
    text-decoration: none;
    color: inherit;
}

.cart-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #2c3e50;
}

.cart-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6c757d;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.cart-info .customer {
    font-style: italic;
    color: #3498db;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-info .count,
.cart-info .total {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 11px;
}

.cart-item.active .cart-info .count,
.cart-item.active .cart-info .total {
    background: #bbdefb;
    color: #1976d2;
}

/* Кнопка удаления корзины */
.delete-cart-form {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
}

.delete-cart-icon {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    opacity: 0;
}

.cart-item:hover .delete-cart-icon {
    opacity: 1;
}

.delete-cart-icon:hover {
    background: #c82333;
}

/* Форма создания новой корзины */
.new-cart-form {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
}

.new-cart-form .form-group {
    margin-bottom: 12px;
}

.new-cart-form label {
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
}

.new-cart-form input {
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.new-cart-form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.new-cart-form button {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 16px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
}

.new-cart-form button:hover {
    background: #2980b9;
}

/* Основное содержимое корзины */
.cart-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e6ed;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
}

/* Заголовок корзины - компактный */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    gap: 20px;
}

.cart-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
}

/* Информация о клиенте - компактная кнопка */
.customer-info-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.current-customer-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #495057;
    min-width: 150px;
    text-align: left;
}

.current-customer-btn:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.current-customer-btn.has-customer {
    background: #e8f5e8;
    border-color: #28a745;
    color: #155724;
}

.customer-name {
    font-weight: 500;
}

.customer-phone {
    font-size: 12px;
    color: #6c757d;
    margin-left: 8px;
}

/* Действия с корзиной */
.cart-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.add-product-btn,
.checkout-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 16px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.add-product-btn:hover {
    background: #2980b9;
}

.checkout-btn {
    background: #28a745;
}

.checkout-btn:hover {
    background: #218838;
}

.order-part-btn {
    background: #fd7e14;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 16px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.order-part-btn:hover {
    background: #e8690b;
}

/* Таблица с товарами - на всю ширину */
.cart-items {
    margin-top: 20px;
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    table-layout: auto;
}

.data-table th {
    background: #495057;
    color: white;
    padding: 12px 8px;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    border: none;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 8px;
    border: none;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    font-size: 13px;
    white-space: nowrap;
}

/* Конкретные ширины колонок */
.data-table .column-number {
    width: 60px;
    text-align: center;
}

.data-table .column-code {
    width: 120px;
}

.data-table .column-cross {
    width: 120px;
}

.data-table .column-name {
    width: auto;
    min-width: 200px;
}

.data-table .column-brand {
    width: 120px;
}

.data-table .column-warehouse {
    width: 150px;
}

.data-table .column-location {
    width: 150px;
}

.data-table .column-quantity {
    width: 80px;
    text-align: center;
}

.data-table .column-price {
    width: 100px;
    text-align: right;
}

.data-table .column-discount {
    width: 80px;
    text-align: right;
}

.data-table .column-total {
    width: 120px;
    text-align: right;
}

.data-table tr:last-child td {
    border-bottom: none;
}

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

.data-table tr:hover {
    background: #e9ecef;
}

/* Ссылки на товары */
.product-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.product-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Поля ввода в таблице */
.quantity-input,
.price-input,
.discount-input {
    background: white;
    border: 1px solid #ced4da;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 13px;
    text-align: center;
    width: 70px;
    transition: border-color 0.2s ease;
}

.quantity-input:focus,
.price-input:focus,
.discount-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 1px rgba(52, 152, 219, 0.1);
}

/* Кнопка удаления товара */
.delete-item-icon {
    background: #dc3545;
    color: white;
    border-radius: 3px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    margin-left: 8px;
    transition: background-color 0.2s ease;
}

.delete-item-icon:hover {
    background: #c82333;
}

/* Информация о складе */
.warehouse-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.warehouse-name {
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.2;
}

/* Расположение товара на складе */
.warehouse-location {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
    padding: 1px 4px;
    background: #f8f9fa;
    border-radius: 2px;
    display: inline-block;
    width: fit-content;
    line-height: 1.2;
}

/* Ссылка редактирования склада */
.edit-warehouse-link {
    display: inline-block;
    font-size: 11px;
    color: #6c757d;
    text-decoration: none;
    padding: 1px 4px;
    background: #e9ecef;
    border-radius: 3px;
    transition: all 0.2s ease;
    width: fit-content;
    margin-top: 1px;
}

.edit-warehouse-link:hover {
    background: #dee2e6;
    text-decoration: none;
    color: #495057;
}

/* Итоговая строка */
.data-table tfoot tr {
    background: #f8f9fa;
}

.data-table tfoot td {
    font-weight: 600;
    border-top: 2px solid #dee2e6;
    color: #495057;
}

.total-amount {
    font-size: 16px;
    color: #28a745;
    font-weight: 700;
}

/* Сообщения */
.no-items,
.no-carts,
.no-cart-selected {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
}

.no-cart-selected h2 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #495057;
}


/* Формы поиска */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.search-hint {
    margin-bottom: 15px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.search-hint small {
    color: #6c757d;
    font-style: italic;
}

.search-form input {
    flex: 1;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.search-form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.search-form button {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-form button:hover {
    background: #2980b9;
}

/* Кнопки в результатах поиска */
.add-to-cart-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.add-to-cart-btn:hover {
    background: #218838;
}

/* Стили для таблицы результатов поиска клиентов */
.customer-results-table {
    margin-top: 15px;
    width: 100%;
    max-width: 100%;
}

#customer-search-results {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
}

#customer-search-results:empty {
    border: none;
}

.customer-results-table .customer-row {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.customer-results-table .customer-row:hover {
    background: #e3f2fd !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.customer-results-table .customer-row:active {
    transform: translateY(0);
    background: #bbdefb !important;
}

.customer-results-table .customer-row td {
    padding: 15px 12px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    word-wrap: break-word;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-results-table .customer-row td:first-child {
    border-left: 3px solid transparent;
    transition: border-color 0.2s ease;
    max-width: 200px;
}

.customer-results-table .customer-row:hover td:first-child {
    border-left-color: #3498db;
}

.customer-results-table .customer-row td strong {
    color: #2c3e50;
    font-size: 14px;
}

.customer-results-table .customer-row:hover td strong {
    color: #1976d2;
}

/* Добавляем иконку указания на кликабельность */
.customer-results-table .customer-row::after {
    content: '→';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.customer-results-table .customer-row:hover::after {
    opacity: 1;
    color: #3498db;
}

/* Специальные стили для таблицы в модальном окне */
#customer-search-results .data-table {
    width: 100%;
    min-width: auto;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    border: none;
    table-layout: fixed;
}

#customer-search-results .data-table th,
#customer-search-results .data-table td {
    border: none;
    border-bottom: 1px solid #f1f3f4;
}

#customer-search-results .data-table th {
    background: #495057;
    color: white;
    padding: 12px 8px;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
}

#customer-search-results .data-table th:nth-child(1) {
    width: 30%;
}

#customer-search-results .data-table th:nth-child(2) {
    width: 25%;
}

#customer-search-results .data-table th:nth-child(3) {
    width: 30%;
}

#customer-search-results .data-table th:nth-child(4) {
    width: 15%;
}

/* Основные стили для таблицы результатов поиска товаров */
.product-results-table {
    margin-top: 15px;
    width: 100%;
    max-width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    table-layout: fixed !important;
}

#search-results {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    border: none;
    border-radius: 0;
    background: white;
    margin-top: 15px;
    padding: 0;
}

#search-results:empty {
    border: none;
}

.product-results-table .product-row {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.product-results-table .product-row:hover {
    background: #e8f5e8 !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(40, 167, 69, 0.15);
}

.product-results-table .product-row:active {
    transform: translateY(0);
    background: #d4edda !important;
}

.product-results-table .product-row.adding-to-cart {
    background: #fff3cd !important;
    pointer-events: none;
    opacity: 0.7;
}

.product-results-table .product-row.added-to-cart {
    background: #d1ecf1 !important;
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {

    0%,
    100% {
        background: #d1ecf1;
    }

    50% {
        background: #bee5eb;
    }
}

.product-results-table .product-row td {
    padding: 15px 12px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-results-table .product-row td:first-child {
    border-left: 3px solid transparent;
    transition: border-color 0.3s ease;
}

.product-results-table .product-row:hover td:first-child {
    border-left-color: #28a745;
}

.product-results-table .product-row td strong {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.product-results-table .product-row:hover td strong {
    color: #155724;
}

.product-results-table .product-name {
    color: #495057;
    font-weight: 500;
}

.product-results-table .product-row:hover .product-name {
    color: #155724;
}

.product-results-table .product-price {
    font-weight: 600;
    color: #28a745;
}

.product-results-table .stock-info {
    font-weight: 500;
}

.product-results-table .product-row.in-stock .stock-info {
    color: #28a745;
}

.product-results-table .product-row.out-of-stock {
    opacity: 0.7;
}

.product-results-table .product-row.out-of-stock .stock-info {
    color: #dc3545;
    font-style: italic;
}

.product-results-table .product-row.out-of-stock:hover {
    background: #f8d7da !important;
}

/* Иконка добавления - отключено */

/* Специальные стили для таблицы в модальном окне поиска товаров */
#search-results .data-table {
    width: 100%;
    min-width: 800px;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    border: none;
    table-layout: fixed;
    font-size: 13px;
}

#search-results .data-table th,
#search-results .data-table td {
    border: none;
    border-bottom: 1px solid #f1f3f4;
    padding: 12px 8px;
    text-align: left;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#search-results .data-table th {
    background: #495057;
    color: white;
    font-weight: 600;
    font-size: 13px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Точные ширины колонок */
#search-results .data-table th:nth-child(1),
#search-results .data-table td:nth-child(1) {
    width: 15%;
    min-width: 100px;
}

#search-results .data-table th:nth-child(2),
#search-results .data-table td:nth-child(2) {
    width: 40%;
    min-width: 200px;
    white-space: normal;
    word-wrap: break-word;
}

#search-results .data-table th:nth-child(3),
#search-results .data-table td:nth-child(3) {
    width: 20%;
    min-width: 120px;
}

#search-results .data-table th:nth-child(4),
#search-results .data-table td:nth-child(4) {
    width: 15%;
    min-width: 80px;
    text-align: right;
}

#search-results .data-table th:nth-child(5),
#search-results .data-table td:nth-child(5) {
    width: 10%;
    min-width: 60px;
    text-align: center;
}

/* Дополнительные стили для содержимого */
#search-results .data-table td strong {
    font-weight: 600;
    color: #2c3e50;
}

#search-results .data-table .product-name {
    color: #495057;
    font-weight: 500;
}

#search-results .data-table .product-price {
    font-weight: 600;
    color: #28a745;
}

#search-results .data-table .stock-info {
    font-weight: 500;
}

#search-results .data-table .product-row.in-stock .stock-info {
    color: #28a745;
}

#search-results .data-table .product-row.out-of-stock .stock-info {
    color: #dc3545;
    font-style: italic;
}

/* Очищаем таблицу от лишних элементов */
#search-results .product-row::before,
#search-results .product-row::after {
    display: none !important;
}

/* Простые стили для строк таблицы */
#search-results .product-row {
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    position: relative !important;
}

#search-results .product-row:hover {
    background: #e8f5e8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15) !important;
}

#search-results .product-row:active {
    transform: translateY(0) !important;
    background: #d4edda !important;
}

#search-results .product-row.adding-to-cart {
    background: #fff3cd !important;
    pointer-events: none !important;
    opacity: 0.7 !important;
}

#search-results .product-row.added-to-cart {
    background: #d1ecf1 !important;
    animation: successPulse 0.6s ease-in-out !important;
}

/* Индикатор загрузки */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6c757d;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

/* Сообщения об ошибках */
.error-message {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 15px;
}

/* Сообщения корзины */
.cart-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cart-message-success {
    background-color: #28a745;
}

.cart-message-error {
    background-color: #dc3545;
}

.cart-message-warning {
    background-color: #ffc107;
    color: #212529;
}

.cart-message-info {
    background-color: #17a2b8;
}

/* Улучшенные hover-эффекты для строк товаров */
/* Отключено для чистого вида таблицы */

/* Улучшенные стили для поля поиска */
.search-input-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

#productSearchModal .search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

#productSearchModal .search-form input {
    flex: 1;
    transition: all 0.2s ease;
    border: 2px solid #ced4da;
    padding: 12px 45px 12px 12px;
    border-radius: 4px;
    font-size: 14px;
}

#productSearchModal .search-form input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

#customerModal .search-form input {
    flex: 1;
    transition: all 0.2s ease;
    border: 2px solid #ced4da;
    padding: 12px 45px 12px 12px;
    border-radius: 4px;
    font-size: 14px;
}

#customerModal .search-form input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    font-size: 16px;
    color: #64748b !important;
    cursor: pointer;
    width: 24px !important;
    height: 24px !important;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    transition: all 0.2s ease;
    z-index: 5;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

.clear-search-btn:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-50%) scale(1.05);
}

.clear-search-btn:active {
    background: #cbd5e1 !important;
    transform: translateY(-50%) scale(0.95);
}

.add-customer-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.add-customer-btn:hover {
    background: #218838;
}

#productSearchModal .search-form button:not(.clear-search-btn) {
    transition: all 0.2s ease;
    transform: translateY(0);
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

#productSearchModal .search-form button:not(.clear-search-btn):hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
}

#productSearchModal .search-form button:not(.clear-search-btn):active {
    transform: translateY(0);
}

/* Специальные стили для модального окна поиска товаров */
#productSearchModal .modal-content {
    max-width: 1100px;
    width: 98%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#productSearchModal .search-form {
    flex-shrink: 0;
    margin-bottom: 15px;
}

#productSearchModal #search-results {
    flex: 1;
    min-height: 0;
    margin-top: 0;
    overflow-x: auto;
    overflow-y: auto;
    padding: 0;
}

/* Форма оформления заказа */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.total-checkout {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    border: 1px solid #dee2e6;
}

.form-actions,
.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-actions button,
.modal-actions button {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.form-actions button:hover,
.modal-actions button:hover {
    background: #2980b9;
}

.form-actions button[type="button"],
.modal-actions button[type="button"] {
    background: #6c757d;
}

.form-actions button[type="button"]:hover,
.modal-actions button[type="button"]:hover {
    background: #5a6268;
}

/* Сообщения об ошибках */
.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin: 12px 0;
    font-weight: 500;
}

/* Стили для деталей товаров */
.product-details {
    max-height: 400px;
    overflow-y: auto;
}

/* Стили для вкладок в модальном окне клиентов */
.customer-tab {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    color: #6c757d;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    margin-right: 4px;
    border-radius: 4px 4px 0 0;
}

.customer-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.customer-tab.active-tab {
    background: white;
    color: #495057;
    font-weight: 500;
    border-color: #dee2e6;
    position: relative;
    z-index: 1;
    margin-bottom: -1px;
}

.customer-tab-content {
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.customer-tab-content .search-form,
.customer-tab-content .search-hint {
    flex-shrink: 0;
}

.customer-tab-content #customer-search-results {
    flex: 1;
    min-height: 0;
}

.product-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    font-size: 13px;
}

.info-item strong {
    color: #495057;
    display: block;
    margin-bottom: 4px;
}

.description {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #28a745;
}

.cross-codes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.cross-code {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid #ced4da;
    font-weight: 500;
}

.info-section h3 {
    margin-bottom: 12px;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 6px;
    font-weight: 600;
    font-size: 16px;
}

.mini-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

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

.mini-table th {
    background: #495057;
    color: white;
    font-weight: 600;
    font-size: 13px;
}

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

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .cart-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
        margin: -20px -20px 0 -20px;
    }

    .carts-sidebar {
        max-height: 250px;
        margin-bottom: 0;
    }

    .cart-content {
        padding: 15px;
    }

    .cart-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .customer-info-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .current-customer-btn {
        min-width: 100%;
        text-align: center;
    }

    .cart-actions {
        justify-content: center;
    }

    .data-table {
        font-size: 11px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 4px;
    }

    .quantity-input,
    .price-input,
    .discount-input {
        width: 50px;
        font-size: 11px;
    }

    .modal-content {
        margin: 10% auto;
        padding: 15px;
        width: 95%;
    }

    .product-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Стили для функционала заказа запчастей */
.order-part-btn {
    background: #ff9500;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    margin-right: 8px;
    cursor: pointer;
    font-size: 11px;
    transition: background-color 0.2s;
}

.order-part-btn:hover {
    background: #e6850e;
}

.cart-order-actions {
    margin-top: 15px;
    text-align: center;
    padding: 15px;
    border-top: 1px solid #ddd;
}

.add-order-part-btn {
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.add-order-part-btn:hover {
    background: #138496;
}

/* Стили для таблицы заказанных запчастей */
.ordered-parts-table {
    margin-top: 20px;
}

.ordered-parts-table .column-status span {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-new {
    background-color: #6c757d;
    color: white;
}

.status-ordered {
    background-color: #ffc107;
    color: #212529;
}

.status-received {
    background-color: #17a2b8;
    color: white;
}

.status-delivered {
    background-color: #28a745;
    color: white;
}

.status-cancelled {
    background-color: #dc3545;
    color: white;
}

.remove-ordered-part-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.remove-ordered-part-btn:hover {
    background: #c82333;
}

/* Стили для модального окна заказа запчастей */
.large-modal {
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 5px 5px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-body label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box;
}

.modal-body textarea {
    resize: vertical;
}

.modal-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 5px 5px;
    text-align: right;
    flex-shrink: 0;
}

.modal-footer button {
    margin-left: 10px;
    padding: 8px 15px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.modal-footer .save-btn {
    background: #007cba;
    color: white;
}

.modal-footer .save-btn:hover {
    background: #0056b3;
}

.modal-footer .cancel-btn {
    background: #6c757d;
    color: white;
}

.modal-footer .cancel-btn:hover {
    background: #545b62;
}

/* Скроллбар */
.carts-sidebar::-webkit-scrollbar,
.product-details::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.carts-sidebar::-webkit-scrollbar-track,
.product-details::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.carts-sidebar::-webkit-scrollbar-thumb,
.product-details::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.carts-sidebar::-webkit-scrollbar-thumb:hover,
.product-details::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Product search dropdown for ordered parts */
.product-search-wrapper {
    position: relative;
}

.search-results-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.search-results-dropdown .search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.15s ease;
}

.search-results-dropdown .search-result-item:hover {
    background-color: #e3f2fd;
}

.search-results-dropdown .search-result-item:last-child {
    border-bottom: none;
}

.search-results-dropdown .result-article {
    font-weight: 600;
    color: #007bff;
    font-size: 13px;
}

.search-results-dropdown .result-name {
    color: #333;
    font-size: 13px;
    margin-top: 2px;
}

.search-results-dropdown .result-brand {
    color: #6c757d;
    font-size: 12px;
    margin-top: 2px;
}

.search-results-dropdown .search-no-results {
    padding: 12px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}