/* Slide-over tạo đơn hàng */
.zl-order-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.38);
}
.zl-order-overlay[hidden] { display: none !important; }

.zl-order-drawer {
  width: min(480px, 100vw);
  height: 100%;
  max-height: 100dvh;
  background: #fff;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  animation: zl-order-in 0.22s ease-out;
}
@keyframes zl-order-in {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.zl-order-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
}
.zl-order-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.zl-order-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.zl-order-close:hover { background: #e2e8f0; color: #0f172a; }

.zl-order-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 18px 20px;
}

.zl-order-sec {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.zl-order-sec:last-child { border-bottom: 0; margin-bottom: 0; }
.zl-order-sec h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  text-transform: none;
}
.zl-order-sec h3 span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e3f2fd;
  color: #1565c0;
  font-size: 11px;
  font-weight: 800;
}

.zl-order-channels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.zl-order-ch {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 10px 6px;
  border: 1.5px solid #c5d0dc;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.zl-order-ch:hover { border-color: #90caf9; background: #f8fbff; }
.zl-order-ch.is-active {
  border-color: #1565c0;
  background: #1565c0;
  color: #fff;
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.28);
}
.zl-order-ch[data-platform="zalo"].is-active {
  background: #0068ff;
  border-color: #0068ff;
}
.zl-order-ch[data-platform="offline"].is-active {
  background: #0f766e;
  border-color: #0f766e;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.28);
}

.zl-order-input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #c5d0dc;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: #0f172a;
}
.zl-order-input:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}
textarea.zl-order-input {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}
select.zl-order-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.zl-order-search { position: relative; }
.zl-order-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #c5d0dc;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.zl-order-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: #0f172a;
  cursor: pointer;
}
.zl-order-suggest button:last-child { border-bottom: 0; }
.zl-order-suggest button:hover { background: #e3f2fd; }
.zl-order-suggest button small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}

.zl-order-link {
  margin-top: 8px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #1565c0;
  cursor: pointer;
}
.zl-order-link.danger { color: #c62828; }
.zl-order-link:hover { text-decoration: underline; }

.zl-order-customer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #bbdefb;
  border-radius: 12px;
  background: #e3f2fd;
}
.zl-order-customer strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}
.zl-order-customer span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: #1565c0;
  font-weight: 600;
}
.zl-order-customer small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}

.zl-order-new-cust { margin-top: 10px; }
.zl-order-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.zl-order-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.zl-order-grid label.span2 { grid-column: 1 / -1; }

.zl-order-product {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.zl-order-product-main {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.zl-order-product-main strong { font-size: 13px; color: #0f172a; }
.zl-order-price { max-width: 160px; }
.zl-order-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c5d0dc;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.zl-order-qty button {
  width: 32px;
  height: 36px;
  border: 0;
  background: #f1f5f9;
  font-size: 16px;
  cursor: pointer;
  color: #334155;
}
.zl-order-qty input {
  width: 44px;
  height: 36px;
  border: 0;
  text-align: center;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}
.zl-order-line-total {
  font-size: 14px;
  color: #1565c0;
}

.zl-order-pay {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.zl-order-pay-btn {
  height: 40px;
  border: 1.5px solid #c5d0dc;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}
.zl-order-pay-btn.is-active {
  border-color: #1565c0;
  background: #e3f2fd;
  color: #1565c0;
}

.zl-order-foot {
  flex-shrink: 0;
  padding: 14px 18px 16px;
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
}
.zl-order-sums {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.zl-order-sums > div,
.zl-order-fee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #64748b;
}
.zl-order-sums strong { color: #0f172a; font-weight: 700; }
.zl-order-fee input {
  width: 120px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #c5d0dc;
  border-radius: 8px;
  text-align: right;
  font: inherit;
  font-size: 13px;
}
.zl-order-grand {
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
  font-size: 14px !important;
  font-weight: 800;
  color: #0f172a !important;
}
.zl-order-grand strong {
  font-size: 22px;
  color: #1565c0 !important;
  letter-spacing: -0.02em;
}

.zl-order-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
}
.zl-order-btn {
  height: 44px;
  border-radius: 12px;
  border: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.zl-order-btn.ghost {
  background: #e2e8f0;
  color: #334155;
}
.zl-order-btn.primary {
  background: #1565c0;
  color: #fff;
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.3);
}
.zl-order-btn.primary:disabled {
  opacity: 0.55;
  cursor: wait;
}
.zl-order-err {
  margin: 10px 0 0;
  font-size: 12px;
  color: #c62828;
  font-weight: 600;
}

@media (max-width: 560px) {
  .zl-order-drawer { width: 100vw; }
  .zl-order-channels { grid-template-columns: 1fr; }
  .zl-order-grid { grid-template-columns: 1fr; }
  .zl-order-pay { grid-template-columns: 1fr; }
}
