/* =========================================================
   Vyapsetu — Invoice Templates Section (Homepage 5-Card Showcase)
   & Dedicated 30 Invoice Templates Preview Page
   ========================================================= */

/* ---------- Section Container ---------- */
.invoice-templates-section {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 84px 0;
}

/* ---------- Pill Switcher: [ Thermal Prints | A4 Prints | A5 Prints ] ---------- */
.tpl-top-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.print-pill-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.print-pill-btn {
  padding: 11px 24px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #1e293b;
  font-size: 14.5px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.print-pill-btn:hover {
  color: #4f46e5;
}

.print-pill-btn.active {
  background: linear-gradient(135deg, #5b47fb 0%, #4f46e5 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.28);
}

.tpl-top-right-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.start-using-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2563eb;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, color 0.18s ease;
}

.start-using-link:hover {
  color: #4f46e5;
  transform: translateX(3px);
}

/* ---------- Realistic Visual Invoice Document Cards ---------- */
.homepage-5-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.full-30-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.rich-tpl-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  group: true;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.rich-tpl-card:hover {
  transform: translateY(-6px);
}

.rich-tpl-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  min-height: 22px;
}

.rich-tpl-theme-tag {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.rich-tpl-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Outer Card Shell holding the Realistic Miniature Invoice Sheet */
.rich-doc-frame {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.26s ease, border-color 0.26s ease;
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.rich-tpl-card:hover .rich-doc-frame {
  border-color: #6366f1;
  box-shadow: 0 20px 44px rgba(79, 70, 229, 0.15);
}

/* Hover Overlay Pill */
.rich-doc-hover-pill {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  transition: all 0.22s ease;
  z-index: 4;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.rich-tpl-card:hover .rich-doc-hover-pill {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Miniature Realistic Document Sheet */
.real-mini-doc {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px 11px;
  font-size: 6.4px;
  line-height: 1.34;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 390px;
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Ornate Corner Flourishes for Layout 1 (SK Trading Company Gold Frame) */
.ornate-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 3;
}
.ornate-corner.tl { top: 2px; left: 2px; }
.ornate-corner.tr { top: 2px; right: 2px; transform: scaleX(-1); }
.ornate-corner.bl { bottom: 2px; left: 2px; transform: scaleY(-1); }
.ornate-corner.br { bottom: 2px; right: 2px; transform: scale(-1, -1); }

/* Heritage River/Boat Watermark for Layout 2 (Parshwanath Medicare) */
.heritage-watermark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
  background: radial-gradient(circle at 50% 20%, rgba(251, 191, 36, 0.28), transparent 65%),
              linear-gradient(180deg, transparent 0%, rgba(14, 165, 233, 0.18) 65%, rgba(217, 119, 6, 0.22) 100%);
}
.real-mini-doc.theme-special > * {
  position: relative;
  z-index: 1;
}

/* Thermal Roll miniature modifier */
.real-mini-doc.is-thermal {
  width: 82%;
  margin: 0 auto;
  background: #fffef9;
  border-style: dashed;
  border-color: #cbd5e1;
  /* font-family: var(--font-mono, monospace); */
}

/* A5 Half-Sheet miniature modifier */
.real-mini-doc.is-a5 {
  min-height: 290px;
  border-top: 3px solid var(--mini-accent, #4f46e5);
}

/* Theme 1: Luxury Golden Border Theme (Like SK Trading Company in screenshot) */
.real-mini-doc.theme-luxury {
  border: 2px solid #d4af37;
  background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
  box-shadow: inset 0 0 0 2px #fdf8e7;
}

.real-mini-doc.theme-luxury .rm-th-row {
  background: linear-gradient(90deg, #c99e32 0%, #e4c158 100%);
  color: #1e293b;
}

.real-mini-doc.theme-luxury .rm-sub-bar {
  background: linear-gradient(90deg, #c99e32 0%, #e4c158 100%);
  color: #1e293b;
}

/* Theme 2: Special Artistic Header Theme (Like Parshwanath Medicare in screenshot) */
.real-mini-doc.theme-special {
  background: linear-gradient(180deg, #f5f3ff 0%, #fffbeb 28%, #ffffff 65%);
  border: 1px solid #cbd5e1;
}

.real-mini-doc.theme-special .rm-meta-strip {
  background: #1e293b;
  color: #ffffff;
  border-radius: 3px;
  padding: 4px 6px;
}

.real-mini-doc.theme-special .rm-th-row {
  background: #dfc99b;
  color: #0f172a;
}

/* Theme 3: Modern Indigo / Blue Theme */
.real-mini-doc.theme-indigo .rm-th-row {
  background: #4f46e5;
  color: #ffffff;
}
.real-mini-doc.theme-indigo .rm-sub-bar {
  background: #eef2ff;
  color: #312e81;
}

/* Theme 4: Emerald / Pharma / Retail Theme */
.real-mini-doc.theme-emerald .rm-th-row {
  background: #059669;
  color: #ffffff;
}
.real-mini-doc.theme-emerald .rm-sub-bar {
  background: #ecfdf5;
  color: #065f46;
}

/* Theme 5: Royal Blue / IGST / Corporate Theme */
.real-mini-doc.theme-blue .rm-th-row {
  background: #2563eb;
  color: #ffffff;
}
.real-mini-doc.theme-blue .rm-sub-bar {
  background: #eff6ff;
  color: #1e40af;
}

/* Theme 6: Rose / Crimson Theme */
.real-mini-doc.theme-rose .rm-th-row {
  background: #e11d48;
  color: #ffffff;
}
.real-mini-doc.theme-rose .rm-sub-bar {
  background: #fff1f2;
  color: #9f1239;
}

/* Theme 7: Teal / Modern Theme */
.real-mini-doc.theme-teal .rm-th-row {
  background: #0d9488;
  color: #ffffff;
}
.real-mini-doc.theme-teal .rm-sub-bar {
  background: #f0fdfa;
  color: #115e59;
}

/* Internal Miniature Invoice Anatomy */
.rm-top-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 5px;
}

.rm-logo-box {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 7px;
  color: #4f46e5;
  flex-shrink: 0;
}

.rm-seller-info {
  flex: 1;
}

.rm-seller-info strong {
  display: block;
  font-size: 8.5px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.rm-seller-info span {
  display: block;
  font-size: 5.8px;
  color: #64748b;
}

.rm-tax-tag {
  font-size: 6px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rm-meta-strip {
  display: flex;
  justify-content: space-between;
  font-size: 5.8px;
  padding: 3px 5px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 5px;
}

.rm-billto {
  margin-bottom: 6px;
  font-size: 6px;
}

.rm-billto strong {
  display: block;
  font-size: 7px;
  color: #0f172a;
}

.rm-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 5px;
  font-size: 5.2px;
}

.rm-table th {
  padding: 2.5px 2px;
  text-align: left;
  font-weight: 800;
  white-space: nowrap;
}

.rm-th-row th {
  padding: 2.5px 2px;
  text-align: left;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.rm-table td {
  padding: 3px 2px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
}

.rm-table th.r,
.rm-table td.r {
  text-align: right;
}

.rm-sub-bar {
  display: flex;
  justify-content: space-between;
  padding: 3px 5px;
  font-weight: 800;
  font-size: 6.5px;
  border-radius: 2px;
  margin-bottom: 6px;
}

.rm-bottom-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 6px;
  font-size: 5.5px;
  color: #64748b;
  padding-top: 4px;
  border-top: 1px solid #e2e8f0;
}

.rm-totals-mini div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5px;
}

.rm-totals-mini div.bold {
  font-weight: 800;
  color: #0f172a;
  font-size: 6.5px;
  border-top: 1px solid #cbd5e1;
  padding-top: 2px;
}

.rm-qr-sign-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}

.rm-mini-qr {
  width: 22px;
  height: 22px;
  border: 1px solid #0f172a;
  padding: 2px;
  background: #ffffff;
}

.rm-mini-sign {
  text-align: right;
  font-size: 5.5px;
}

.rm-sign-scrawl {
  /* font-family: Georgia, serif; */
  font-style: italic;
  font-size: 8px;
  color: #1e293b;
}

/* "Customize Your Own Invoice" Blueprint Card (Matches Right Card in Screenshot) */
.real-mini-doc.theme-blueprint {
  background: #ffffff;
  border: 1.5px solid #dbeafe;
  padding: 10px;
}

.bp-tag {
  display: inline-block;
  background: #0284c7;
  color: #ffffff;
  font-size: 6px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 3px;
  margin-bottom: 3px;
}

.bp-dashed-box {
  border: 1.5px dashed #38bdf8;
  border-radius: 6px;
  padding: 7px;
  background: rgba(240, 249, 255, 0.45);
  margin-bottom: 6px;
}

.bp-center-cta {
  border: 1.5px dashed #7dd3fc;
  border-radius: 8px;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  padding: 18px 10px;
  text-align: center;
  margin: 6px 0;
}

.bp-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #e0f2fe;
  color: #0284c7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
}

.bp-center-cta strong {
  display: block;
  font-size: 8.5px;
  color: #0f172a;
}

.rich-card-caption {
  padding: 10px 4px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rich-card-caption h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.rich-card-caption span {
  font-size: 12px;
  font-weight: 700;
  color: #4f46e5;
  white-space: nowrap;
}

/* Homepage "See More Templates" Footer Bar */
.tpl-see-more-bar {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* =========================================================
   DEDICATED INVOICE TEMPLATE PREVIEW & 30-GALLERY PAGE
   (invoice-template-preview.html)
   ========================================================= */
.preview-page-hero {
  background:
    radial-gradient(60% 55% at 75% 15%, rgba(79, 70, 229, 0.08) 0%, transparent 100%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--border-color);
}

.preview-header-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.preview-title-group h1 {
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.025em;
  margin: 6px 0;
}

.preview-title-group p {
  font-size: 15px;
  color: var(--slate-600);
  max-width: 680px;
}

.preview-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Workspace Layout: Sidebar Controls + Live Invoice Sheet */
.preview-workspace {
  padding: 32px 0 64px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-color);
}

.preview-workspace-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.preview-sidebar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ctrl-group h4 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-500);
  margin-bottom: 10px;
}

.ctrl-select,
.ctrl-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-size: 13.5px;
  font-weight: 600;
  /* font-family: inherit; */
  color: var(--navy-900);
  background: #ffffff;
}

.ctrl-select:focus,
.ctrl-input:focus {
  outline: none;
  border-color: var(--brand-indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--border-strong);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.swatch-btn:hover {
  transform: scale(1.1);
}

.swatch-btn.active {
  box-shadow: 0 0 0 2.5px var(--navy-900);
  transform: scale(1.1);
}

.paper-size-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.paper-btn {
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-600);
}

.paper-btn.active {
  background: var(--navy-900);
  color: #ffffff;
  border-color: var(--navy-900);
}

.toggle-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-800);
}

