/* ═══════════════════════════════════════════════════════════════
   HeavyMach E-Commerce Styles — assets/css/ecommerce.css
   Covers: cart, checkout, order tracking, invoice
═══════════════════════════════════════════════════════════════ */

/* ── Cart Badge ──────────────────────────────────────────────── */
.cart-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent, #B82B0D);
  color: #fff;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, transform .15s;
}
.cart-badge:hover { background: #96220a; transform: translateY(-1px); }
.cart-badge .count {
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
}

/* ── Page Layout ─────────────────────────────────────────────── */
.ecom-page { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.ecom-hero {
  background: linear-gradient(135deg, #0d1117 0%, #1a1f2e 100%);
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ecom-hero .container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.ecom-hero h1 { font-size: 1.8rem; color: #fff; margin: 0 0 .3rem; }
.ecom-hero p  { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin: 0; }

/* ── Glass Cards ─────────────────────────────────────────────── */
.ec-card {
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
.ec-card + .ec-card { margin-top: 1.25rem; }
.ec-card-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 0 0 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid #f0f0f0;
}

/* ── Checkout Step Navigation ────────────────────────────────── */
.checkout-steps {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.checkout-step {
  flex: 1;
  padding: .85rem 1rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #9ca3af;
  border-right: 1px solid rgba(0,0,0,0.06);
  position: relative;
  background: transparent;
  transition: all .2s;
}
.checkout-step:last-child { border-right: none; }
.checkout-step.active {
  background: #B82B0D;
  color: #fff;
}
.checkout-step.done {
  background: #f0fdf4;
  color: #16a34a;
}
.checkout-step .step-num {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

/* ── Two-column Checkout Layout ──────────────────────────────── */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .checkout-grid { grid-template-columns: 1fr; }
}

/* ── Form Styles (light / public) ───────────────────────────── */
.ec-form-group { margin-bottom: 1rem; }
.ec-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
  letter-spacing: .02em;
}
.ec-label .req { color: #ef4444; }
.ec-input, .ec-select, .ec-textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #e5e7eb;
  border-radius: 7px;
  font-size: 0.9rem;
  color: #111;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
  box-sizing: border-box;
}
.ec-input:focus, .ec-select:focus, .ec-textarea:focus {
  outline: none;
  border-color: #B82B0D;
  box-shadow: 0 0 0 3px rgba(184,43,13,0.12);
}
.ec-textarea { resize: vertical; min-height: 80px; }
.ec-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) { .ec-form-row { grid-template-columns: 1fr; } }
.ec-error { color: #ef4444; font-size: 0.78rem; margin-top: 4px; }

/* ── Order Summary Panel ─────────────────────────────────────── */
.order-summary { position: sticky; top: 20px; }
.order-summary-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: .75rem;
}
.summary-item {
  display: flex;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid #f3f4f6;
  align-items: center;
}
.summary-item:last-of-type { border-bottom: none; }
.summary-item-img {
  width: 52px; height: 40px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3f4f6;
}
.summary-item-name { font-size: 0.82rem; font-weight: 600; color: #111; }
.summary-item-price { font-size: 0.78rem; color: #6b7280; }
.summary-totals { margin-top: .75rem; padding-top: .75rem; border-top: 2px solid #f3f4f6; }
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #374151;
  padding: 3px 0;
}
.summary-row.total {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}

/* ── Payment Method Cards ────────────────────────────────────── */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 1rem 0;
}
.payment-method-card {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.1rem 1rem;
  cursor: pointer;
  transition: all .2s;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.payment-method-card:hover { border-color: #B82B0D; box-shadow: 0 2px 12px rgba(184,43,13,0.1); }
.payment-method-card.selected {
  border-color: #B82B0D;
  background: #fff8f7;
  box-shadow: 0 0 0 3px rgba(184,43,13,0.12);
}
.payment-method-card input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.pm-icon { font-size: 1.75rem; }
.pm-name { font-size: 0.88rem; font-weight: 700; color: #111; }
.pm-type { font-size: 0.72rem; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; }
.pm-check {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #B82B0D; color: #fff;
  display: none; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.payment-method-card.selected .pm-check { display: flex; }

/* ── Payment Instructions ────────────────────────────────────── */
.payment-instructions-box {
  background: linear-gradient(135deg, #0d1117, #1a1f2e);
  border-radius: 12px;
  padding: 1.75rem;
  color: #fff;
  margin: 1rem 0;
}
.pib-header { display: flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; }
.pib-icon { font-size: 2rem; }
.pib-title { font-size: 1rem; font-weight: 700; }
.pib-subtitle { font-size: 0.78rem; color: rgba(255,255,255,0.5); }

.pib-amount {
  background: rgba(184,43,13,0.2);
  border: 1px solid rgba(184,43,13,0.4);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.pib-amount-label { font-size: 0.72rem; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: .08em; }
.pib-amount-value { font-size: 1.5rem; font-weight: 700; color: #fff; }
.pib-order-ref    { font-size: 0.8rem; color: rgba(255,255,255,0.7); }

.pib-detail-row {
  background: rgba(255,255,255,0.06);
  border-radius: 7px;
  padding: .75rem 1rem;
  margin-bottom: .5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.pib-detail-label { font-size: 0.72rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: .06em; flex-shrink: 0; }
.pib-detail-value {
  font-size: 0.85rem; font-weight: 600; color: #fff;
  font-family: 'Courier New', monospace;
  word-break: break-all;
}
.copy-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
  font-family: inherit;
}
.copy-btn:hover { background: rgba(255,255,255,0.22); }
.copy-btn.copied { background: rgba(26,122,74,0.4); border-color: #1a7a4a; }

.pib-qr {
  text-align: center;
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
}
.pib-qr img {
  width: 180px; height: 180px;
  border-radius: 6px;
  background: #fff;
  padding: 6px;
  display: block;
  margin: 0 auto .5rem;
}
.pib-qr-label { font-size: 0.72rem; color: rgba(255,255,255,0.5); }

.pib-warning {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 7px;
  padding: .75rem 1rem;
  font-size: 0.8rem;
  color: #fca5a5;
  margin-top: .75rem;
}

.pib-instructions {
  background: rgba(255,255,255,0.05);
  border-radius: 7px;
  padding: 1rem;
  font-size: 0.83rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  margin-bottom: .75rem;
}

/* ── Proof Upload ─────────────────────────────────────────────── */
.proof-upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 9px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: #fafafa;
  margin-bottom: 1rem;
}
.proof-upload-zone:hover, .proof-upload-zone.dragover {
  border-color: #B82B0D;
  background: #fff8f7;
}
.proof-upload-zone input[type="file"] { display: none; }
.proof-upload-icon { font-size: 2rem; margin-bottom: .5rem; }
.proof-upload-text { font-size: 0.88rem; color: #374151; font-weight: 600; }
.proof-upload-sub  { font-size: 0.75rem; color: #9ca3af; margin-top: 4px; }

/* ── Status Timeline ─────────────────────────────────────────── */
.status-timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 1.5rem 0;
  overflow-x: auto;
  padding-bottom: .5rem;
}
.timeline-step {
  flex: 1;
  min-width: 100px;
  text-align: center;
  position: relative;
}
.timeline-step::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}
.timeline-step:last-child::after { display: none; }
.timeline-step.done::after { background: #16a34a; }
.timeline-step.active::after { background: #e5e7eb; }

.timeline-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #9ca3af;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .5rem;
  position: relative;
  z-index: 1;
  transition: all .3s;
}
.timeline-step.done .timeline-dot { background: #16a34a; color: #fff; }
.timeline-step.active .timeline-dot { background: #B82B0D; color: #fff; box-shadow: 0 0 0 4px rgba(184,43,13,0.18); }
.timeline-step.rejected .timeline-dot { background: #ef4444; color: #fff; }

.timeline-label { font-size: 0.68rem; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; }
.timeline-step.done .timeline-label  { color: #16a34a; }
.timeline-step.active .timeline-label { color: #B82B0D; font-weight: 700; }

/* ── Order Status Badges ─────────────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.status-pill.warning  { background: #fef3c7; color: #92400e; }
.status-pill.info     { background: #eff6ff; color: #1e40af; }
.status-pill.success  { background: #f0fdf4; color: #16a34a; }
.status-pill.danger   { background: #fef2f2; color: #dc2626; }
.status-pill.primary  { background: #eff6ff; color: #1d4ed8; }
.status-pill.purple   { background: #f5f3ff; color: #7c3aed; }
.status-pill.dark-success { background: #d1fae5; color: #065f46; }
.status-pill.secondary { background: #f3f4f6; color: #6b7280; }

/* ── Order Tracking Page ─────────────────────────────────────── */
.tracking-header {
  background: linear-gradient(135deg, #0d1117, #1a1f2e);
  border-radius: 12px;
  padding: 1.75rem;
  color: #fff;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}
.tracking-order-num { font-size: 1.4rem; font-weight: 700; }
.tracking-meta { font-size: 0.78rem; color: rgba(255,255,255,0.5); margin-top: 4px; }

/* ── Invoice Print Styles ────────────────────────────────────── */
.invoice-wrap {
  max-width: 780px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
}
.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #0d1117;
}
.invoice-logo-block .company-name { font-size: 1.3rem; font-weight: 800; color: #0d1117; }
.invoice-logo-block .company-sub  { font-size: 0.78rem; color: #6b7280; }
.invoice-title-block { text-align: right; }
.invoice-title-block h1 { font-size: 1.8rem; font-weight: 900; color: #B82B0D; margin: 0 0 .25rem; }
.invoice-title-block .invoice-num { font-size: 0.8rem; color: #6b7280; }

.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.invoice-party h4 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .1em; color: #9ca3af; margin-bottom: .4rem; }
.invoice-party p  { font-size: 0.88rem; color: #111; line-height: 1.6; margin: 0; }

.invoice-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.invoice-table th {
  background: #0d1117; color: #fff;
  padding: 8px 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  text-align: left;
}
.invoice-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.87rem;
  color: #374151;
}
.invoice-table tr:nth-child(even) td { background: #fafafa; }

.invoice-totals { margin-left: auto; max-width: 280px; }
.invoice-total-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.87rem; color: #374151; }
.invoice-total-row.grand { font-size: 1rem; font-weight: 800; color: #0d1117; border-top: 2px solid #0d1117; padding-top: 8px; margin-top: 4px; }

.invoice-status-block {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border-radius: 7px;
  font-size: 0.82rem;
}
.invoice-status-block.unpaid { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.invoice-status-block.paid   { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }

.invoice-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #f3f4f6;
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
}

.print-only { display: none; }
@media print {
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .print-only { display: block; }
  .invoice-wrap { border: none; margin: 0; padding: 1rem; max-width: 100%; }
  @page { margin: 1cm; }
}

/* ── Cart Page ───────────────────────────────────────────────── */
.cart-empty {
  text-align: center;
  padding: 4rem 2rem;
}
.cart-empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.cart-empty h2 { font-size: 1.25rem; color: #374151; margin-bottom: .5rem; }
.cart-empty p  { color: #6b7280; }

.cart-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
  width: 80px; height: 60px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3f4f6;
}
.cart-item-name { font-size: 0.9rem; font-weight: 600; color: #111; }
.cart-item-price { font-size: 0.82rem; color: #6b7280; margin-top: 2px; }
.cart-item-remove {
  margin-left: auto;
  background: none;
  border: 1px solid #fecaca;
  color: #ef4444;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
}
.cart-item-remove:hover { background: #fef2f2; }

/* ── Buttons (public) ────────────────────────────────────────── */
.btn-ec-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: #B82B0D;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .15s;
  font-family: inherit;
  letter-spacing: .02em;
}
.btn-ec-primary:hover { background: #96220a; transform: translateY(-1px); }
.btn-ec-primary:disabled { background: #d1d5db; cursor: not-allowed; transform: none; }
.btn-ec-primary.w-full { width: 100%; }

.btn-ec-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  color: #B82B0D;
  border: 1.5px solid #B82B0D;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  font-family: inherit;
}
.btn-ec-outline:hover { background: #fff8f7; }

.btn-buy-now {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: linear-gradient(135deg, #B82B0D, #96220a);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(184,43,13,0.35);
}
.btn-buy-now:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(184,43,13,0.45); }

.btn-add-cart {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  background: transparent;
  color: #B82B0D;
  border: 1.5px solid #B82B0D;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  font-family: inherit;
}
.btn-add-cart:hover { background: #fff8f7; }

/* ── Confirmation Page ───────────────────────────────────────── */
.confirm-box {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
}
.confirm-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.confirm-box h2 { font-size: 1.6rem; font-weight: 800; color: #14532d; margin-bottom: .5rem; }
.confirm-box p { color: #166534; font-size: 0.9rem; }
.confirm-order-num {
  display: inline-block;
  background: #14532d;
  color: #fff;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .06em;
  margin: 1rem 0;
}

/* ── Admin Order Status Badges ────────────────────────────────── */
.badge-ec-warning     { background: #fef3c7; color: #92400e; }
.badge-ec-info        { background: #eff6ff; color: #1e40af; }
.badge-ec-success     { background: #f0fdf4; color: #16a34a; }
.badge-ec-danger      { background: #fef2f2; color: #dc2626; }
.badge-ec-primary     { background: #eff6ff; color: #1d4ed8; }
.badge-ec-purple      { background: #f5f3ff; color: #7c3aed; }
.badge-ec-dark-success{ background: #d1fae5; color: #065f46; }
.badge-ec-secondary   { background: #f3f4f6; color: #6b7280; }

.proof-thumbnail {
  max-width: 280px;
  max-height: 200px;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  object-fit: contain;
  display: block;
  margin: 8px 0;
}
