/* Buying-list and print styles */
.print-page { background: #f4f6f8; color: #000; padding-bottom: 40px; }
.print-header {
  background: #c5cfd6; padding: 28px 34px; display: flex;
  align-items: center; gap: 32px;
}
.print-header-text { min-width: 0; }
.print-header-text h1 { font-size: 32px; font-weight: 800; letter-spacing: .5px; margin-bottom: 12px; text-transform: uppercase; overflow-wrap: anywhere; }
.print-header-text p { font-size: 16px; font-weight: 700; }
.print-table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.buying-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.buying-table th, .buying-table td {
  border: 2px solid #000; text-align: center; vertical-align: middle;
  height: 68px; font-size: 14px; color: #000; overflow-wrap: anywhere;
}
.buying-table th { background: #d4d4d4; font-weight: 700; text-transform: uppercase; }
.buying-table td { background: #fff; }
.col-num { width: 8%; } .col-name { width: 22%; } .col-qty { width: 14%; }
.col-price { width: 26%; } .col-subtotal { width: 30%; }
.qty-controls { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.qty-btn {
  width: 24px; height: 24px; border: 1px solid #000; background: #d4d4d4;
  color: #000; font-weight: 700; border-radius: 4px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.subtotal-cell-inner {
  display: flex; align-items: center; justify-content: center;
  position: relative; width: 100%; min-height: 64px; padding: 0 70px 0 12px;
}
.remove-row-btn {
  position: absolute; right: 8px; padding: 5px 8px; border: 1px solid #000;
  border-radius: 6px; background: #e57373; color: #000; font-size: 12px;
  font-weight: 600; cursor: pointer;
}
.summary-row td.no-border-cell {
  border: 0; background: transparent; text-align: right;
  padding-right: 18px; font-size: 15px; font-weight: 500;
}
.summary-row td.total-box-cell { border: 2px solid #000; background: #fff; font-size: 15px; font-weight: 600; }
.print-footer-actions { margin-top: 32px; display: flex; justify-content: center; gap: 16px; padding: 0 12px; }

@media (max-width: 640px) {
  .print-page { padding-bottom: 24px; }

  .print-header {
    padding: 16px 14px;
    gap: 12px;
    align-items: center;
  }

  .print-header .logo-circle {
    width: 54px;
    height: 54px;
    margin: 0;
    flex: 0 0 54px;
    font-size: 13px;
  }

  .print-header-text h1 {
    font-size: clamp(16px, 4.5vw, 20px);
    line-height: 1.2;
    letter-spacing: .2px;
    margin-bottom: 6px;
  }

  .print-header-text p { font-size: 12px; line-height: 1.35; }

  /* The buying list stays a real table and can be swiped horizontally on phones. */
  .print-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
  }

  .buying-table { min-width: 560px; }
  .buying-table th, .buying-table td { height: 58px; font-size: 12px; }
  .qty-controls { gap: 6px; }
  .qty-btn { width: 28px; height: 28px; }
  .subtotal-cell-inner { min-height: 56px; padding-right: 64px; }
  .remove-row-btn { right: 5px; padding: 5px 6px; font-size: 11px; }
  .summary-row td.no-border-cell { padding-right: 10px; font-size: 13px; }
  .summary-row td.total-box-cell { font-size: 13px; }

  .print-footer-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin: 16px 0 0;
    padding: 0 14px;
  }

  .print-footer-actions .theme-btn {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .print-header { padding: 14px 10px; gap: 9px; }
  .print-header .logo-circle { width: 48px; height: 48px; flex-basis: 48px; }
  .print-header-text h1 { font-size: 16px; }
  .buying-table { min-width: 540px; }
}

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .print-page { padding: 0; }
  .print-table-wrapper { overflow: visible; }
}
