/* Heathrow Car Park — single-page invoice (screen + print) */
.hcpb-invoice-page,
.hcpb-invoice-wrap {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.hcpb-invoice-page {
  max-width: 820px;
  margin: 24px auto 48px;
  padding: 0 20px 60px;
  box-sizing: border-box;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 50;
  clear: both;
  min-height: 120px;
}

/* Footer wrapper — centred card, not full-bleed */
.hcpb-invoice-footer-wrap {
  display: block !important;
  visibility: visible !important;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  box-sizing: border-box;
  position: relative;
  z-index: 50;
  clear: both;
  background: transparent;
}

.hcpb-invoice-footer-wrap .hcpb-invoice-page {
  margin-top: 0;
}

.entry-content .hcpb-invoice-footer-wrap,
.site-main .hcpb-invoice-footer-wrap,
main .hcpb-invoice-footer-wrap {
  padding-top: 8px;
}

/* Theme compatibility — keep invoice visible inside page builders */
.entry-content .hcpb-invoice-page,
.site-content .hcpb-invoice-page,
main .hcpb-invoice-page {
  display: block !important;
  visibility: visible !important;
}

.hcpb-inv-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.hcpb-inv-pdf-btn,
.hcpb-inv-print-btn {
  background: #1d88e5;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(29, 136, 229, 0.35);
}

.hcpb-inv-pdf-btn:hover,
.hcpb-inv-print-btn:hover {
  background: #1574c4;
}

.hcpb-inv-pdf-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.hcpb-inv-pdf-status {
  display: inline-block;
  margin-left: 12px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.hcpb-inv-sheet {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  padding: 36px 40px 32px;
  box-sizing: border-box;
  overflow: visible;
  height: auto;
  max-height: none;
}

#hcpb-invoice-root,
.hcpb-invoice-footer-wrap,
.hcpb-invoice-page {
  overflow: visible !important;
  max-height: none !important;
}

.hcpb-inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

.hcpb-inv-logo {
  display: block;
  max-width: 300px;
  width: 100%;
  height: auto;
}

.hcpb-inv-tagline {
  margin: 10px 0 0;
  font-size: 14px;
  color: #6b7280;
}

.hcpb-inv-email {
  margin: 4px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

.hcpb-inv-title-block {
  text-align: right;
  flex-shrink: 0;
}

.hcpb-inv-title {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #111;
}

.hcpb-inv-meta-line {
  margin: 0 0 4px;
  font-size: 14px;
  color: #374151;
}

.hcpb-inv-meta-line span {
  color: #6b7280;
}

.hcpb-inv-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}

.hcpb-inv-col {
  min-width: 0;
}

.hcpb-inv-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 8px;
}

.hcpb-inv-value {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
}

.hcpb-inv-sub {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
}

.hcpb-inv-sub + .hcpb-inv-sub {
  margin-top: 2px;
}

.hcpb-inv-phone {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.hcpb-inv-phone-num {
  color: inherit;
  text-decoration: none;
}

.hcpb-inv-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 14px;
}

.hcpb-inv-table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  padding: 0 0 10px;
  border-bottom: 1px solid #e5e7eb;
}

.hcpb-inv-table thead th.hcpb-inv-amt {
  text-align: right;
}

.hcpb-inv-table tbody td {
  padding: 14px 0;
  vertical-align: top;
  border-bottom: 1px solid #f3f4f6;
}

.hcpb-inv-amt {
  text-align: right;
  white-space: nowrap;
  width: 110px;
}

.hcpb-inv-item-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.hcpb-inv-item-sub {
  margin-top: 6px;
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.45;
}

.hcpb-inv-total-row td {
  border-bottom: none;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.hcpb-inv-total-amt {
  font-size: 18px;
}

.hcpb-inv-footer-box {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 18px 20px;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.55;
}

.hcpb-inv-footer-box p {
  margin: 0 0 8px;
}

.hcpb-inv-footer-box p:last-child {
  margin-bottom: 0;
}

.hcpb-inv-signoff {
  margin-top: 12px !important;
  font-weight: 600;
  color: #374151;
}

.hcpb-inv-arrival-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  color: #111;
}

.hcpb-inv-arrival-p {
  margin: 0 0 12px;
  line-height: 1.6;
  color: #4b5563;
  font-size: 14px;
}

.hcpb-inv-map-link,
.hcpb-inv-tel-link {
  color: #1d88e5;
  font-weight: 600;
  text-decoration: underline;
}

.hcpb-invoice-error {
  color: #dc2626;
  font-weight: 600;
  padding: 24px;
}

