/* ===================================================================
   BATTLEFIELD HOBBIES POS - Custom Styles
   Supplements Tailwind CSS for POS-specific UI patterns
   =================================================================== */

/* ===================================================================
   SCROLLBAR STYLING
   Dark theme scrollbar for the product grid and cart
   =================================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
  background: #0f3460;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #e94560;
}

/* ===================================================================
   PRODUCT GRID
   Responsive grid for product catalogue tiles
   =================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* ===================================================================
   PRODUCT CARD
   Individual product tile with image and quick-add
   =================================================================== */
.product-card {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.product-card:hover {
  border-color: #e94560;
  transform: translateY(-1px);
}

.product-card:active {
  transform: scale(0.98);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  background: #1a1a2e;
}

/* ===================================================================
   CART PANEL
   Right-side cart with sticky header and scrollable items
   =================================================================== */
.cart-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #16213e;
  border-left: 1px solid #0f3460;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.cart-footer {
  border-top: 1px solid #0f3460;
  padding: 12px;
}

/* ===================================================================
   SYNC STATUS INDICATOR
   Coloured dot with status text
   =================================================================== */
.sync-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.sync-dot--online {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.sync-dot--offline {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.sync-dot--syncing {
  background: #3b82f6;
  animation: pulse 1.5s infinite;
}

.sync-dot--error {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===================================================================
   BADGE
   Small count indicator for pending orders etc.
   =================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.badge--pending {
  background: #f59e0b;
  color: #1a1a2e;
}

.badge--error {
  background: #ef4444;
  color: white;
}

/* ===================================================================
   LOADING / SKELETON
   Placeholder shimmer for loading states
   =================================================================== */
.skeleton {
  background: linear-gradient(90deg, #16213e 25%, #1a2744 50%, #16213e 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===================================================================
   INITIAL SYNC PROGRESS BAR
   =================================================================== */
.sync-progress {
  width: 100%;
  height: 6px;
  background: #0f3460;
  border-radius: 3px;
  overflow: hidden;
}

.sync-progress__bar {
  height: 100%;
  background: #e94560;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ===================================================================
   PRINT STYLES
   Hide everything except the receipt when printing
   =================================================================== */
@media print {
  body > *:not(#print-area) {
    display: none !important;
  }
}

/* ===================================================================
   TOUCH OPTIMISATION
   Larger tap targets for tablet use
   =================================================================== */
button, a, input, select {
  min-height: 44px;
}

input[type="search"],
input[type="text"],
input[type="number"],
input[type="password"] {
  font-size: 16px; /* Prevents iOS zoom on focus */
}