.toggle-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Dimension Spec Bar above Live Invoice Paper */
.paper-spec-banner {
  width: 100%;
  max-width: 860px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
  font-size: 12.5px;
}

.paper-spec-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.spec-switch-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-600);
  transition: all 0.18s ease;
}

.spec-switch-btn:hover {
  border-color: var(--brand-indigo);
  color: var(--brand-indigo);
}

.spec-switch-btn.active {
  background: var(--navy-900);
  color: #ffffff;
  border-color: var(--navy-900);
}

/* Live Full-Scale Printable Invoice Sheet */
.invoice-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.invoice-paper {
  --inv-accent: #4f46e5;
  --inv-accent-soft: #eef2ff;
  width: 100%;
  max-width: 860px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  padding: 42px 44px;
  color: #0f172a;
  font-size: 13.5px;
  line-height: 1.5;
  transition: max-width 0.25s ease, padding 0.25s ease;
  position: relative;
}

.invoice-paper.paper-a5 {
  max-width: 680px;
  padding: 28px 30px;
  font-size: 12.5px;
}

.invoice-paper.paper-thermal {
  max-width: 380px;
  padding: 24px 20px;
  /* font-family: var(--font-mono); */
  font-size: 12px;
  border-style: dashed;
  border-width: 2px;
}

