/* ==============================================================================
   HEOMI ONLINE ORDER MODAL — 3-STEP MULTI-ITEM CART
   Đồng bộ hoàn toàn với order_modal.js
   Mặc định Dark Mode Heomi sang trọng, hỗ trợ Light Mode qua html[data-theme="light"]
   ============================================================================== */

:root {
  --hom-primary: #ffc107;
  --hom-primary-dark: #d39e00;
  --hom-accent-blue: #0284c7;
  --hom-bg: #161a23;
  --hom-card-bg: #202634;
  --hom-card-inner: #1a1f2b;
  --hom-border: rgba(255, 255, 255, 0.12);
  --hom-text-main: #f8fafc;
  --hom-text-sub: #94a3b8;
  --hom-text-dim: #64748b;
  --hom-input-bg: #0f131a;
  --hom-highlight: #ffc107;
  --hom-radius: 18px;
  --hom-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85);
}

/* Light theme override khi bật Chế độ Sáng */
html[data-theme="light"],
body[data-theme="light"],
html.light,
body.light {
  --hom-bg: #ffffff;
  --hom-card-bg: #f8fafc;
  --hom-card-inner: #f1f5f9;
  --hom-border: #e2e8f0;
  --hom-text-main: #0f172a;
  --hom-text-sub: #475569;
  --hom-text-dim: #94a3b8;
  --hom-input-bg: #ffffff;
  --hom-highlight: #d97706;
  --hom-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Overlay / Backdrop Container */
.heomi-order-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-main, 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif);
  box-sizing: border-box;
}

.heomi-order-overlay *,
.heomi-order-overlay *::before,
.heomi-order-overlay *::after {
  box-sizing: border-box;
}

.heomi-order-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Darkened Backdrop */
.hom-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Modal Dialog Box */
.hom-dialog {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--hom-bg);
  color: var(--hom-text-main);
  border: 1px solid var(--hom-border);
  border-radius: var(--hom-radius);
  box-shadow: var(--hom-shadow);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.heomi-order-overlay.active .hom-dialog {
  transform: translateY(0) scale(1);
}

/* Close Button */
.hom-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--hom-text-dim);
  font-size: 1.8rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 25;
}

.hom-close-btn:hover {
  background: rgba(125, 125, 125, 0.15);
  color: var(--hom-text-main);
}

/* ════════ STEPPER INDICATOR ════════ */
.hom-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--hom-border);
  background: var(--hom-card-inner);
}

.hom-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  transition: opacity 0.2s;
  font-size: 0.85rem;
  font-weight: 600;
}

.hom-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(125, 125, 125, 0.2);
  color: var(--hom-text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.hom-step-txt {
  white-space: nowrap;
}

.hom-step-line {
  flex: 1;
  height: 2px;
  background: var(--hom-border);
  margin: 0 10px;
}

.hom-step-item.active {
  opacity: 1;
  color: var(--hom-primary);
}

.hom-step-item.active .hom-step-num {
  background: var(--hom-primary);
  color: #140900;
}

.hom-step-item.completed {
  opacity: 0.85;
  color: #10b981;
}

.hom-step-item.completed .hom-step-num {
  background: #10b981;
  color: #ffffff;
}

/* Content Container */
.hom-content {
  padding: 22px 26px 26px;
}

/* Header */
.hom-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 10px;
  flex-wrap: wrap;
}

.hom-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 193, 7, 0.16);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.35);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0;
  white-space: nowrap;
}

.hom-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--hom-text-main);
  margin: 0;
}

.hom-subtitle {
  display: none;
}

/* Quick Buy Button on Product Price Tags */
.btn-quick-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(255, 193, 7, 0.16);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.38);
  border-radius: 8px;
  width: 32px;
  height: 28px;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  position: relative;
  z-index: 10;
  overflow: hidden;
  text-decoration: none;
  line-height: 1;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.25s ease;
}

