/* ================================================================
   ORDER RECEIPT  —  Modern minimal redesign
================================================================ */

/* ── Page wrapper ─────────────────────────────────────────────── */
.receipt-page-section {
  min-height: 80vh;
  background: #f4f5f7;
  padding: 3rem 1rem 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* ── Receipt card ─────────────────────────────────────────────── */
.receipt-card {
  background: #fff;
  width: 100%;
  max-width: 760px;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 6px 32px rgba(0,0,0,0.07);
  overflow: hidden;
}

/* ── Top accent line ──────────────────────────────────────────── */
.receipt-accent-bar {
  height: 3px;
  background: #111827;
}

/* ── Header ───────────────────────────────────────────────────── */
.receipt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 2.5rem;
  border-bottom: 1px solid #f0f0f2;
  background: #fff;
}

.receipt-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0;
  flex: 1;
}

.receipt-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.receipt-company-info .receipt-company-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.18rem;
  letter-spacing: -0.01em;
}

.receipt-company-info p {
  font-size: 0.68rem;
  color: #a0aab4;
  margin: 0.04rem 0;
  line-height: 1.55;
}

.receipt-header-right {
  background: transparent;
  padding: 0;
  min-width: unset;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.receipt-label {
  font-size: 0.54rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #c4c9d4;
  margin: 0;
}

.receipt-number {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  letter-spacing: -0.02em;
  word-break: break-all;
}

.receipt-date-display {
  font-size: 0.7rem;
  color: #a0aab4;
  margin: 0;
}

/* ── Success banner ───────────────────────────────────────────── */
.receipt-success-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f0fdf9;
  border-bottom: 1px solid #d4f5e9;
  padding: 1rem 2.5rem;
}

.receipt-success-banner .success-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #059669;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.receipt-success-banner .success-text strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #064e3b;
}

.receipt-success-banner .success-text span {
  font-size: 0.76rem;
  color: #047857;
}

/* ── Info grid ────────────────────────────────────────────────── */
.receipt-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #f0f0f2;
}

.receipt-info-block {
  padding: 1.6rem 2.5rem;
  background: #fff;
}

.receipt-info-block:first-child {
  border-right: 1px solid #f0f0f2;
}

.receipt-info-label {
  font-size: 0.56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #c4c9d4;
  margin: 0 0 0.7rem;
}

.receipt-info-value {
  font-size: 0.82rem;
  color: #374151;
  margin: 0.16rem 0;
  line-height: 1.65;
}

.receipt-info-value strong {
  color: #111827;
  font-weight: 600;
}

.receipt-payment-chip {
  display: inline-block;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.67rem;
  font-weight: 600;
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  border: 1px solid #e5e7eb;
}

.receipt-server-badge {
  display: none;
}

/* ── Section heading ──────────────────────────────────────────── */
.receipt-section-heading {
  padding: 0.5rem 2.5rem;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #c4c9d4;
  background: #fff;
  border-bottom: 1px solid #f0f0f2;
}

/* ── Items table ──────────────────────────────────────────────── */
.receipt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.receipt-table thead tr {
  border-bottom: 1px solid #f0f0f2;
}

.receipt-table th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.57rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #c4c9d4;
}

.receipt-table th:first-child { padding-left: 2.5rem; }
.receipt-table th:last-child  { padding-right: 2.5rem; }

.receipt-table th.col-qty,
.receipt-table th.col-unit,
.receipt-table th.col-total { text-align: right; }

.receipt-table tbody tr {
  border-bottom: 1px solid #f7f8fa;
  transition: background 0.1s;
}

.receipt-table tbody tr:last-child { border-bottom: none; }

.receipt-table td {
  padding: 1rem 1rem;
  vertical-align: top;
  color: #374151;
}

.receipt-table td:first-child { padding-left: 2.5rem; }
.receipt-table td:last-child  { padding-right: 2.5rem; }

.receipt-table td.col-qty,
.receipt-table td.col-unit,
.receipt-table td.col-total {
  text-align: right;
  white-space: nowrap;
}

.receipt-table td.col-total {
  font-weight: 600;
  color: #111827;
}

.receipt-item-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.receipt-item-thumb {
  width: 36px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #f0f0f2;
  flex-shrink: 0;
}

.receipt-item-details { flex: 1; min-width: 0; }

.receipt-item-name {
  font-weight: 600;
  color: #111827;
  font-size: 0.86rem;
  line-height: 1.4;
}

.receipt-item-options {
  font-size: 0.71rem;
  color: #a0aab4;
  margin-top: 0.2rem;
  line-height: 1.5;
}

/* ── Totals block ─────────────────────────────────────────────── */
.receipt-totals-wrapper {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #f0f0f2;
  padding: 1.75rem 2.5rem;
}

.receipt-totals {
  width: 100%;
  max-width: 280px;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.28rem 0;
  font-size: 0.82rem;
  color: #6b7280;
}

.receipt-total-row .label { flex: 1; }

.receipt-total-row .value {
  text-align: right;
  min-width: 90px;
  font-variant-numeric: tabular-nums;
}

.receipt-total-row.discount-row {
  color: #059669;
  font-weight: 600;
}

.receipt-total-divider {
  border: none;
  border-top: 1px solid #f0f0f2;
  margin: 0.75rem 0;
}

.receipt-total-row.grand-total {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  padding-top: 0.3rem;
}