.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 3px solid var(--inv-accent);
  margin-bottom: 22px;
}

.invoice-paper.layout-banner .inv-header {
  background: var(--inv-accent);
  color: #ffffff;
  margin: -42px -44px 24px;
  padding: 32px 44px;
  border-radius: 11px 11px 0 0;
  border-bottom: 0;
}

.invoice-paper.layout-banner .inv-company h2,
.invoice-paper.layout-banner .inv-doc-title h3,
.invoice-paper.layout-banner .inv-company p,
.invoice-paper.layout-banner .inv-doc-title p {
  color: #ffffff !important;
}

.inv-company h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.inv-company p {
  font-size: 12.5px;
  color: var(--slate-600);
}

.inv-doc-title {
  text-align: right;
}

.inv-doc-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--inv-accent-soft);
  color: var(--inv-accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.invoice-paper.layout-banner .inv-doc-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.inv-doc-title h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--inv-accent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.inv-parties-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.9fr;
  gap: 16px;
  margin-bottom: 22px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.invoice-paper.paper-thermal .inv-parties-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.inv-party-box h5 {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--inv-accent);
  margin: 0 0 4px;
}

.inv-party-box strong {
  display: block;
  font-size: 13.5px;
  color: var(--navy-900);
  margin-bottom: 2px;
}

