/* =====================================================================
   Sale screen: the counter and the receipt.
   Left, the bill prints like a thermal receipt; right, the shelf of products.
   Scoped to body.lockscreen (the POS layout); markup and ids are untouched,
   so pos.js keeps working. px units: Bootstrap 3 sets html to 10px.
   ===================================================================== */
body.lockscreen { background: var(--counter); }
body.lockscreen .content { padding: 14px 16px 120px; }

/* top bar */
body.lockscreen .pos-header {
  padding: 8px 16px;
  background: var(--receipt);
  border-bottom: 1px solid var(--rule);
}
body.lockscreen .pos-header p { margin: 0; font-size: 14px; color: var(--ink-soft); }
body.lockscreen .pos-header p strong { color: var(--slate); font-weight: 600; }
body.lockscreen .pos-header .btn { min-width: 36px; height: 34px; border-radius: 10px !important; }
body.lockscreen .pos-header .btn.saas-voice,
body.lockscreen .pos-header .btn.saas-pos-qr { padding: 0 12px; }

/* the bill: white paper with the printer's dark edge on top */
body.lockscreen #add_pos_sell_form > .row > .col-md-12 > .row > div:first-child > .box {
  margin-bottom: 0 !important;
  border: 1px solid var(--rule);
  border-top: 5px solid var(--ink);
  border-radius: 6px 6px 16px 16px;
  background: #fff;
  box-shadow: 0 18px 30px -24px rgba(28, 27, 41, 0.45);
}
body.lockscreen #add_pos_sell_form .box-body { padding: 16px 18px 8px; }

/* customer and search: the search is the biggest thing on the bill */
body.lockscreen #search_product {
  height: 50px;
  font-size: 16px;
  font-weight: 500;
  border-color: var(--ink-soft);
}
body.lockscreen #search_product::placeholder { color: var(--slate); }
body.lockscreen #add_pos_sell_form .input-group-addon,
body.lockscreen #add_pos_sell_form .input-group-btn > .btn {
  height: 50px;
  min-width: 46px;
  border-color: var(--rule);
  background: var(--counter);
  color: var(--ink-soft);
}
body.lockscreen #add_pos_sell_form .select2-container .select2-selection--single { height: 50px !important; display: flex; align-items: center; }

/* bill lines */
body.lockscreen .pos_product_div { position: relative; min-height: 46vh; }
body.lockscreen #pos_table { border: 0; margin-bottom: 0; }
body.lockscreen #pos_table > thead > tr > th {
  padding: 8px 6px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: transparent;
  color: var(--slate);
  font-size: 12.5px;
  font-weight: 700;
  text-align: start;
}
body.lockscreen #pos_table > tbody > tr,
body.lockscreen #pos_table.table-striped > tbody > tr:nth-of-type(odd) { background: transparent; }
body.lockscreen #pos_table > tbody > tr > td { padding: 10px 6px; border: 0; border-bottom: 1px dashed var(--rule); vertical-align: middle; }
body.lockscreen #pos_table .text-link { color: var(--ink) !important; font-size: 14.5px; font-weight: 700; }
body.lockscreen #pos_table .pos_line_total_text,
body.lockscreen #pos_table .pos_unit_price_inc_tax { font-family: var(--font-receipt); font-weight: 700; color: var(--ink); }
body.lockscreen #pos_table .input-number { width: 156px; }
body.lockscreen #pos_table > thead .fa-times { font-size: 14px; color: var(--slate); }
body.lockscreen #pos_table .input-number .btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50% !important;
  background: var(--counter);
}
body.lockscreen #pos_table .input-number .pos_quantity {
  height: 36px;
  margin: 0 4px;
  padding: 0 2px;
  border: 0;
  border-radius: 8px !important;
  background: var(--counter);
  text-align: center;
  font-family: var(--font-receipt);
  font-weight: 700;
  font-size: 15px;
}
body.lockscreen #pos_table .pos_remove_row { font-size: 18px; color: var(--void) !important; }

/* empty bill */
.pos-empty-cart {
  position: absolute;
  inset: 58px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 24px;
  text-align: center;
  color: var(--slate);
  pointer-events: none;
}
.pos-empty-cart .fas { font-size: 54px; color: var(--rule); margin-bottom: 8px; }
.pos-empty-cart__title { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink-soft); }
.pos-empty-cart__hint { margin: 0; max-width: 42ch; font-size: 14px; }
.pos_product_div.has-items .pos-empty-cart { display: none; }