/* ── Footer strip ─────────────────────────────────────────────── */
.receipt-footer-strip {
  background: #fafbfc;
  border-top: 1px solid #f0f0f2;
  padding: 1.1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.receipt-footer-strip .footer-thank-you {
  font-size: 0.77rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

.receipt-footer-strip .footer-contact {
  font-size: 0.68rem;
  color: #a0aab4;
  margin: 0;
  text-align: right;
}

/* ── Action buttons ───────────────────────────────────────────── */
.receipt-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 760px;
}

.receipt-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.87rem;
  border-radius: 8px;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.5rem;
  background: #25D366;
  color: #fff;
  font-size: 0.87rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-whatsapp:hover  { background: #1eab54; color: #fff; }
.btn-whatsapp:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-download-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  color: #374151;
  font-size: 0.87rem;
  font-weight: 600;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-download-pdf:hover   { border-color: #9ca3af; background: #f9fafb; }
.btn-download-pdf:disabled { opacity: 0.65; cursor: not-allowed; }

/* ── PDF generating toast ─────────────────────────────────────── */
.pdf-generating-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.pdf-generating-toast.visible { opacity: 1; }

/* ── Proof review card ────────────────────────────────────────── */
.proof-review-card {
  background: #fff;
  width: 100%;
  max-width: 760px;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 6px 32px rgba(0,0,0,0.07);
  overflow: hidden;
}

.proof-review-header {
  padding: 1.75rem 2.5rem 1.25rem;
  border-bottom: 1px solid #f0f0f2;
}

.proof-review-header i {
  font-size: 1.5rem;
  color: #6b7280;
  margin-bottom: 0.6rem;
  display: block;
}

.proof-review-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.35rem;
}

.proof-review-header p {
  font-size: 0.82rem;
  color: #6b7280;
  margin: 0;
}

.proof-item {
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid #f0f0f2;
}

.proof-item:last-child { border-bottom: none; }

.proof-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.proof-filename {
  font-size: 0.85rem;
  font-weight: 600;
  color: #111827;
}

.proof-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.proof-status-badge.pending  { background: #fef3c7; color: #92400e; }
.proof-status-badge.approved { background: #d1fae5; color: #065f46; }
.proof-status-badge.rejected { background: #fee2e2; color: #991b1b; }

.proof-note {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
  background: #f9fafb;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  border-left: 3px solid #e5e7eb;
}

.proof-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.proof-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.proof-action-btn.approve { background: #059669; color: #fff; }
.proof-action-btn.approve:hover { background: #047857; }
.proof-action-btn.reject  { background: #fff; color: #374151; border: 1.5px solid #e5e7eb; }
.proof-action-btn.reject:hover  { border-color: #9ca3af; background: #f9fafb; }
.proof-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.proof-view-link {
  font-size: 0.8rem;
  color: #6b7280;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.5rem;
  border-radius: 5px;
  transition: background 0.1s;
}

.proof-view-link:hover { background: #f3f4f6; color: #111827; }

/* ── Design upload card ───────────────────────────────────────── */
.design-upload-card { max-width: 760px; width: 100%; }

.design-file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #374151;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.design-file-item:last-child { border-bottom: none; }

.design-upload-progress {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin: 0.75rem 0 0.25rem;
  overflow: hidden;
}

.design-upload-progress-bar {
  height: 100%;
  background: #111827;
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
}

/* ── Fallback state ───────────────────────────────────────────── */
.receipt-fallback {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 460px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 6px 24px rgba(0,0,0,0.06);
}

.receipt-fallback i {
  font-size: 2.5rem;
  color: #d1d5db;
  margin-bottom: 1rem;
  display: block;
}

.receipt-fallback h2 { margin: 0 0 0.5rem; color: #374151; font-size: 1.1rem; }
.receipt-fallback p  { color: #9ca3af; margin-bottom: 1.5rem; font-size: 0.88rem; }

.receipt-fallback .fallback-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .receipt-page-section  { padding: 1rem 0.75rem 3.5rem; }

  .receipt-header {
    padding: 1.25rem 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .receipt-header-right {
    align-items: flex-start;
    text-align: left;
    width: 100%;
  }

  .receipt-info-grid { grid-template-columns: 1fr; }

  .receipt-info-block {
    padding: 1.1rem 1.25rem;
  }

  .receipt-info-block:first-child {
    border-right: none;
    border-bottom: 1px solid #f0f0f2;
  }

  .receipt-section-heading { padding: 0.45rem 1.25rem; }

  .receipt-table th,
  .receipt-table td      { padding: 0.75rem 0.75rem; }

  .receipt-table th:first-child,
  .receipt-table td:first-child { padding-left: 1.25rem; }

  .receipt-table th:last-child,
  .receipt-table td:last-child  { padding-right: 1.25rem; }

  .receipt-table .col-unit { display: none; }

  .receipt-totals-wrapper { padding: 1.25rem; }
  .receipt-totals { max-width: 100%; }

  .receipt-footer-strip {
    padding: 1rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .receipt-footer-strip .footer-contact { text-align: left; }

  .receipt-item-thumb { width: 30px; height: 38px; }

  .receipt-actions { gap: 0.5rem; }
  .receipt-actions .btn,
  .btn-whatsapp,
  .btn-download-pdf { width: 100%; justify-content: center; }
}

/* ── Print styles ─────────────────────────────────────────────── */
@media print {
  body > .banner,
  body > .navbar,
  body > .footer,
  .receipt-actions,
  .receipt-fallback,
  .design-upload-card,
  #mini-cart-modal,
  .mobile-nav-overlay,
  .mobile-nav-drawer,
  .pdf-generating-toast {
    display: none !important;
  }

  body,
  .receipt-page-section {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .receipt-card {
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 0 !important;
  }
}
