/* ══════════════════════════════════════════════════════════════
   SewReady — Print Stylesheet for Receipts & Labels
   ══════════════════════════════════════════════════════════════ */

@media print {
  /* ── Hide everything except print content ───────────────── */
  body > *:not(.print-receipt):not(.print-label) {
    display: none !important;
  }
  .header, .sidebar, .layout, .main, .cust-nav, .cust-topbar,
  .cust-hero, .cust-footer, .cust-chat-fab, .cust-chat-panel,
  .cust-cart-overlay, .cust-cart-drawer, .cust-auth-overlay,
  .toast, .cust-toast, #toast, #custToast,
  .notif-dropdown, .admin-auth-overlay {
    display: none !important;
  }

  /* ── Show print containers ─────────────────────────────── */
  .print-receipt,
  .print-label {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    background: #fff;
    color: #000;
  }

  /* ── Base receipt layout ────────────────────────────────── */
  .print-receipt {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.5;
    padding: 16px;
    max-width: 80mm;
    margin: 0 auto;
  }

  .print-receipt * {
    color: #000 !important;
    background: transparent !important;
  }

  /* ── Shop header ────────────────────────────────────────── */
  .receipt-header {
    text-align: center;
    border-bottom: 2px dashed #000;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .receipt-shop-name {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 4px;
  }

  .receipt-shop-info {
    font-size: 10px;
    margin: 2px 0;
  }

  /* ── Section titles ─────────────────────────────────────── */
  .receipt-section-title {
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 1px solid #000;
    margin: 12px 0 6px;
    padding-bottom: 2px;
  }

  /* ── Order info rows ────────────────────────────────────── */
  .receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
  }

  .receipt-row-label {
    font-weight: bold;
    font-size: 11px;
  }

  .receipt-row-value {
    text-align: right;
    font-size: 11px;
  }

  /* ── Items / services list ──────────────────────────────── */
  .receipt-items {
    margin: 8px 0;
  }

  .receipt-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 11px;
  }

  .receipt-item-name {
    flex: 1;
  }

  .receipt-item-price {
    text-align: right;
    min-width: 60px;
    font-weight: bold;
  }

  /* ── Cost breakdown ─────────────────────────────────────── */
  .receipt-totals {
    border-top: 1px dashed #000;
    margin-top: 8px;
    padding-top: 6px;
  }

  .receipt-total-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 12px;
  }

  .receipt-grand-total {
    font-size: 16px;
    font-weight: bold;
    border-top: 2px solid #000;
    margin-top: 4px;
    padding-top: 4px;
  }

  /* ── QR code area ───────────────────────────────────────── */
  .receipt-qr {
    text-align: center;
    margin: 16px 0 8px;
  }

  .receipt-qr canvas,
  .receipt-qr img {
    display: inline-block !important;
    width: 100px !important;
    height: 100px !important;
  }

  .receipt-qr-label {
    font-size: 9px;
    margin-top: 4px;
    color: #666 !important;
  }

  /* ── Footer / cut line ──────────────────────────────────── */
  .receipt-footer {
    text-align: center;
    border-top: 2px dashed #000;
    margin-top: 16px;
    padding-top: 12px;
    font-size: 10px;
  }

  .receipt-footer p {
    margin: 2px 0;
  }

  .receipt-cut-line {
    text-align: center;
    margin: 20px 0;
    font-size: 10px;
    color: #999 !important;
    border-top: 1px dashed #999;
    padding-top: 4px;
  }

  .receipt-datetime {
    font-size: 10px;
    text-align: center;
    margin: 8px 0;
    color: #666 !important;
  }

  /* ── Thank you message ──────────────────────────────────── */
  .receipt-thankyou {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    margin: 12px 0;
    padding: 8px 0;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
  }

  /* ── Label variant (2" x 3" garment tag) ────────────────── */
  .print-label {
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    line-height: 1.3;
    padding: 8px;
    max-width: 3in;
    max-height: 2in;
    margin: 0 auto;
    border: 1px solid #000;
    overflow: hidden;
  }

  .label-order-id {
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    margin: 0 0 4px;
    letter-spacing: 2px;
  }

  .label-customer {
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    margin: 0 0 4px;
  }

  .label-info {
    font-size: 9px;
    text-align: center;
    margin: 2px 0;
  }

  .label-qr {
    text-align: center;
    margin-top: 4px;
  }

  .label-qr canvas,
  .label-qr img {
    display: inline-block !important;
    width: 60px !important;
    height: 60px !important;
  }

  /* ── Page setup ─────────────────────────────────────────── */
  @page {
    margin: 0;
    size: auto;
  }
}

/* ── Screen styles for the print-preview overlay ─────────── */
@media screen {
  .print-receipt,
  .print-label {
    display: none;
  }
}
