/* ==========================================================================
   POS TERMINAL & SCANNER WORKSPACE STYLES
   With Left Filter Card & Left Slide-Out Glassmorphic Cart Drawer
   ========================================================================== */

.pos-workspace {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 20px;
  min-height: calc(100vh - 190px);
}

@media (max-width: 900px) {
  .pos-workspace {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   DEDICATED DYNAMIC FILTER CARD (LEFT COLUMN)
   -------------------------------------------------------------------------- */
.pos-filter-card {
  background: var(--card-bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-card);
  padding: 18px 16px;
  box-shadow: var(--shadow-gold);
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: fit-content;
  position: sticky;
  top: 86px;
}

.pos-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding-bottom: 10px;
}

.pos-filter-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-burgundy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pos-filter-title svg {
  width: 16px;
  height: 16px;
  fill: var(--accent-gold);
}

.filter-reset-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.filter-reset-link:hover {
  color: var(--primary-burgundy);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.filter-select, .filter-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.filter-select:focus, .filter-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
  background: #FFF;
}

/* Active Filter Counter Pill */
.active-filter-badge {
  background: rgba(128, 0, 32, 0.1);
  color: var(--primary-burgundy);
  border-radius: var(--radius-capsule);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   MAIN POS DESK & SCANNER
   -------------------------------------------------------------------------- */
.pos-main-desk {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Scanner Header & Input Box */
.scanner-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid var(--accent-gold);
  border-radius: var(--radius-card);
  padding: 10px 18px;
  box-shadow: 0 4px 20px rgba(128, 0, 32, 0.08);
  position: relative;
  transition: all 0.3s ease;
}

.scanner-bar-container:focus-within {
  border-color: var(--primary-burgundy);
  box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.2), 0 8px 24px rgba(212, 175, 55, 0.25);
  background: #FFF;
}

.scanner-icon {
  width: 26px;
  height: 26px;
  fill: var(--primary-burgundy);
  flex-shrink: 0;
  animation: pulseScanner 2.5s infinite;
}

@keyframes pulseScanner {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

.scanner-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-burgundy);
  letter-spacing: 0.5px;
  outline: none;
}

.scanner-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.scanner-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #065F46;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-capsule);
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Floating / Desk Cart Open Button */
.open-cart-floating-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #800020 0%, #5e0017 100%);
  color: #FFF4E6;
  border: 1.5px solid var(--accent-gold);
  border-radius: var(--radius-card);
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(128, 0, 32, 0.28);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.25s var(--dock-curve);
  white-space: nowrap;
}

.open-cart-floating-btn:hover {
  background: linear-gradient(135deg, #5e0017 0%, #420010 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(128, 0, 32, 0.38), 0 0 12px rgba(212, 175, 55, 0.4);
}

/* POS Quick Items Grid */
.pos-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  padding-right: 4px;
}

.pos-item-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s var(--dock-curve);
  position: relative;
  overflow: hidden;
}

.pos-item-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold);
  background: #FFF;
  box-shadow: 0 10px 24px rgba(128, 0, 32, 0.12), 0 0 10px rgba(212, 175, 55, 0.3);
}

.pos-item-thumb {
  width: 100%;
  height: 110px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255, 244, 230, 0.6);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pos-item-thumb svg {
  width: 54px;
  height: 54px;
  fill: var(--accent-gold);
}

.pos-item-sku {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}

.pos-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 3px 0 6px 0;
  line-height: 1.3;
}

.pos-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.pos-item-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-burgundy);
  font-feature-settings: "tnum";
}

/* --------------------------------------------------------------------------
   LEFT SLIDE-OUT GLASSMORPHIC CART DRAWER (OFF-CANVAS SHEET)
   -------------------------------------------------------------------------- */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2400;
  display: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cart-drawer-overlay.active {
  display: block;
  opacity: 1;
}

.cart-slide-drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  height: calc(100vh - 36px);
  max-height: calc(100vh - 36px);
  width: min(460px, calc(100vw - 36px));
  background: rgba(255, 250, 243, 0.96);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1.5px solid var(--border-gold);
  border-radius: 26px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35), 0 0 30px rgba(212, 175, 55, 0.3);
  z-index: 2500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.cart-slide-drawer.open {
  transform: translateX(0);
}

.pos-cart-header {
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(128, 0, 32, 0.08) 0%, rgba(212, 175, 55, 0.08) 100%);
  border-bottom: 1px solid var(--border-gold);
  border-radius: 26px 26px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-close-drawer-btn {
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.4);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary-burgundy);
  font-weight: bold;
  font-size: 15px;
  transition: all 0.2s;
}

.cart-close-drawer-btn:hover {
  background: #800020;
  color: #FFF;
}

.pos-cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-card);
  padding: 10px 14px;
  transition: all 0.25s ease;
}

.cart-item-row:hover {
  border-color: var(--accent-gold);
  background: #FFF;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.cart-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.cart-item-sub {
  font-size: 10.5px;
  color: var(--text-secondary);
}

.cart-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-item-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-burgundy);
  font-feature-settings: "tnum";
}

.cart-remove-btn {
  background: rgba(128, 0, 32, 0.08);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--primary-burgundy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.cart-remove-btn:hover {
  background: #800020;
  color: #FFF;
}

/* Cart Summary & Checkout Slip Inside Drawer */
.pos-cart-summary {
  padding: 18px 22px;
  background: rgba(255, 244, 230, 0.85);
  border-top: 1.5px solid var(--border-gold);
  border-radius: 0 0 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.summary-line.total {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-burgundy);
  padding-top: 6px;
  border-top: 1px dashed var(--accent-gold);
}

/* --------------------------------------------------------------------------
   80MM THERMAL RECEIPT PRINTING STYLES
   -------------------------------------------------------------------------- */
@media print {
  body {
    background: #FFF !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .dynamic-island, .dock-wrapper, .no-print, .cart-slide-drawer, .cart-drawer-overlay {
    display: none !important;
  }
  .thermal-receipt-page {
    width: 80mm !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    border: none !important;
  }
}

.thermal-receipt-page {
  width: 80mm;
  background: #FFF;
  color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Courier New", monospace;
  font-size: 11px;
  line-height: 1.35;
  padding: 12px 10px;
  margin: 20px auto;
  border: 1px solid #ddd;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed #000;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.receipt-shop-name {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  margin: 8px 0;
}

.receipt-details-table th, .receipt-details-table td {
  padding: 4px 2px;
}

.receipt-details-table th {
  border-bottom: 1px dashed #000;
  text-align: left;
}

.receipt-details-table td:last-child, .receipt-details-table th:last-child {
  text-align: right;
}

.receipt-summary-block {
  border-top: 1px dashed #000;
  padding-top: 6px;
  margin-top: 6px;
}

.receipt-qr-section {
  text-align: center;
  margin-top: 12px;
  border-top: 1px dashed #000;
  padding-top: 10px;
}

@media (max-width: 600px) {
  .cart-slide-drawer {
    top: 10px;
    right: 10px;
    bottom: 10px;
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    width: calc(100vw - 20px);
    border-radius: 20px;
    transform: translateX(calc(100% + 20px));
  }
  .pos-cart-header {
    border-radius: 20px 20px 0 0;
  }
  .pos-cart-summary {
    border-radius: 0 0 20px 20px;
  }
}
