/* Основные стили */
.scanning-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Список штрих-кодов */
.barcode-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.barcode-item {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.barcode-item:last-child {
    border-bottom: none;
}

/* Карточки статуса */
.status-card {
    margin-bottom: 20px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Адаптивность */
@media (max-width: 576px) {
    .btn-lg {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .input-group {
        flex-direction: column;
        width: auto;
    }
    
    .input-group .form-control {
        border-radius: 0.25rem !important;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .input-group .btn {
        border-radius: 0.25rem !important;
        width: 100%;
    }
}
/* Стили для модальных окон */
.modal-header.bg-warning {
    background-color: #ffc107;
    color: #000;
}

/* Анимация для кнопок в модальных окнах */
.modal-footer .btn {
    transition: all 0.3s ease;
}

.modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Адаптация модальных окон для мобильных */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem auto;
    }
}
.autocomplete-items {
        position: absolute;
        border: 1px solid #ddd;
        border-top: none;
        z-index: 99;
        width: calc(100% - 30px);
        max-height: 200px;
        overflow-y: auto;
    }
    .autocomplete-item {
        padding: 8px 12px;
        cursor: pointer;
        background: white;
    }
    .autocomplete-item:hover {
        background: #f5f5f5;
    }
    .autocomplete-active {
        background: #007bff !important;
        color: white;
    }
    
    .barcode-item {
        padding: 8px 12px;
        margin-bottom: 5px;
        background-color: #f8f9fa;
        border-radius: 4px;
        border-left: 3px solid #0d6efd;
    }
    
    .barcode-item button {
        padding: 0 5px;
        margin-left: 10px;
    }
.invalid-barcode {
    text-decoration: line-through;
    color: #dc3545;
    opacity: 0.7;
}

.work-orders-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.work-order {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
}

/* Add these styles for supply containers */
#supply-available,
#supply-unavailable,
#supply-picked {
    max-height: 100px;  /* Adjust the max-height value as needed */
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}
#picking-route {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 8px; /* Optional: for scrollbar spacing */
}
 @media (max-width: 576px) {
        .accordion .accordion-body, .table {
            font-size: 0.95rem;
            padding: 0.25rem;
        }
        .table-responsive {
            overflow-x: auto;
        }
        .card, .card-header, .card-body {
            border-radius: 0.7rem !important;
        }
        .input-group .form-control {
            font-size: 1.1rem;
        }
        .btn {
            font-size: 1rem;
            padding: 0.5rem 0.75rem;
        }
    }
    /* Для горизонтального скролла таблиц */
    .table-responsive {
        overflow-x: auto;
    }

.status-code-large {
    font-size: 2.2rem;
    font-weight: bold;
    color: #0d6efd;
    letter-spacing: 0.04em;
    display: inline-block;
    margin: 0 0.2em;
    vertical-align: middle;
}
@media (max-width: 576px) {
    .status-code-large {
        font-size: 1.3rem;
    }
}

.status-expected-large {
    font-size: 1.3em;
    font-weight: bold;
    color: #007bff;
}

#batch-sticker-preview-content {
    max-height: 70vh;
    overflow-y: auto;
}

/* Стили для карточек стикеров в модальном окне */
.sticker-card {
    border: 1px solid #ccc;
    padding: 15px;
    margin: 10px;
    border-radius: 8px;
    background: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sticker-card h6 {
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.sticker-card code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.sticker-card img {
    max-width: 200px;
    max-height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Адаптивность для модального окна со стикерами */
@media (max-width: 768px) {
    .sticker-card {
        margin: 5px;
        padding: 10px;
    }
    
    .sticker-card img {
        max-width: 150px;
        max-height: 150px;
    }
    
    #batch-sticker-preview-content {
        max-height: 60vh;
    }
}

/* Стили для валидации полей ввода */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

/* Стили для подсказок по формату ввода */
.form-text {
    font-size: 0.875em;
    color: #6c757d;
}

/* Стили для полей с масками ввода */
.input-mask {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Стили для полей с автоматическим форматированием */
.form-control[data-mask] {
    text-transform: uppercase;
}

/* Стили для полей штрихкодов */
.form-control[pattern*="\\d{13}"] {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    letter-spacing: 1px;
}

/* Стили для полей паллет и коробок */
.form-control[pattern*="[A-Z]"] {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
}

/* Анимация для неверного ввода */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-control.is-invalid {
    animation: shake 0.5s ease-in-out;
}

/* Стили для мобильных устройств */
@media (max-width: 576px) {
    .form-control[pattern*="\\d{13}"] {
        font-size: 1em;
        letter-spacing: 0.5px;
    }
    
    .form-control[pattern*="[A-Z]"] {
        font-size: 1em;
    }
    
    .invalid-feedback {
        font-size: 0.8em;
    }
}

/* Стили для сводки по штрихкодам */
.barcode-summary {
    max-height: 400px;
    overflow-y: auto;
}

.barcode-summary-item {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.barcode-summary-item:hover {
    background-color: #e9ecef;
}

.barcode-summary-item .badge {
    font-size: 0.8em;
    min-width: 24px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .d-flex.gap-4 {
        flex-direction: column;
    }
    
    .flex-grow-1 {
        flex-grow: 0 !important;
    }
}

/* --- Адаптивные стили для фото товара на приемке --- */
#product-photo-block {
  max-width: 100vw;
  text-align: center;
  margin-bottom: 1em;
}
#product-photo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid #ccc;
  border-radius: 8px;
  transition: all 0.3s ease;
  max-width: 100vw;
  max-height: 30vw;
}
#product-photo.photo-expanded {
  width: 300px;
  height: 300px;
  max-width: 90vw;
  max-height: 80vh;
}
@media (max-width: 600px) {
  #product-photo {
    width: 60vw;
    height: 60vw;
    max-width: 90vw;
    max-height: 40vw;
  }
  #product-photo.photo-expanded {
    width: 90vw;
    height: auto;
    max-width: 90vw;
    max-height: 80vh;
  }
  .scanning-container .mb-3.d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

/* --- Оверлей для полноэкранного фото товара --- */
#photo-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
#photo-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
#photo-overlay-close {
  position: absolute;
  top: 24px;
  right: 36px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  z-index: 2010;
  user-select: none;
  transition: color 0.2s;
}
#photo-overlay-close:hover {
  color: #ff5252;
}
@media (max-width: 600px) {
  #photo-overlay img {
    max-width: 98vw;
    max-height: 70vh;
  }
  #photo-overlay-close {
    top: 12px;
    right: 16px;
    font-size: 2rem;
  }
}

/* --- Адаптивная пагинация для мобильных --- */
@media (max-width: 600px) {
  .pagination {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin-bottom: 8px;
    font-size: 1.1em;
  }
  .pagination .page-item {
    min-width: 42px;
    margin-right: 2px;
  }
  .pagination .page-link {
    padding: 0.5rem 0.7rem;
    font-size: 1.1em;
    border-radius: 0.5rem;
    min-width: 38px;
    text-align: center;
  }
  .pagination .page-item.active .page-link {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
  }
  .pagination .page-item.disabled .page-link {
    color: #aaa;
    background: #f8f9fa;
  }
  nav[aria-label] {
    width: 100vw;
    max-width: 100vw;
    overflow-x: auto;
  }
}