/* ==========================================================================
   Procesado VIOS a HY — módulo nuevo, aislado. Hoja Carta HORIZONTAL
   (11in x 8.5in) EN BLANCO (Fecha / Cantidad / No. Pallet / Responsable)
   para llenar a mano, una sola hoja por impresión. Logo grande arriba a la
   izquierda, título grande debajo. Reutiliza sólo clases globales genéricas
   del sistema (.app-header, .app-footer, .app-sidebar, .main-content, .btn,
   .print-info) — todo lo específico de este módulo usa el prefijo "pvh-"
   para no chocar con ningún otro módulo existente.
   ========================================================================== */

.pvh-main { max-width: 1100px; padding: 20px 16px 40px; }

/* ---------------------------------------------------------------------- */
/* Barra de impresión                                                       */
/* ---------------------------------------------------------------------- */

.pvh-print-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.pvh-print-info {
  margin: 0;
  font-size: 0.88rem;
  color: var(--gray-700);
  max-width: 640px;
}

/* ---------------------------------------------------------------------- */
/* Título de la sección de vista previa                                     */
/* ---------------------------------------------------------------------- */

.pvh-preview-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 14px;
}

/* ==========================================================================
   HOJA — proporción Carta HORIZONTAL (11in x 8.5in) preservada en pantalla
   mediante container queries; en impresión usa unidades físicas absolutas.
   ========================================================================== */

.pvh-sheet-section { display: flex; justify-content: center; }

.pvh-sheet-wrap {
  container-type: size;
  width: min(1000px, 100%);
  aspect-ratio: 11 / 8.5;
  margin: 0 auto;
}

.pvh-sheet {
  width: 100%;
  height: 100%;
  background: var(--white);
  border: 1px solid var(--gray-300);
  box-shadow: 0 2px 10px rgba(17, 17, 17, 0.08);
  padding: 5cqh 5cqw;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--font);
  color: var(--black);
  overflow: hidden;
  box-sizing: border-box;
}

.pvh-header-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.pvh-logo {
  width: 34cqw;
  height: auto; /* alto automático: conserva la proporción real, no deforma */
  flex-shrink: 0;
}

.pvh-title {
  width: 100%;
  margin: 3cqh 0 0;
  font-size: 6.4cqh;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.08;
  color: var(--black);
  text-align: left;
}

.pvh-fields {
  width: 100%;
  margin-top: 6cqh;
  display: flex;
  flex-direction: column;
  gap: 4.2cqh;
}

.pvh-row {
  display: flex;
  align-items: baseline;
  gap: 1.4cqw;
  width: 100%;
}

.pvh-label {
  flex-shrink: 0;
  font-size: 3.6cqh;
  font-weight: 800;
  color: var(--black);
  white-space: nowrap;
}

.pvh-value {
  flex: 1 1 auto;
  min-height: 4.2cqh;
  font-size: 3.4cqh;
  font-weight: 600;
  color: var(--black);
  border-bottom: 0.18cqh solid var(--black);
  padding-bottom: 0.6cqh;
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */

@media (max-width: 600px) {
  .pvh-print-bar { flex-direction: column; align-items: stretch; }
  .pvh-print-bar .btn { width: 100%; }
}

/* ==========================================================================
   IMPRESIÓN — garantiza EXACTAMENTE una hoja Carta HORIZONTAL (11in x 8.5in),
   sólo la hoja de este módulo, sin importar el layout de pantalla. CSS
   aislado con IDs propios (#pvh-sheet-wrap / #pvh-print-area) — no toca ni
   depende de reglas de impresión de ningún otro módulo.
   ========================================================================== */

@page {
  size: letter landscape;
  margin: 0;
}

@media print {
  html, body {
    width: 11in;
    height: 8.5in;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
  }

  .no-print { display: none !important; }
  .app-sidebar { display: none !important; }

  body * { visibility: hidden; }

  #pvh-sheet-wrap,
  #pvh-sheet-wrap *,
  #pvh-print-area,
  #pvh-print-area * {
    visibility: visible !important;
  }

  #pvh-sheet-wrap {
    container-type: normal;
    position: fixed;
    inset: 0;
    width: 11in;
    height: 8.5in;
    aspect-ratio: auto;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  #pvh-print-area {
    position: fixed;
    inset: 0;
    width: 11in;
    height: 8.5in;
    margin: 0;
    padding: 0.45in 0.55in;
    border: none;
    box-shadow: none;
    box-sizing: border-box;
    overflow: hidden;
    page-break-before: avoid;
    page-break-after: avoid;
    page-break-inside: avoid;
    break-before: avoid-page;
    break-after: avoid-page;
    break-inside: avoid-page;
  }

  .pvh-logo { width: 4.6in; height: auto; }
  .pvh-title { font-size: 32pt; margin: 0.3in 0 0; white-space: nowrap; }
  .pvh-fields { margin-top: 0.5in; gap: 0.42in; }
  .pvh-row { gap: 0.15in; }
  .pvh-label { font-size: 22pt; }
  .pvh-value { font-size: 20pt; min-height: 0.4in; border-bottom-width: 1.5pt; padding-bottom: 0.05in; }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