/* ── Mobile / phone screens ── */
@media (max-width: 640px) {
  .hcpb-invoice-page {
    margin: 12px auto 32px;
    padding: 0 12px 40px;
  }

  .hcpb-invoice-footer-wrap {
    padding: 16px 12px 32px;
  }

  .hcpb-inv-sheet {
    padding: 20px 16px 24px;
    border-radius: 12px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .hcpb-inv-header {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 22px;
  }

  .hcpb-inv-logo {
    max-width: 220px;
  }

  .hcpb-inv-title-block {
    text-align: left;
    width: 100%;
  }

  .hcpb-inv-title {
    font-size: 24px;
  }

  .hcpb-inv-columns {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 22px;
  }

  .hcpb-inv-col + .hcpb-inv-col {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
  }

  .hcpb-inv-sub,
  .hcpb-inv-value,
  .hcpb-inv-email {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .hcpb-inv-table {
    font-size: 13px;
    table-layout: fixed;
    width: 100%;
  }

  .hcpb-inv-table thead th:first-child,
  .hcpb-inv-table tbody td:first-child {
    width: auto;
    padding-right: 8px;
  }

  .hcpb-inv-amt {
    width: 80px;
    min-width: 72px;
    padding-left: 4px;
  }

  .hcpb-inv-item-sub {
    font-size: 12px;
    line-height: 1.4;
  }

  .hcpb-inv-total-amt {
    font-size: 16px;
  }

  .hcpb-inv-toolbar {
    justify-content: center;
  }

  .hcpb-inv-pdf-btn {
    width: 100%;
    max-width: 280px;
  }
}

/* ── Print / Save as PDF — match on-screen invoice (WYSIWYG) ── */
@page {
  size: A4 portrait;
  margin: 10mm 12mm;
}

@media print {
  html.hcpb-invoice-print,
  html.hcpb-invoice-print body {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }

  /* Hide site chrome; keep full invoice slot (parent of #hcpb-invoice-root) */
  html.hcpb-invoice-print body * {
    visibility: hidden !important;
  }

  html.hcpb-invoice-print .hcpb-invoice-footer-wrap,
  html.hcpb-invoice-print .hcpb-invoice-footer-wrap *,
  html.hcpb-invoice-print #hcpb-invoice-root,
  html.hcpb-invoice-print #hcpb-invoice-root * {
    visibility: visible !important;
  }

  html.hcpb-invoice-print .hcpb-invoice-footer-wrap,
  html.hcpb-invoice-print #hcpb-invoice-root {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 820px !important;
    margin: 0 auto !important;
    padding: 0 12px !important;
    background: #fff !important;
  }

  html.hcpb-invoice-print .hcpb-invoice-page,
  html.hcpb-invoice-print #hcpb-invoice-root {
    position: static !important;
    min-height: 0 !important;
  }

  html.hcpb-invoice-print .no-print,
  html.hcpb-invoice-print .hcpb-inv-toolbar {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* Same card look as screen */
  html.hcpb-invoice-print .hcpb-inv-sheet {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    padding: 36px 40px 32px !important;
    margin: 0 auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
  }

  html.hcpb-invoice-print .hcpb-inv-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 24px !important;
    margin-bottom: 28px !important;
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
  }

  html.hcpb-invoice-print .hcpb-inv-columns {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
    margin-bottom: 28px !important;
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
  }

  html.hcpb-invoice-print .hcpb-inv-logo {
    display: block !important;
    max-width: 300px !important;
    width: 100% !important;
    height: auto !important;
  }

  html.hcpb-invoice-print .hcpb-inv-title-block {
    text-align: right !important;
  }

  html.hcpb-invoice-print .hcpb-inv-table {
    width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
  }

  html.hcpb-invoice-print .hcpb-inv-table thead th {
    border-bottom: 1px solid #e5e7eb !important;
  }

  html.hcpb-invoice-print .hcpb-inv-table tbody td {
    border-bottom: 1px solid #f3f4f6 !important;
  }

  html.hcpb-invoice-print .hcpb-inv-total-row td {
    border-top: 1px solid #e5e7eb !important;
    border-bottom: none !important;
  }

  html.hcpb-invoice-print .hcpb-inv-footer-box {
    background: #f3f4f6 !important;
    border-radius: 12px !important;
    padding: 18px 20px !important;
    page-break-inside: avoid !important;
    break-inside: avoid-page !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html.hcpb-invoice-print .hcpb-inv-map-link,
  html.hcpb-invoice-print .hcpb-inv-tel-link {
    color: #1d88e5 !important;
    text-decoration: underline !important;
  }

  html.hcpb-invoice-print #hcpb-invoice-root,
  html.hcpb-invoice-print #hcpb-invoice-root * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html.hcpb-invoice-print #wpadminbar,
  html.hcpb-invoice-print header,
  html.hcpb-invoice-print footer,
  html.hcpb-invoice-print nav,
  html.hcpb-invoice-print aside,
  html.hcpb-invoice-print .site-header,
  html.hcpb-invoice-print .site-footer,
  html.hcpb-invoice-print .site-navigation,
  html.hcpb-invoice-print #masthead,
  html.hcpb-invoice-print #colophon {
    display: none !important;
  }
}