.inv-party-box p {
  font-size: 12px;
  color: var(--slate-600);
}

.inv-extra-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 14px;
  background: var(--inv-accent-soft);
  border-left: 4px solid var(--inv-accent);
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--navy-800);
}

.inv-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 22px;
}

.inv-items-table th {
  background: var(--inv-accent);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  text-align: left;
}

.inv-items-table th.num,
.inv-items-table td.num {
  text-align: right;
}

.inv-items-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: var(--navy-800);
  font-size: 13px;
}

.inv-items-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.inv-summary-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}

.invoice-paper.paper-thermal .inv-summary-grid {
  grid-template-columns: 1fr;
}

.inv-payment-box {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 12px;
}

.inv-qr-svg {
  width: 74px;
  height: 74px;
  flex-shrink: 0;
  background: #ffffff;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.inv-bank-details h5 {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--inv-accent);
  margin: 0 0 4px;
}

.inv-bank-details p {
  font-size: 11.5px;
  color: var(--slate-600);
  line-height: 1.45;
}

.inv-totals-box {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.inv-total-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
}

.inv-total-row.grand {
  background: var(--inv-accent);
  color: #ffffff;
  font-size: 15.5px;
  font-weight: 800;
  padding: 12px 14px;
  border-bottom: 0;
}

.inv-sign-row {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 11.5px;
  color: var(--slate-500);
}

.inv-sign-box {
  text-align: right;
}

.inv-sign-line {
  width: 150px;
  border-bottom: 1.5px solid var(--navy-900);
  margin: 24px 0 4px auto;
}

/* =========================================================
   THERMAL PRINTS DUAL SHOWCASE (ONLY 2: "2 inch" & "3 inch")
   Matches the exact overlapping 2-inch & 3-inch thermal receipt design
   ========================================================= */
.thermal-dual-stage {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 18px 56px 24px;
  position: relative;
  min-height: 540px;
}

.thermal-receipt-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px 16px 6px 6px;
  padding: 20px 18px 18px;
  font-family: var(--font, 'Montserrat', -apple-system, sans-serif);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  cursor: pointer;
}

/* Left Receipt: 2 inch (tucked slightly behind the 3 inch receipt on the right) */
.thermal-receipt-card.is-2inch {
  width: 268px;
  margin-top: 52px;
  margin-right: -34px;
  z-index: 1;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  font-size: 8.5px;
  line-height: 1.38;
}

/* Right Receipt: 3 inch (foregrounded, overlapping the right edge of 2 inch) */
.thermal-receipt-card.is-3inch {
  width: 332px;
  z-index: 2;
  box-shadow: -14px 12px 38px rgba(15, 23, 42, 0.12), 0 16px 40px rgba(15, 23, 42, 0.08);
  font-size: 9.5px;
  line-height: 1.42;
}

.thermal-receipt-card:hover {
  z-index: 4;
  transform: translateY(-6px);
  border-color: #6366f1;
  box-shadow: 0 24px 52px rgba(79, 70, 229, 0.18);
}