.btn-quick-buy i {
  font-size: 0.92rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-quick-buy .quick-buy-text {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 700;
  transition: max-width 0.25s ease, opacity 0.2s ease;
}

.btn-quick-buy:hover {
  width: 102px;
  margin-left: -70px;
  padding: 0 8px;
  background: #ffc107;
  color: #140900;
  border-color: #ffc107;
  box-shadow: 0 4px 14px rgba(255, 193, 7, 0.45);
}

.btn-quick-buy:hover i {
  transform: scale(1.08);
}

.btn-quick-buy:hover .quick-buy-text {
  max-width: 65px;
  opacity: 1;
  margin-left: 3px;
}

/* Quick View Box ở Step 1 */
.hom-quick-box {
  background: var(--hom-card-inner);
  border: 1px solid var(--hom-border);
  border-radius: 14px;
  padding: 16px;
}

.hom-quick-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--hom-border);
}

.hom-quick-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  padding: 4px;
  border: 1px solid var(--hom-border);
}

.hom-quick-info {
  flex: 1;
}

.hom-quick-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--hom-text-main);
  margin: 0 0 4px;
}

.hom-quick-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--hom-primary);
}

/* Picker Box */
.hom-picker-box {
  background: var(--hom-card-inner);
  border: 1px solid var(--hom-border);
  border-radius: 14px;
  padding: 14px;
}

/* Form Elements */
.hom-form-group {
  margin-bottom: 13px;
}

.hom-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--hom-text-main);
  margin-bottom: 6px;
}

.hom-req {
  color: #ef4444;
}

.hom-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--hom-input-bg);
  border: 1px solid var(--hom-border);
  border-radius: 10px;
  color: var(--hom-text-main);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hom-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

select.hom-input option {
  background-color: var(--hom-card-bg);
  color: var(--hom-text-main);
}

.hom-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Product Selector (Radio Cards) */
.hom-product-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hom-prod-card {
  position: relative;
  background: var(--hom-card-bg);
  border: 1.5px solid var(--hom-border);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  user-select: none;
}

.hom-prod-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hom-prod-info {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.hom-prod-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--hom-text-main);
  margin-bottom: 2px;
}

.hom-prod-price {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hom-highlight);
}

.hom-prod-card.active {
  border-color: #ffc107;
  background: rgba(255, 193, 7, 0.12);
  box-shadow: 0 0 0 1px #ffc107;
}

/* Quantity Control Stepper */
.hom-qty-control {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  background: var(--hom-input-bg);
  border: 1px solid var(--hom-border);
  border-radius: 10px;
  overflow: hidden;
}

.hom-qty-btn {
  background: transparent;
  border: none;
  width: 36px;
  height: 100%;
  color: var(--hom-text-main);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.hom-qty-btn:hover {
  background: rgba(125, 125, 125, 0.15);
}

.hom-qty-val {
  flex: 1;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--hom-text-main);
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
}

/* ════════ CART SECTION ════════ */
.hom-cart-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.hom-cart-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--hom-text-main);
}

.hom-cart-items-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.hom-cart-empty {
  text-align: center;
  padding: 24px 16px;
  background: var(--hom-card-inner);
  border: 1px dashed var(--hom-border);
  border-radius: 12px;
}

.hom-cart-row {
  background: var(--hom-card-bg);
  border: 1px solid var(--hom-border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hom-cart-row-info {
  flex: 1;
  min-width: 0;
}

.hom-cart-item-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--hom-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hom-cart-item-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--hom-text-sub);
  margin-top: 2px;
}

.hom-cart-row-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hom-cart-qty {
  width: 90px;
  height: 32px;
}

.hom-cart-qty .hom-qty-btn {
  width: 28px;
  font-size: 1rem;
}

.hom-cart-qty .hom-qty-val {
  font-size: 0.88rem;
}

.hom-cart-item-price {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--hom-highlight);
  min-width: 95px;
  text-align: right;
}

.hom-cart-remove {
  background: transparent;
  border: none;
  color: var(--hom-text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.15s;
}

.hom-cart-remove:hover {
  color: #ef4444;
}

/* Divider */
.hom-divider {
  height: 1px;
  background: var(--hom-border);
  margin: 16px 0;
}

/* Payment Options */
.hom-payment-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hom-pay-card {
  position: relative;
  background: var(--hom-card-bg);
  border: 1.5px solid var(--hom-border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: all 0.2s ease;
}

.hom-pay-card input[type="radio"] {
  margin-top: 4px;
}

.hom-pay-text strong {
  display: block;
  font-size: 0.9rem;
  color: var(--hom-text-main);
}

.hom-pay-text span {
  display: block;
  font-size: 0.78rem;
  color: var(--hom-text-sub);
  margin-top: 2px;
}

.hom-pay-card.active {
  border-color: #0284c7;
  background: rgba(2, 132, 199, 0.12);
  box-shadow: 0 0 0 1px #0284c7;
}

/* Summary Box */
.hom-summary {
  background: var(--hom-card-bg);
  border: 1px dashed var(--hom-border);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0 10px;
}

.hom-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--hom-text-sub);
  margin-bottom: 6px;
}

