/* PDF-specific styles for quote generation via Ferrum/Chromium */
/* All styles scoped under body.pdf-layout */

body.pdf-layout {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 10pt;
  line-height: 1.45;
  color: #1a1a2e;
  background: white;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Hide interactive / non-print elements */
body.pdf-layout .d-print-none,
body.pdf-layout .btn,
body.pdf-layout button,
body.pdf-layout nav,
body.pdf-layout #flash {
  display: none !important;
}

/* Page setup */
@page {
  size: A4 portrait;
  margin: 12mm 15mm;
}

/* ===== PAGE CONTAINER ===== */
.pdf-page {
  width: 100%;
  max-width: 180mm;
  margin: 0 auto;
}

/* ===== HEADER ===== */
.pdf-header {
  width: 100%;
  border-bottom: 3px solid #0d6efd;
  padding-bottom: 4mm;
  margin-bottom: 5mm;
}

.pdf-header td {
  vertical-align: middle;
  padding: 0;
}

.pdf-header-logo {
  width: 20%;
  text-align: left;
}

.pdf-header-logo img {
  display: block;
}

.pdf-header-title {
  width: 55%;
  text-align: center;
  padding: 0 4mm;
}

.pdf-company-name {
  font-size: 18pt;
  font-weight: 700;
  color: #0d6efd;
  letter-spacing: 0.5px;
  margin-bottom: 1mm;
}

.pdf-company-subtitle {
  font-size: 8pt;
  color: #6c757d;
  letter-spacing: 0.3px;
}

.pdf-header-contact {
  width: 25%;
  text-align: right;
  font-size: 8pt;
  color: #495057;
  line-height: 1.6;
}

/* ===== QUOTE BANNER ===== */
.pdf-banner {
  background: #0d6efd;
  color: white;
  padding: 4mm 5mm;
  margin-bottom: 4mm;
  text-align: center;
}

.pdf-banner-title {
  font-size: 14pt;
  font-weight: 700;
  margin-bottom: 1mm;
}

.pdf-banner-date {
  font-size: 8.5pt;
  opacity: 0.85;
}

/* ===== EXPIRATION NOTICES ===== */
.pdf-notice {
  padding: 3mm 5mm;
  margin-bottom: 4mm;
  font-size: 9pt;
  border-left: 4px solid;
}

.pdf-notice-danger {
  background: #fff5f5;
  border-color: #dc3545;
  color: #842029;
}

.pdf-notice-warning {
  background: #fff8e1;
  border-color: #ffc107;
  color: #664d03;
}

/* ===== SECTION TITLES ===== */
.pdf-section-title {
  font-size: 12pt;
  font-weight: 700;
  color: #0d6efd;
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 2mm;
  margin-bottom: 4mm;
  margin-top: 2mm;
}

/* ===== OPTION BLOCKS ===== */
.pdf-option {
  margin-bottom: 5mm;
  page-break-inside: avoid;
  break-inside: avoid;
}

.pdf-option-header {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-bottom: none;
  padding: 2.5mm 4mm;
  font-size: 9pt;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pdf-option-header-left {
  display: flex;
  align-items: center;
  gap: 2.5mm;
  flex-wrap: wrap;
}

.pdf-brand-logo {
  height: 22px;
  max-height: 22px;
  vertical-align: middle;
}

.pdf-tire-thumb {
  height: 45px;
  max-height: 45px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.pdf-option-number {
  display: inline-block;
  background: #0d6efd;
  color: white;
  font-weight: 700;
  font-size: 8pt;
  padding: 1mm 2.5mm;
  margin-right: 2mm;
  vertical-align: middle;
}

.pdf-option-label {
  font-weight: 600;
  color: #495057;
  margin-right: 2mm;
  vertical-align: middle;
}

.pdf-option-brand {
  font-weight: 600;
  color: #0d6efd;
  font-size: 9.5pt;
  vertical-align: middle;
}

/* ===== TABLES ===== */
.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
}

.pdf-table thead th {
  background: #e9ecef;
  font-weight: 600;
  font-size: 8pt;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #495057;
  padding: 2mm 3mm;
  border-bottom: 2px solid #dee2e6;
}

.pdf-table tbody td {
  padding: 2.5mm 3mm;
  border-bottom: 1px solid #e9ecef;
  vertical-align: top;
}

.pdf-table tbody tr:last-child td {
  border-bottom: 2px solid #dee2e6;
}

.pdf-table .text-right {
  text-align: right;
}

.pdf-table .text-center {
  text-align: center;
}

.pdf-table .text-muted {
  color: #6c757d;
}

.pdf-table .pdf-price {
  font-weight: 700;
  color: #1a1a2e;
}

.pdf-table .pdf-position {
  font-weight: 600;
  color: #0d6efd;
  white-space: nowrap;
}

.pdf-table .pdf-season {
  font-size: 8pt;
  color: #6c757d;
}

/* Compact services sub-table */
.pdf-table-compact {
  border: 1px solid #dee2e6;
  border-top: none;
}

.pdf-table-compact thead th {
  background: #f1f3f5;
  font-size: 7.5pt;
}

.pdf-table-compact tbody td {
  font-size: 8.5pt;
  padding: 1.5mm 3mm;
}

.pdf-services-header {
  text-align: left !important;
  text-transform: none !important;
  font-size: 8pt !important;
  letter-spacing: 0 !important;
  color: #0d6efd !important;
}

/* ===== OPTION TOTAL ===== */
.pdf-option-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-top: none;
  padding: 2.5mm 4mm;
  font-size: 9.5pt;
}

.pdf-total-amount {
  font-weight: 700;
  font-size: 11pt;
  color: #0d6efd;
}

/* ===== FOOTNOTES ===== */
.pdf-footnote {
  font-size: 8pt;
  color: #6c757d;
  margin-top: 2mm;
  padding-left: 1mm;
}

/* ===== NOTES ===== */
.pdf-notes {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 3mm 4mm;
}

.pdf-note-item {
  font-size: 9pt;
  margin-bottom: 1.5mm;
  line-height: 1.4;
}

/* ===== FOOTER ===== */
.pdf-footer {
  margin-top: 8mm;
  page-break-inside: avoid;
  break-inside: avoid;
}

.pdf-footer-line {
  border-top: 2px solid #dee2e6;
  margin-bottom: 3mm;
}

.pdf-footer-content {
  display: flex;
  justify-content: space-between;
  font-size: 7.5pt;
  color: #6c757d;
}

.pdf-footer-expired {
  margin-top: 2mm;
  font-size: 8pt;
  color: #842029;
  font-style: italic;
  text-align: center;
}

/* ===== TYPOGRAPHY HELPERS ===== */
body.pdf-layout strong {
  font-weight: 700;
}

body.pdf-layout .text-muted {
  color: #6c757d;
}

/* ===== IMAGES ===== */
body.pdf-layout img {
  max-width: 100% !important;
  height: auto !important;
}

/* ===== PAGE BREAK CONTROLS ===== */
.pdf-option + .pdf-option {
  page-break-before: auto;
}

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

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

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