/* commerce.css — orders / admin order cards / checkout + cart page (S12.1/S12.3/S12.4).
   Loaded by account.html + checkout.html + admin.html. Requires base.css. */
/* ==================== Orders (S12.1) ==================== */
.admin-order-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.admin-order-status.is-completed { background: rgba(91, 168, 90, 0.15); color: #4d9b4d; }
.admin-order-status.is-processing { background: rgba(80, 178, 192, 0.15); color: #2d8e9c; }
.admin-order-status.is-pending { background: rgba(250, 170, 141, 0.18); color: #c25e3c; }
.admin-order-status.is-cancelled { background: rgba(142, 133, 136, 0.15); color: #4A4548; }

.admin-enrollment-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid;
}

.admin-enrollment-status.is-enrolled { background: rgba(91, 168, 90, 0.12); color: #4d9b4d; border-color: rgba(91, 168, 90, 0.3); }
.admin-enrollment-status.is-in-progress { background: rgba(255, 64, 0, 0.12); color: #FF4000; border-color: rgba(255, 64, 0, 0.3); }
.admin-enrollment-status.is-completed { background: rgba(80, 178, 192, 0.12); color: #2d8e9c; border-color: rgba(80, 178, 192, 0.3); }
.admin-enrollment-status.is-not-enrolled { background: rgba(142, 133, 136, 0.1); color: #4A4548; border-color: rgba(142, 133, 136, 0.25); }
.admin-enrollment-status.is-na { background: transparent; color: #8E8588; border-color: transparent; }

.admin-order-products {
  font-size: 12px;
  color: #4A4548;
  max-width: 220px;
}

.admin-order-products .product-line {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== Admin Order Cards (S12.3 — thay table) ==================== */
.admin-orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-order-card {
  background: #FFFFFF;
  border: 1px solid #F8DBC0;
  border-radius: 18px;
  padding: 16px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-order-card:hover {
  border-color: #F2C5A5;
  box-shadow: 0 8px 18px -10px rgba(250, 170, 141, 0.4);
}

.admin-order-card .order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #F8DBC0;
  padding-bottom: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.admin-order-card .order-id-block {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-order-card .order-id {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px;
  font-weight: 600;
  background: #FCE0CE;
  color: #4A4548;
  padding: 3px 9px;
  border-radius: 8px;
}

.admin-order-card .order-date {
  font-size: 12px;
  color: #8E8588;
}

.admin-order-card .order-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .admin-order-card .order-body { grid-template-columns: 1fr; gap: 10px; }
}

.admin-order-card .order-customer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.admin-order-card .order-customer-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 64, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.admin-order-card .order-customer-info { min-width: 0; }

.admin-order-card .order-customer-info .name {
  font-weight: 600;
  font-size: 14px;
  color: #201E1F;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-order-card .order-customer-info .email {
  font-size: 12px;
  color: #8E8588;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-order-card .order-products-block {
  font-size: 13px;
  color: #4A4548;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.admin-order-card .order-products-block .icon {
  flex-shrink: 0;
  font-size: 16px;
  margin-top: 1px;
}

.admin-order-card .order-products-block .lines { min-width: 0; flex: 1; }

.admin-order-card .order-products-block .product-line {
  display: block;
  font-weight: 500;
  color: #201E1F;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-order-card .order-products-block .product-line:last-child { margin-bottom: 0; }

.admin-order-card .order-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid #F8DBC0;
  flex-wrap: wrap;
}

.admin-order-card .order-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.admin-order-card .order-total {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: #FF4000;
  letter-spacing: -0.01em;
}

.admin-order-card .order-payment {
  font-size: 12px;
  color: #8E8588;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-order-card .order-enrollment-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #8E8588;
}

@media (max-width: 480px) {
  .admin-order-card .order-footer { flex-direction: column; align-items: stretch; }
  .admin-order-card .order-footer .admin-action-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-order-card { transition: none !important; }
}


/* ==================== Checkout page (S12.4) ==================== */
.cart-item {
  display: grid;
  grid-template-columns: 48px 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #F8DBC0;
}

.cart-item:last-child { border-bottom: 0; padding-bottom: 0; }
.cart-item:first-child { padding-top: 0; }

.cart-item-emoji {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 64, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.cart-item-info {
  min-width: 0;
}

.cart-item-name {
  font-weight: 600;
  font-size: 14px;
  color: #201E1F;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-meta {
  font-size: 12px;
  color: #8E8588;
}

.cart-item-qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #F2C5A5;
  border-radius: 999px;
  padding: 2px;
  background: #FFFFFF;
}

.cart-item-qty .qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #4A4548;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
}

.cart-item-qty .qty-btn:hover {
  background: rgba(255, 64, 0, 0.1);
  color: #FF4000;
}

.cart-item-qty .qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: #201E1F;
  font-variant-numeric: tabular-nums;
}

.cart-item-total {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #FF4000;
  text-align: right;
  min-width: 90px;
}

.cart-item-remove {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #8E8588;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cart-item-remove:hover {
  background: rgba(255, 64, 0, 0.1);
  color: #FF4000;
}

@media (max-width: 640px) {
  .cart-item {
    grid-template-columns: 48px 1fr;
    grid-template-areas:
      "emoji info"
      "qty total"
      "remove remove";
    gap: 8px 14px;
  }
  .cart-item-emoji { grid-area: emoji; }
  .cart-item-info { grid-area: info; }
  .cart-item-qty { grid-area: qty; justify-self: start; }
  .cart-item-total { grid-area: total; justify-self: end; }
  .cart-item-remove { grid-area: remove; justify-self: end; }
}

/* Payment method cards */
.payment-method-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid #F2C5A5;
  border-radius: 16px;
  cursor: pointer;
  background: #FFFFFF;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.payment-method-card:hover {
  border-color: #FAAA8D;
  background: #FEEFDD;
}

.payment-method-card.is-active {
  border-color: #FF4000;
  background: rgba(255, 64, 0, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 64, 0, 0.12);
}

.payment-method-card input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #F2C5A5;
  border-radius: 999px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  margin: 0;
}

.payment-method-card input[type="radio"]:checked {
  border-color: #FF4000;
}

.payment-method-card input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: #FF4000;
}

.payment-method-card .pm-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 64, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.payment-method-card .pm-info {
  flex: 1;
  min-width: 0;
}

.payment-method-card .pm-name {
  font-weight: 700;
  font-size: 14px;
  color: #201E1F;
  margin-bottom: 2px;
}

.payment-method-card .pm-desc {
  font-size: 12px;
  color: #8E8588;
  line-height: 1.4;
}

/* QR payment block */
.qr-payment-block {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #FFFFFF;
  border: 1px solid #F2C5A5;
  border-radius: 16px;
  align-items: flex-start;
}

.qr-image-wrap {
  width: 140px;
  height: 140px;
  border: 1px solid #F8DBC0;
  border-radius: 12px;
  padding: 8px;
  background: #FFFFFF;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.qr-bank-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.qr-bank-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qr-bank-label {
  font-size: 11px;
  color: #8E8588;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.qr-bank-value {
  font-weight: 600;
  color: #201E1F;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

/* Số tiền + Nội dung CK: nhấn mạnh để user dễ nhập tay khi app không tự tạo giao dịch */
.qr-bank-row--highlight {
  padding: 6px 10px;
  background: rgba(255, 64, 0, 0.06);
  border: 1px solid rgba(255, 64, 0, 0.22);
  border-radius: 8px;
}

.qr-bank-value--amount {
  color: #FF4000;
  font-size: 15px;
}

@media (max-width: 480px) {
  .qr-payment-block {
    flex-direction: column;
    align-items: center;
  }
  .qr-bank-info { width: 100%; }
}

/* Admin: Payment methods config (S12.4) */
.admin-payment-method-config {
  border: 1px solid #F8DBC0;
  border-radius: 16px;
  padding: 16px;
  background: #FFFFFF;
  margin-bottom: 14px;
}

.admin-payment-method-config .pm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.admin-payment-method-config .pm-name-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-payment-method-config .pm-icon-large {
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 64, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .payment-method-card,
  .cart-item-remove,
  .cart-item-qty .qty-btn {
    transition: none !important;
  }
}

