@media print {
  /* Hide all non-printable elements */
  .fixed,
  [role="alert"],
  [data-controller="flash"],
  div[style*="position: fixed"],
  .print\:hidden,
  .btn,
  .hide-print,
  svg[viewBox="0 0 24 24"],
  input[type="checkbox"],
  button,
  header,
  .header,
  nav,
  .nav,
  .sidebar,
  aside,
  #flash,
  #sidebar,
  #header,
  [data-navbar],
  [data-sidebar],
  [data-flash] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    pointer-events: none !important;
  }

  /* Reset layout and spacing */
  body {
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
    color: black !important;
  }

  main,
  .main-content,
  [role="main"],
  #main-content {
    margin: 0 !important;
    padding: 0 !important;
    left: 0 !important;
    width: 100% !important;
  }

  /* Layout adjustments */
  .max-w-3xl {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1rem !important;
  }

  .shadow {
    box-shadow: none !important;
  }

  .rounded-lg {
    border: 1px solid #e5e7eb !important;
    margin-bottom: 1rem !important;
  }

  /* Fix table layout issues */
  table {
    page-break-inside: auto !important;
    border-collapse: collapse !important;
  }

  tr {
    page-break-inside: avoid !important;
    page-break-after: auto !important;
  }

  td {
    page-break-inside: avoid !important;
  }

  /* Fix animation wrapper spacing */
  .anim-wrapper {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    transition: none !important;
  }

  .overflow-hidden {
    overflow: visible !important;
  }

  .p-6 {
    padding: 1rem !important;
  }

  /* Text colors */
  .text-gray-500 {
    color: #666 !important;
  }

  .text-gray-900 {
    color: #000 !important;
  }

  /* Image handling */
  img {
    max-width: 100px !important;
    height: auto !important;
  }

  /* Print-only elements */
  .print-only {
    display: block !important;
  }

  .print-only img {
    max-width: 200px !important;
    height: auto !important;
    margin: 0 auto !important;
  }

  /* Fix flex layout in print */
  .flex {
    display: block !important;
  }

  /* Preserve flex layout for product images and details */
  .js-line-item-content .flex {
    display: flex !important;
  }

  /* Preserve barcode centering in print */
  [data-barcode-display-target="canvas"] {
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
  }

  /* Ensure barcode container is centered in print */
  .barcode-container {
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
  }

  /* Center canvas elements in print */
  canvas {
    margin: 0 auto !important;
    display: block !important;
  }

  /* Optimize barcode layout for print */
  .max-w-2xl {
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0.5rem !important;
  }

  /* Ensure barcode panel is properly formatted for print */
  .panel {
    margin: 0 !important;
    padding: 1rem !important;
    box-shadow: none !important;
  }

  .print-no-border-larger {
    border: none !important;
  }

  /* Center text content in print */
  .text-center {
    text-align: center !important;
  }

  /* Remove transition effects */
  * {
    transition: none !important;
    animation: none !important;
  }
} 