/* totals: the bottom of the receipt */
body.lockscreen .pos_form_totals { margin-top: 6px; padding-top: 6px; border-top: 2px dashed var(--rule); }
body.lockscreen .pos_form_totals .table,
body.lockscreen .pos_form_totals .table td { border: 0 !important; background: transparent; }
body.lockscreen .pos_form_totals .table td { padding: 6px 4px; color: var(--ink-soft); font-size: 14px; }
body.lockscreen .pos_form_totals .table td b { color: var(--ink); font-weight: 700; }
body.lockscreen .pos_form_totals .price_total,
body.lockscreen .pos_form_totals .total_quantity,
body.lockscreen .pos_form_totals #total_discount,
body.lockscreen .pos_form_totals #order_tax { font-family: var(--font-receipt); font-weight: 700; color: var(--ink); }

/* the shelf */
body.lockscreen #product_category_div .select2-selection,
body.lockscreen #product_brand_div .select2-selection { height: 42px !important; border-radius: 999px !important; display: flex; align-items: center; padding-inline: 8px; }
body.lockscreen #product_list_body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
}
body.lockscreen #product_list_body > .product_list { width: auto; float: none; padding: 0; }
body.lockscreen #product_list_body .product_box {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  text-align: start;
}
body.lockscreen #product_list_body .product_box:hover { border-color: var(--ink); transform: translateY(-1px); }
body.lockscreen #product_list_body .product_box .image-container { width: 100%; height: 86px; margin: 0; border-radius: 10px; background-color: var(--counter); }
.image-container--letter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 38px;
  font-weight: 800;
  color: rgba(28, 27, 41, 0.72);
}
/* six calm tints, chosen from the product name so an item keeps its colour */
.tile-hue-0 { background-color: #fde9b0 !important; }
.tile-hue-1 { background-color: #d9ecdf !important; }
.tile-hue-2 { background-color: #dde6f3 !important; }
.tile-hue-3 { background-color: #f6dcd6 !important; }
.tile-hue-4 { background-color: #e7e0f1 !important; }
.tile-hue-5 { background-color: #e3e9d5 !important; }
body.lockscreen #product_list_body .product_box .text_div { flex: 1; margin-top: 8px; }
body.lockscreen #product_list_body .product_box .text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  max-height: none;
  line-height: 1.35;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink) !important;
}
body.lockscreen #product_list_body .product_box .text_div small:last-child { font-size: 11.5px; color: var(--slate); }
.tile-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; margin-top: 8px; }
.tile-price { font-family: var(--font-receipt); font-size: 14px; font-weight: 700; color: var(--ink); }
.tile-stock { padding: 1px 7px; border-radius: 999px; background: var(--till-soft); color: var(--till); font-size: 11.5px; font-weight: 700; }
.tile-stock.is-low { background: var(--void-soft); color: var(--void); }

.pos-no-products {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 40px 20px;
  border: 2px dashed var(--rule);
  border-radius: 16px;
  text-align: center;
}
.pos-no-products > .fas { font-size: 46px; color: var(--ink-soft); }
.pos-no-products h4 { margin: 8px 0 0; font-size: 19px; font-weight: 800; color: var(--ink); }
.pos-no-products p { max-width: 40ch; margin: 0; color: var(--slate); }
.pos-no-products__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }

/* bottom bar: bigger buttons, the total reads first */
body.lockscreen .pos-form-actions { padding: 12px 16px; }
body.lockscreen .pos-form-actions .btn { height: 52px; padding: 0 18px; border-radius: 12px; font-size: 15px; }
body.lockscreen .pos-form-actions #pos-cancel,
body.lockscreen .pos-form-actions #pos-delete { height: 52px; font-size: 14px; }
body.lockscreen .pos-total.bg-navy { height: 56px; padding: 8px 20px; border-radius: 12px; display: inline-flex; align-items: center; }
body.lockscreen .pos-total span.number { font-size: 32px; }

@media (max-width: 991px) {
  body.lockscreen .content { padding: 10px 10px 140px; }
  body.lockscreen #product_list_body { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* the internet went: keep selling on the offline counter */
.pos-offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2000;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px;
  padding: 10px 16px; background: var(--tag); color: var(--ink); font-size: 15px; font-weight: 700;
  box-shadow: 0 6px 18px -10px rgba(28, 27, 41, 0.6);
}
.pos-offline-bar[hidden], .pos-offline-bar [hidden] { display: none !important; }
.pos-offline-bar .btn { background: var(--ink) !important; border-color: var(--ink) !important; color: var(--receipt) !important; font-weight: 700; }