/* Floating Purple/Indigo "2 inch" and "3 inch" Badges */
.thermal-inch-badge {
  position: absolute;
  background: #5b4ef5;
  color: #ffffff;
  font-family: var(--font, 'Montserrat', sans-serif);
  font-size: 16px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(91, 78, 245, 0.32);
  white-space: nowrap;
  z-index: 5;
  letter-spacing: -0.01em;
}

.thermal-inch-badge.badge-2inch {
  left: -46px;
  top: 42px;
}

.thermal-inch-badge.badge-3inch {
  right: -44px;
  top: 38px;
}

/* Internal Receipt Typography & Anatomy */
.tr-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.tr-center-head {
  text-align: center;
  margin-bottom: 8px;
  color: #0f172a;
}

.tr-center-head div {
  font-weight: 600;
}

.tr-tax-title {
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 6px 0;
  color: #0f172a;
}

.tr-meta-block {
  margin-bottom: 6px;
  color: #0f172a;
}

.tr-meta-row-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tr-meta-block strong {
  font-weight: 700;
}

.tr-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.tr-table thead tr {
  border-top: 1px solid #94a3b8;
  border-bottom: 1px solid #94a3b8;
}

.tr-table th {
  padding: 4px 2px;
  font-weight: 800;
  text-align: left;
  color: #0f172a;
}

.tr-table td {
  padding: 4px 2px 1px;
  vertical-align: top;
  color: #0f172a;
}

.tr-table .r {
  text-align: right;
}

.tr-table .c {
  text-align: center;
}

.tr-item-desc {
  padding: 0 2px 4px 12px !important;
  color: #334155;
  font-size: 0.88em;
  line-height: 1.3;
}

.tr-divider {
  border-top: 1px solid #94a3b8;
  margin: 5px 0;
}

.tr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5px 0;
  color: #0f172a;
}

.tr-row.bold {
  font-weight: 800;
}

.tr-notes-block {
  margin-top: 6px;
  color: #0f172a;
  font-size: 0.92em;
  line-height: 1.35;
}

.tr-notes-block strong {
  display: block;
  font-weight: 800;
  margin-top: 4px;
  margin-bottom: 1px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .homepage-5-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .full-30-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  .homepage-5-grid,
  .full-30-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .preview-workspace-grid {
    grid-template-columns: 1fr;
  }
  .preview-sidebar {
    position: static;
  }
  .tpl-top-controls {
    justify-content: center;
    text-align: center;
  }
  .tpl-top-right-links {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .invoice-templates-section {
    padding: 60px 0;
  }
  .thermal-dual-stage {
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 16px 20px;
    min-height: auto;
  }
  .thermal-receipt-card.is-2inch,
  .thermal-receipt-card.is-3inch {
    width: 100%;
    max-width: 320px;
    margin: 0;
  }
  .thermal-inch-badge.badge-2inch {
    left: 10px;
    top: -14px;
    font-size: 13.5px;
    padding: 6px 14px;
  }
  .thermal-inch-badge.badge-3inch {
    right: 10px;
    top: -14px;
    font-size: 13.5px;
    padding: 6px 14px;
  }
}

@media (max-width: 640px) {
  .homepage-5-grid,
  .full-30-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .print-pill-switcher {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    padding: 5px;
    gap: 4px;
  }
  .print-pill-btn {
    padding: 9px 6px;
    font-size: 12.5px;
    text-align: center;
    white-space: nowrap;
  }
  .tpl-top-right-links {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .tpl-top-right-links .btn {
    width: 100%;
    justify-content: center;
  }
  .tpl-see-more-bar .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
    padding: 13px 16px;
    font-size: 14px;
    line-height: 1.35;
  }
  .invoice-paper {
    padding: 24px 18px;
  }
  .inv-header {
    flex-direction: column;
  }
  .inv-doc-title {
    text-align: left;
  }
  .inv-parties-grid,
  .inv-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Clean Print Media Query for Exporting / Printing Any Invoice Template */
@media print {
  .site-header,
  .preview-page-hero,
  .preview-sidebar,
  .paper-spec-banner,
  .invoice-templates-section,
  .site-footer,
  .chat-fab,
  .chat-widget,
  .to-top {
    display: none !important;
  }
  body,
  .preview-workspace {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
  }
  .preview-workspace-grid {
    display: block !important;
  }
  .invoice-paper {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    max-width: 100% !important;
  }
}
