/**
 * E-Sevai POS Ultra — touch, landscape, mode colors, hold/recent, aging
 * + compact pay rail (less scroll, reliable bank taps)
 */

/* Save success — visible but not a blocking popup */
.es-pos-save-flash {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 10px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #065f46, #059669);
  color: #fff;
  box-shadow: 0 14px 32px -12px rgba(5, 150, 105, 0.65);
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.es-pos-save-flash.is-show {
  transform: translateY(0);
  opacity: 1;
}
.es-pos-save-flash__ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 1000;
  flex-shrink: 0;
}
.es-pos-save-flash__txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.es-pos-save-flash__txt b {
  font-size: 14px;
  font-weight: 1000;
}
.es-pos-save-flash__txt span {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.esevai-mode #esPosSection.es-pos-desk.es-pos-world,
body.esevai-mode #esPosSection.es-pos-desk {
  position: relative;
}
.es-pos-header--saved {
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.55) !important;
}

/* ── Compact pay rail: all options kept, less vertical scroll ── */
body.esevai-mode #esPosSection.es-pos-desk .es-pos-checkout-panel,
body.esevai-mode #esPosSection.es-pos-desk .es-pos-right {
  position: relative !important;
  z-index: 4;
  background: var(--es-pro-bg, #e8edf3);
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  isolation: isolate;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-catalog-panel {
  position: relative;
  z-index: 1;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-pay-rail {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin-top: 6px;
  padding: 8px 8px 10px;
  gap: 8px !important;
  background: linear-gradient(180deg, rgba(232, 237, 243, 0.2) 0%, #fff 12%, #fff 100%);
  border: 1px solid #d0d7e2;
  border-radius: 16px;
  box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, 0.35);
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-pay-rail__modes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 1100px) {
  body.esevai-mode #esPosSection.es-pos-desk .es-pos-pay-rail__modes {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-pay-block {
  padding: 8px !important;
  border-radius: 12px !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-pay-block__head {
  margin-bottom: 6px;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-pay-block__title {
  font-size: 12px !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-pay-block__sub {
  font-size: 9px !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-chip-grid {
  gap: 6px !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-totals-slim {
  padding: 8px 10px !important;
  margin-bottom: 6px !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-totals-slim__fees {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-totals-slim__fees b {
  color: #0f172a;
  font-weight: 900;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-checkout-hero {
  padding: 8px 12px !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-checkout-hero__amt {
  font-size: clamp(18px, 2.4vw, 24px) !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-customer-card {
  padding: 10px !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-cart-items,
body.esevai-mode #esPosSection.es-pos-desk .es-pos-cart-items--bill {
  max-height: none !important;
  min-height: 96px;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-exact-btn {
  min-height: 56px !important;
  border-radius: 12px !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-ultra-cash-chips {
  margin: 0 !important;
  gap: 5px !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-ultra-cash-chips button {
  min-height: 36px !important;
  padding: 6px 4px !important;
  font-size: 11px !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-wa-opt {
  margin: 2px 0 !important;
  font-size: 12px;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-hint-compact {
  padding: 6px 8px !important;
  font-size: 11px !important;
  margin: 0 !important;
}

/* Gov chips: high stacking so catalog never steals taps */
body.esevai-mode #esPosSection.es-pos-desk #esPosGovChips,
body.esevai-mode #esPosSection.es-pos-desk #esPosPayChips {
  position: relative;
  z-index: 6;
  touch-action: manipulation;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-chip {
  position: relative;
  z-index: 1;
  pointer-events: auto !important;
}

body.esevai-mode #esPosSection.es-pos-desk .es-pos-pay-block--gov.es-pos-gov-bank--required {
  animation: none !important;
  box-shadow: 0 0 0 2px #f59e0b;
}

@media (max-width: 768px) {
  body.esevai-mode #esPosSection.es-pos-desk .es-pos-pay-rail {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    margin-left: -2px;
    margin-right: -2px;
  }
  body.esevai-mode #esPosSection.es-pos-desk .es-ultra-tools {
    gap: 4px;
    margin-bottom: 4px;
  }
  body.esevai-mode #esPosSection.es-pos-desk .es-ultra-tools button {
    padding: 6px 8px;
    font-size: 10px;
  }
}

/* 19 Bigger touch targets — compact but still finger-friendly */
body.esevai-mode #esPosSection.es-pos-desk .es-pos-chip {
  min-height: 44px !important;
  font-size: 12px !important;
  padding: 6px 4px !important;
  border-radius: 12px !important;
}
body.esevai-mode #esPosSection.es-pos-desk .es-pos-save-btn {
  min-height: 54px !important;
  font-size: 17px !important;
}
body.esevai-mode #esPosSection.es-pos-desk .es-pos-svc-card {
  min-height: 72px;
  padding: 12px 14px !important;
}
body.esevai-mode #esPosSection.es-pos-desk .es-pos-fav-btn {
  min-height: 52px;
  min-width: 88px;
}

/* 21 Landscape desk polish */
@media (min-width: 1100px) and (orientation: landscape) {
  body.esevai-mode #esPosSection.es-pos-desk.active-section {
    height: calc(100dvh - 52px);
    max-height: calc(100dvh - 52px);
  }
  body.esevai-mode #esPosSection.es-pos-desk .es-pos-layout {
    grid-template-columns: minmax(0, 1.25fr) min(420px, 38vw) !important;
  }
  body.esevai-mode #esPosSection.es-pos-desk .es-pos-checkout-panel {
    position: sticky;
    top: 0;
  }
}

/* 14 Stronger Agent / Direct */
.es-ultra-mode-bar .es-pos-mode-btn {
  border-width: 2px !important;
  font-weight: 800 !important;
}
.es-ultra-mode-bar .es-pos-mode-btn.is-active {
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25) !important;
  transform: scale(1.02);
}
.es-ultra-mode-bar .es-pos-mode-btn--direct.is-active {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28) !important;
  background: #1d4ed8 !important;
  color: #fff !important;
  border-color: #1d4ed8 !important;
}
.es-ultra-mode-bar .es-pos-mode-btn.is-active:not(.es-pos-mode-btn--direct) {
  background: #0f766e !important;
  color: #fff !important;
  border-color: #0f766e !important;
}

/* Toolbar tools */
.es-ultra-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.es-ultra-tools button {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  color: #0f172a;
}
.es-ultra-tools button:hover {
  border-color: #0d9488;
  background: #f0fdfa;
}
.es-ultra-tools button.es-ultra-tools--credit {
  background: #fff7ed;
  border-color: #fb923c;
  color: #9a3412;
}

.es-pos-hold-strip,
.es-pos-recent-strip {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.es-ultra-hold-lbl,
.es-ultra-recent-lbl {
  font-size: 10px;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
}
.es-ultra-hold-chip,
.es-ultra-recent-chip {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.es-ultra-hold-chip {
  background: #fef3c7;
  border-color: #fcd34d;
}
.es-ultra-recent-chip b {
  display: block;
}
.es-ultra-due {
  font-style: normal;
  font-size: 10px;
  color: #c2410c;
  font-weight: 900;
}

.es-pos-fav-btn {
  position: relative;
}
.es-pos-fav-btn.is-pinned {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
}
.es-ultra-pin {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 12px;
  color: #d97706;
}
.es-ultra-code {
  font-size: 9px;
  font-weight: 900;
  color: #64748b;
  letter-spacing: 0.04em;
}

.es-ultra-cash-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 8px 0;
}
.es-ultra-cash-chips button {
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  border-radius: 10px;
  padding: 10px 4px;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
  color: #065f46;
  min-height: 44px;
}
.es-ultra-cash-chips button:active {
  transform: scale(0.97);
}

.es-pos-partial-hint {
  display: none;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  font-size: 12px;
  font-weight: 800;
  color: #9a3412;
}

.es-pos-undo-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  font-size: 12px;
  font-weight: 800;
  color: #065f46;
}
.es-pos-undo-bar button {
  border: none;
  background: #0f766e;
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 900;
  cursor: pointer;
}

.es-ultra-guide {
  text-align: left !important;
  padding: 16px !important;
}
.es-ultra-guide__title {
  font-weight: 1000;
  color: #0f766e;
  margin-bottom: 8px;
}
.es-ultra-guide ol {
  margin: 0 0 8px 18px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  line-height: 1.6;
}
.es-ultra-guide__hint {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
}

.es-pos-cart-line[data-swipe] {
  transition: transform 0.15s ease;
}

/* Modals shared */
.es-ultra-modal .modal,
#esPosCollectModal .modal,
#esPosZModal .modal,
#esPosAgingModal .modal {
  max-width: 520px;
  width: 94%;
  border-radius: 20px;
  padding: 22px;
}
.es-ultra-aging {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.es-ultra-aging th,
.es-ultra-aging td {
  padding: 8px 6px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}
.es-ultra-bucket {
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
}
.es-ultra-bucket--7p {
  background: #fef3c7;
  color: #92400e;
}
.es-ultra-bucket--15p {
  background: #ffedd5;
  color: #9a3412;
}
.es-ultra-bucket--30p {
  background: #fee2e2;
  color: #991b1b;
}
.es-ultra-z table {
  width: 100%;
  margin: 12px 0;
}
.es-ultra-z td {
  padding: 8px 4px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
}
.es-ultra-empty {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-weight: 800;
}

@media (max-width: 480px) {
  .es-ultra-cash-chips {
    grid-template-columns: repeat(2, 1fr);
  }
}
