/* ==========================================================================
   MORANGOS TATUÍ - VISUALIZADOR DE FICHAS TÉCNICAS
   Estilos Principais e Regras Otimizadas para Impressão A4
   ========================================================================== */

:root {
  --primary-50: #fff1f2;
  --primary-100: #ffe4e6;
  --primary-200: #fecdd3;
  --primary-500: #f43f5e;
  --primary-600: #e11d48;
  --primary-700: #be123c;
  --primary-800: #9f1239;
  --primary-900: #881337;
  
  --amber-500: #f59e0b;
  --emerald-600: #059669;
  --slate-900: #0f172a;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
}

.font-serif {
  font-family: 'Noto Serif', Georgia, serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Transições suaves */
.transition-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -10px rgba(225, 29, 72, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* Checkbox estilizado para Mise en Place */
.mise-checkbox {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #cbd5e1;
  border-radius: 0.375rem;
  outline: none;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: all 0.15s ease-in-out;
  background-color: #ffffff;
}

.mise-checkbox:checked {
  background-color: #e11d48;
  border-color: #e11d48;
}

.mise-checkbox:checked::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background-color: white;
}

/* Efeito de item riscado quando marcado */
tr.item-checked td {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Badges e tags */
.badge-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* Multiplier Pills */
.pill-multiplier {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.pill-multiplier.active {
  background-color: #e11d48;
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.3);
}

/* ==========================================================================
   REGRAS ESPECÍFICAS PARA IMPRESSÃO EM FOLHA A4 (PDF / IMPRESSORA)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm 10mm 10mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Ocultar elementos da interface que não devem sair na impressão */
  .no-print,
  #app-header,
  #app-sidebar,
  #catalog-view,
  #view-controls,
  #batch-drawer,
  #settings-modal,
  #pin-modal,
  #notification-toast,
  button,
  .btn-print,
  .print-hidden {
    display: none !important;
  }

  /* Exibir e formatar a folha técnica */
  #detail-view,
  .printable-sheet {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  /* Quebras de página controladas */
  .page-break {
    page-break-after: always;
    break-after: page;
  }

  .avoid-break {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Cabeçalho de Impressão */
  .print-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e11d48;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }

  /* Tabelas limpas para impressão */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 10px !important;
  }

  th {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 1.5px solid #94a3b8 !important;
    padding: 4px 8px !important;
    font-size: 9.5pt !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
  }

  td {
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 4px 8px !important;
    font-size: 9.5pt !important;
  }

  /* Checkbox visível e estático na impressão */
  .mise-checkbox {
    border: 1.5px solid #000000 !important;
    background: transparent !important;
  }

  /* Cores e bordas otimizadas para economia de tinta */
  .bg-slate-50, .bg-gray-50, .bg-rose-50 {
    background-color: #f8fafc !important;
  }

  .border-rose-100, .border-slate-200 {
    border-color: #cbd5e1 !important;
  }

  /* Ocultar fotos na impressão se desejar economizar tinta ou deixá-la compacta */
  .print-photo {
    max-height: 120px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
  }

  /* Rodapé com carimbo da data e Morangos Tatuí */
  .print-footer {
    display: block !important;
    border-top: 1px solid #cbd5e1;
    margin-top: 15px;
    padding-top: 6px;
    font-size: 8pt;
    color: #64748b;
    text-align: center;
  }
}
