/* POS Container Layout */
.pos-container {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 1rem;
  height: 100vh;
  padding: 1rem;
  background-color: #f8fafc;
  overflow: hidden;
  box-sizing: border-box;
}

/* Menu Section */
.pos-menu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  overflow: hidden;
  min-height: 0;
}

/* Categories Section */
.pos-categories {
  gap: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  padding: 0.5rem;
}

.pos-category-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  transition: all 0.2s;
}

.pos-category-btn:hover {
  background-color: #f1f5f9;
}

.pos-category-btn.active {
  background-color: rgb(37 99 235);
  color: white;
  border-color: rgb(37 99 235);
}

.pos-category-count {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

/* Search Bar */
.pos-search {
  position: relative;
  padding: 0 0.5rem;
}

.pos-search-input {
  width: 100%;
  padding: 0.75rem 3rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background-color: white;
}

.pos-search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.pos-search-icon.left {
  left: 1rem;
}

.pos-search-icon.right {
  right: 1rem;
  display: flex;
  align-items: center;
  font-size: 0.75rem;
}

/* Products Grid */
.pos-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1rem;
  overflow-y: auto;
  height: 100%;
}

.pos-product-card {
  display: flex;
  flex-direction: column;
  background-color: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease-in-out;
  cursor: pointer;
  min-width: 232px;
  max-width: 232px;
  min-height: 324px;
  max-height: 324px;
  margin: 0 auto;
}

.pos-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.pos-product-image {
  width: 100%;
  height: 150px;
  min-height: 150px;
  max-height: 150px;
  object-fit: contain;
  background-color: #f8fafc;
  padding: 0.5rem;
}

.pos-product-info {
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 80px;
  background-color: var(--bg-color);
}

.pos-product-info h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.5em;
}

.pos-product-info p {
  font-size: 0.875rem;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

/* Product Card SKU and Barcode Styles */
.pos-product-sku,
.pos-product-barcode {
  font-size: 0.75rem;
  color: var(--text-color);
  opacity: 0.8;
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Order Section */
.pos-order {
  background-color: white;
  border-radius: 0.75rem;
  height: 100%;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.pos-order-header {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.pos-order-items {
  overflow-y: auto;
  max-height: 250px;
  padding: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
  min-height: 0;
}

.pos-order-items::-webkit-scrollbar {
  width: 8px;
}

.pos-order-items::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.pos-order-items::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.pos-order-items::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

/* Scrollbar Visible Class */
.scrollbar-visible {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.scrollbar-visible::-webkit-scrollbar {
  width: 8px;
}

.scrollbar-visible::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.scrollbar-visible::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.scrollbar-visible::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

.pos-order-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-color);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.pos-order-item-image {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 0.375rem;
  overflow: hidden;
  background-color: #f8fafc;
  padding: 0.25rem;
}

.pos-order-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pos-order-item-info {
  flex: 1;
  min-width: 0;
  padding-right: 0.5rem;
}

.pos-order-item-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-order-item-info p {
  font-size: 0.75rem;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.pos-order-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #f8fafc;
  padding: 0.25rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
}

.pos-order-item-quantity button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background-color: transparent;
  color: var(--text-color);
  cursor: pointer;
  border-radius: 0.25rem;
  transition: all 0.2s ease-in-out;
}

.pos-order-item-quantity button:hover {
  background-color: var(--hover-color);
  color: var(--primary-color);
}

.pos-order-item-quantity button:active {
  transform: scale(0.95);
}

.pos-order-item-quantity button svg {
  width: 16px;
  height: 16px;
}

.pos-order-item-quantity span {
  min-width: 24px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-color);
}

/* Order Item SKU and Barcode Styles */
.pos-order-sku,
.pos-order-barcode {
  font-size: 0.75rem;
  color: var(--text-color);
  opacity: 0.8;
  margin-top: 0.25rem;
}

/* Order Summary */
.pos-order-summary {
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
  background-color: #f8fafc;
}

.pos-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.pos-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-top: 0.5rem;
  border-top: 2px solid #e2e8f0;
  font-weight: 600;
  font-size: 1rem;
}

/* Action Buttons */
.pos-action-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s;
}

.pos-action-btn.primary {
  background-color: rgb(37 99 235);
  color: white;
}

.pos-action-btn.primary:hover {
  background-color: #2563eb;
}

/* Loading Animation */
.product-loading .pos-product-card {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Loading Fade Animation */
.loading-fade {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Order Tabs */
.pos-order-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background-color: #fff;
}

.pos-order-tab {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #64748b;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pos-order-tab.active {
  color: rgb(37 99 235);
  border-bottom-color: rgb(37 99 235);
  font-weight: 500;
}

/* Tab Content */
.pos-tab-content {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.pos-tab-content.active {
  display: flex;
}

/* Order Details Form */
.pos-order-details {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.pos-order-details::-webkit-scrollbar {
  width: 8px;
}

.pos-order-details::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.pos-order-details::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.pos-order-details::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #1f2937;
}

.form-control {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: #fff;
  color: #1f2937;
}

.form-control:focus {
  border-color: rgb(37 99 235);
  outline: none;
  ring: 2px;
  ring-color: #93c5fd;
}

/* Switch Toggle */
.switch-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: rgb(37 99 235);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Time Picker */
.time-picker {
  display: flex;
  gap: 0.5rem;
}

.time-picker select {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background-color: #fff;
}

/* Price Input */
.price-input-group {
  position: relative;
}

.price-input-group input {
  padding-right: 3rem;
}

.price-input-group::after {
  content: "UZS";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.875rem;
}

/* Select2 Customization */
.select2-container {
  width: 100% !important;
}

.select2-container--default .select2-selection--single {
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  height: 38px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 38px;
  padding-left: 0.625rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .pos-container {
    grid-template-columns: 30% 70%;
    height: auto;
  }

  .pos-order {
    height: auto;
    min-height: 400px;
  }
}

@media (max-width: 640px) {
  .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .pos-category-btn {
    padding: 0.375rem 0.75rem;
  }
}

/* Pagination Styles */
.pos-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.pos-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.pos-pagination-btn:hover:not(:disabled) {
  background-color: var(--hover-color);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.pos-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pos-pagination-info {
  font-size: 0.875rem;
  color: var(--text-color);
}

/* Loading Animation */
.product-loading {
  position: relative;
  transition: opacity 0.3s ease-in-out;
}

.product-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.loading-fade {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
} 