Files
octopus/myproject/pos/static/pos/css/terminal.css
Andrey Smakotin 18cca326af feat(pos): улучшить адаптивность POS-терминала для мобильных устройств
- col-md-8/4 → col-12 col-md-8/4 для корректного отображения на мобильных
- Кнопки действий: height: 60px → min-height: 44px (минимальный размер для тапа)
- Модальные окна: добавлен modal-fullscreen-sm-down/md-down
- Колонки внутри модалок: добавлен col-12 для мобильной адаптивности
- Увеличена мелкая кнопка отмены скидки: 32px → 40px
- CSS: добавлены медиа-запросы для мобильных устройств
  * min-height: 44px для полей ввода и кнопок
  * font-size: 16px предотвращает зум на iOS
  * Оптимизация отступов в модалках
  * UX улучшения для тач-устройств
  * Плавная прокрутка на iOS
- Исправлено перекрытие товаров корзиной на мобильных (position: absolute → relative)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:21:05 +03:00

527 lines
10 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* POS Terminal Styles */
body {
background-color: #e9ecef;
}
/* Основной контейнер POS */
.pos-main-container {
position: fixed;
top: 56px; /* высота navbar */
left: 0;
right: 0;
bottom: 0;
background-color: white;
box-shadow: 0 0 20px rgba(0,0,0,0.1);
overflow: hidden;
}
.pos-container {
max-width: 100%;
padding: 1rem;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
}
/* Прокручиваемая область товаров */
.products-scrollable {
overflow-y: auto;
overflow-x: hidden;
flex-grow: 1;
}
/* Стили для корзины */
.cart-item {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.35rem 0;
border-bottom: 1px solid #e9ecef;
}
.item-name-price {
flex: 1;
min-width: 0;
}
.multiply-sign {
font-weight: bold;
color: #6c757d;
font-size: 0.9rem;
flex-shrink: 0;
}
.qty-input {
width: 50px;
padding: 0.25rem 0.5rem;
border: 1px solid #dee2e6;
border-radius: 4px;
text-align: center;
font-size: 0.9rem;
flex-shrink: 0;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.qty-input[type=number] {
-moz-appearance: textfield;
}
.item-total {
font-weight: 600;
font-size: 0.95rem;
color: #212529;
min-width: 60px;
text-align: right;
flex-shrink: 0;
}
.cart-item .btn-link {
font-size: 1.5rem;
line-height: 1;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-left: 0.25rem;
}
.cart-item .btn-link:hover {
background-color: #f8d7da;
border-radius: 4px;
}
.product-card {
cursor: pointer;
user-select: none;
transition: all 0.2s;
border-radius: 12px;
border: 1px solid #dee2e6;
background: white;
height: 100%;
min-height: 200px;
display: flex;
flex-direction: column;
}
.product-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.product-card.selected {
background: #e7f3ff;
border-color: #0d6efd;
}
.product-card .card-body {
padding: 0;
display: flex;
flex-direction: column;
height: 100%;
}
.product-image {
width: 100%;
aspect-ratio: 1 / 1;
object-fit: cover;
border-radius: 12px 12px 0 0;
background: #f8f9fa;
display: flex;
align-items: center;
justify-content: center;
color: #adb5bd;
font-size: 3rem;
flex-shrink: 0;
min-height: 150px;
}
.product-image img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 12px 12px 0 0;
}
.product-info {
padding: 0.75rem;
display: flex;
flex-direction: column;
gap: 0.25rem;
flex-grow: 1;
}
.product-name {
font-weight: 600;
font-size: 0.9rem;
line-height: 1.2;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
color: #212529;
}
.product-stock {
font-size: 0.8rem;
color: #6c757d;
font-style: italic;
}
.product-sku {
font-size: 0.75rem;
color: #adb5bd;
margin-top: auto;
display: flex;
justify-content: space-between;
align-items: center;
}
.product-price {
font-size: 0.85rem;
font-weight: 600;
color: #212529;
}
/* Карточки категорий */
.category-card {
cursor: pointer;
user-select: none;
transition: all 0.2s;
border-radius: 12px;
border: 2px solid #dee2e6;
background: white;
height: 100%;
min-height: 40px;
}
.category-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
border-color: #0d6efd;
}
.category-card.active {
background: #0d6efd;
border-color: #0d6efd;
color: white;
}
/* Специальный стиль для активной кнопки витрины */
.showcase-card.active {
background: #ff6600;
border-color: #ff6600;
border-width: 3px;
color: #000000;
font-weight: bold;
box-shadow: 0 6px 16px rgba(255, 102, 0, 0.6);
transform: scale(1.05);
}
.category-card .card-body {
padding: 0.5rem;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.category-name {
font-weight: 600;
font-size: 0.85rem;
}
/* Фиксация правой панели (корзина + кнопки) */
.right-panel-fixed {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 33.333%; /* 4/12 колонок */
overflow-y: auto;
padding: 1rem;
padding-right: 1.5rem;
z-index: 10;
display: flex;
flex-direction: column;
}
@media (max-width: 767.98px) {
.right-panel-fixed {
position: relative;
width: 100%;
top: auto;
right: auto;
bottom: auto;
left: auto;
padding: 0.75rem;
padding-right: 0.75rem;
z-index: auto;
}
/* На мобильных меняем layout контейнера */
.pos-container {
overflow-y: auto;
height: auto;
padding: 0.75rem;
}
/* Убираем fixed высоту из основного контейнера на мобильных */
.pos-main-container {
position: relative;
top: auto;
bottom: auto;
overflow-y: auto;
}
/* Левая колонка (товары) не должна быть flex */
.col-12.col-md-8[style*="flex-direction: column"] {
display: block !important;
height: auto !important;
}
}
/* Панель кнопок внутри фиксированного блока */
.action-buttons-panel {
margin-top: auto;
}
/* Стили для кнопок в панели действий */
.action-buttons-panel .btn {
font-size: 0.85rem;
font-weight: 700;
line-height: 1.1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 0.5rem;
}
/* Исключение для кнопки "Отложенный заказ" - разрешаем перенос */
.action-buttons-panel #scheduleLater {
white-space: normal;
}
/* Адаптивность для элементов корзины на маленьких экранах */
@media (max-width: 991.98px) {
.cart-item {
flex-wrap: wrap;
gap: 0.5rem;
}
.item-name-price {
width: 100%;
order: 1;
}
.multiply-sign {
display: none;
}
.cart-item > div:has(.d-flex.align-items-center) {
order: 2;
}
.item-total {
order: 3;
margin-left: auto;
}
.cart-item .btn-link {
order: 4;
}
}
/* Адаптивность для карточек товаров и витринных комплектов на маленьких экранах */
@media (max-width: 575.98px) {
/* Уменьшаем минимальную высоту карточки */
.product-card {
min-height: 160px;
}
/* Уменьшаем высоту изображения */
.product-image {
min-height: 100px;
font-size: 2rem;
}
/* Уменьшаем отступы в информационном блоке */
.product-info {
padding: 0.5rem;
gap: 0.2rem;
}
/* Уменьшаем размер названия товара */
.product-name {
font-size: 0.8rem;
-webkit-line-clamp: 2;
}
/* Уменьшаем размер информации об остатках */
.product-stock {
font-size: 0.7rem;
}
/* Уменьшаем размер артикула и цены */
.product-sku {
font-size: 0.7rem;
}
.product-price {
font-size: 0.8rem;
}
}
/* Стили для модального окна выбора единицы продажи */
.unit-selection-card {
border: 2px solid #dee2e6;
border-radius: 8px;
padding: 12px;
cursor: pointer;
transition: all 0.2s;
background: white;
}
.unit-selection-card:hover {
border-color: #0d6efd;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
transform: translateY(-1px);
}
.unit-selection-card.selected {
border-color: #0d6efd;
background: #e7f3ff;
box-shadow: 0 2px 12px rgba(13,110,253,0.3);
}
.unit-selection-card .unit-name {
font-weight: 600;
font-size: 1rem;
color: #212529;
margin-bottom: 4px;
}
.unit-selection-card .unit-price {
font-size: 1.1rem;
font-weight: 600;
color: #0d6efd;
margin-bottom: 4px;
}
.unit-selection-card .unit-availability {
font-size: 0.85rem;
color: #6c757d;
}
.unit-selection-card .unit-code {
font-size: 0.8rem;
color: #adb5bd;
}
.unit-selection-card .badge {
font-size: 0.75rem;
padding: 4px 8px;
}
/* Индикаторы наличия */
.stock-badge-good {
background-color: #d4edda;
color: #155724;
}
.stock-badge-low {
background-color: #fff3cd;
color: #856404;
}
.stock-badge-none {
background-color: #f8d7da;
color: #721c24;
}
/* ============================================================
АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
============================================================ */
/* Увеличение размера элементов управления на мобильных */
@media (max-width: 767.98px) {
/* Поля ввода - минимальный размер для тапа */
.form-control,
.form-select {
min-height: 44px;
font-size: 16px; /* Предотвращает зум на iOS при фокусе */
}
/* Кнопки - минимальный размер для тапа */
.btn {
min-height: 44px;
}
}
/* На десктопе возвращаем фиксированную высоту для кнопок действий */
@media (min-width: 768px) {
.action-buttons-panel .btn {
height: 60px;
}
}
/* Оптимизация модалок на мобильных */
@media (max-width: 767.98px) {
/* Уменьшаем отступы в модалках */
.modal-body {
padding: 1rem 0.75rem;
}
.modal-footer {
padding: 0.75rem;
}
/* Прокручиваемые списки */
#tempKitItemsList,
#unitSelectionList {
max-height: 150px !important;
}
}
/* Улучшение UX для тач-устройств */
@media (hover: none) and (pointer: coarse) {
/* Убираем hover-эффекты */
.product-card:hover,
.category-card:hover,
.unit-selection-card:hover {
transform: none;
}
/* Добавляем эффект нажатия */
.product-card:active,
.category-card:active,
.unit-selection-card:active {
transform: scale(0.98);
transition: transform 0.1s;
}
/* Подсветка при тапе */
.btn,
.cart-item .btn-link {
-webkit-tap-highlight-color: rgba(13, 110, 253, 0.2);
}
}
/* Плавная прокрутка на iOS */
.products-scrollable {
-webkit-overflow-scrolling: touch;
}