.hom-summary-row:last-child {
  margin-bottom: 0;
}

.hom-free-ship {
  color: #10b981;
  font-weight: 600;
}

.hom-sum-total {
  border-top: 1px solid var(--hom-border);
  padding-top: 8px;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--hom-text-main);
}

.hom-total-highlight {
  color: #ffc107;
  font-size: 1.25rem;
  font-weight: 800;
}

/* Error Message */
.hom-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 10px;
}

/* Navigation Buttons */
.hom-nav-btns {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  align-items: center;
}

/* Submit & Secondary Buttons */
.hom-submit-btn {
  padding: 13px 20px;
  background: linear-gradient(135deg, #ffc107, #d39e00);
  color: #181c24;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hom-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.45);
}

.hom-submit-btn.loading {
  opacity: 0.75;
  cursor: not-allowed;
}

.hom-btn-secondary {
  background: var(--hom-card-bg);
  color: var(--hom-text-main);
  border: 1px solid var(--hom-border);
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.hom-btn-secondary:hover {
  background: rgba(125, 125, 125, 0.15);
}

/* ════════ TAB 3 REVIEW ════════ */
.hom-review-card {
  background: var(--hom-card-inner);
  border: 1px solid var(--hom-border);
  border-radius: 12px;
  padding: 12px 16px;
}

.hom-review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hom-border);
  font-size: 0.88rem;
}

.hom-review-body {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--hom-text-sub);
}

.hom-review-body strong {
  color: var(--hom-text-main);
}

.hom-rev-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hom-rev-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.hom-rev-item-row:last-child {
  border-bottom: none;
}

/* ════════ SUCCESS SCREEN ════════ */
.hom-success-header {
  text-align: center;
  margin-bottom: 18px;
}

.hom-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid #10b981;
  color: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
}

.hom-success-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--hom-text-main);
  margin-bottom: 4px;
}

.hom-res-id {
  color: #ffc107;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
}

.hom-success-body {
  font-size: 0.92rem;
  color: var(--hom-text-sub);
  line-height: 1.6;
}

.hom-success-body strong {
  color: var(--hom-text-main);
}

/* VietQR Box */
.hom-qr-box {
  background: var(--hom-card-bg);
  border: 1px solid var(--hom-border);
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
  text-align: center;
}

.hom-qr-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--hom-text-main);
  margin-bottom: 12px;
}

.hom-qr-wrap {
  width: 210px;
  height: 210px;
  margin: 0 auto 12px;
  background: #ffffff;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hom-qr-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hom-qr-info {
  text-align: left;
  font-size: 0.85rem;
  background: var(--hom-input-bg);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--hom-border);
}

.hom-qr-info p {
  margin: 3px 0;
}

.hom-actions {
  margin-top: 18px;
  text-align: center;
}

/* Mobile responsive */
@media (max-width: 520px) {
  .hom-dialog {
    max-height: 94vh;
    border-radius: 14px;
  }
  .hom-content {
    padding: 16px 14px;
  }
  .hom-stepper {
    padding: 12px 14px;
  }
  .hom-step-txt {
    font-size: 0.78rem;
  }
  .hom-product-selector {
    grid-template-columns: 1fr;
  }
  .hom-grid-2 {
    grid-template-columns: 1fr;
  }
  .hom-cart-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .hom-cart-row-controls {
    justify-content: space-between;
  }
  .hom-nav-btns {
    flex-direction: column-reverse;
  }
  .hom-nav-btns button {
    width: 100%;
  }
}

/* ==============================================================================
   TẠM THỜI ẨN CÁC NÚT ĐẶT HÀNG (DO CHƯA HOÀN THIỆN)
   ============================================================================== */
.btn-order-modal,
.btn-quick-buy,
[data-order-modal],
[data-order-product] {
  display: none !important;
}

