/* Hydra POS — custom quantity keypad (no native keyboard) */

.pos-qty-keypad-root {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal, 10000) + 80);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.pos-qty-keypad-root[hidden] {
  display: none !important;
}

.pos-qty-keypad-root.is-open {
  pointer-events: auto;
}

.pos-qty-keypad-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  transition: opacity 180ms ease;
}

.pos-qty-keypad-root.is-open .pos-qty-keypad-backdrop {
  opacity: 1;
}

.pos-qty-keypad-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--pos-qty-keypad-lift, 0px);
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -16px 48px rgba(15, 23, 42, 0.18);
  transform: translateY(105%);
  transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
  box-sizing: border-box;
  max-height: min(420px, calc(100dvh - var(--pos-qty-keypad-lift, 0px) - 12px));
  overflow: auto;
}

.pos-qty-keypad-root.is-open .pos-qty-keypad-sheet {
  transform: translateY(0);
}

.pos-qty-keypad-grab {
  width: 40px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: #cbd5e1;
}

.pos-qty-keypad-head {
  text-align: center;
  margin-bottom: 10px;
}

.pos-qty-keypad-product {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pos-qty-keypad-qty-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.pos-qty-keypad-qty-val {
  margin: 2px 0 0;
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #c2410c;
  line-height: 1.1;
}

.pos-qty-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.pos-qty-keypad-key {
  min-height: 48px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  padding: 0;
}

.pos-qty-keypad-key:active {
  background: #e2e8f0;
}

.pos-qty-keypad-key--muted {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}

.pos-qty-keypad-done {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
}

body.pos-qty-keypad-open {
  overflow: hidden;
}

/* Triggers — tap to open keypad (never native keyboard) */
#modal .pos-qty-keypad-trigger {
  border: none;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#modal .pos-prow .pos-qty-val.pos-qty-keypad-trigger {
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

#modal .pos-prow .pos-qty-val.pos-qty-keypad-trigger:focus-visible,
#modal .pos-cart-qty-stepper .oi-qty-display:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: -2px;
}

#modal .pos-cart-qty-stepper .oi-qty-display {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 6px;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  background: #fff;
}

#modal .pos-wizard-pane--confirm .pos-cart-qty-stepper .oi-qty-display {
  width: auto;
  min-width: 40px;
  max-width: 52px;
  height: 44px;
  min-height: 44px;
  font-size: 14px;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

#modal .pos-cart-qty-stepper .oi-qty-display {
  width: 2.35rem;
  min-height: 34px;
  font-size: 13px;
  font-weight: 700;
  padding: 0 2px;
}

#modal .pos-cart-row .oi-qty-col .oi-qty-display {
  width: 100%;
  min-height: 36px;
  text-align: center;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

@media (min-width: 901px) {
  .pos-qty-keypad-root {
    align-items: center;
    padding: 16px;
  }

  .pos-qty-keypad-sheet {
    max-width: 360px;
    border-radius: 18px;
    transform: translateY(12px) scale(0.96);
    opacity: 0;
    transition:
      transform 200ms ease,
      opacity 200ms ease;
  }

  .pos-qty-keypad-root.is-open .pos-qty-keypad-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .pos-qty-keypad-grab {
    display: none;
  }
}
