/* Google Fonts for Grocery / Mart Templates */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   Template 1: Classic Mart / Grocery Receipt (Space Mono 450px) - Scoped: m1
   ========================================================================== */
.m1-wrapper {
  font-family: 'Space Mono', monospace;
  color: #000;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  text-align: center;
  display: flex;
  justify-content: center;
  font-size: 15px;
  line-height: 1.4;
  width: 100%;
}

.m1-bill {
  width: 450px;
  background: #ffffff;
  padding: 24px 20px;
  box-sizing: border-box;
  text-align: center;
  margin: 0 auto;
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  line-height: 1.4;
  color: #000;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.m1-bill.crambled-bg {
  background: url('../assets/images/crumpled-bg.png') !important;
  background-blend-mode: multiply !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}

.m1-brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.m1-logo-img {
  max-width: 100px;
  max-height: 50px;
  object-fit: contain;
}

.m1-mart-name {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.m1-address {
  font-size: 13px;
  color: #222;
  margin-bottom: 6px;
}

.m1-shop-details {
  font-size: 13px;
  font-weight: 600;
  margin: 3px 0;
}

.m1-title-badge {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  margin: 10px 0 6px;
  text-decoration: underline;
}

.m1-bill-details {
  margin: 10px 0;
  font-size: 13px;
}

.m1-flex {
  display: flex;
}

.m1-justify-between {
  justify-content: space-between;
}

.m1-table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 13px;
  margin: 12px 0;
}

.m1-table .m1-header th {
  border-top: 2px dashed #000;
  border-bottom: 2px dashed #000;
  padding: 6px 2px;
  font-weight: 700;
}

.m1-table td {
  padding: 5px 2px;
  vertical-align: top;
}

.m1-table .m1-total td {
  border-top: 2px dashed #000;
  border-bottom: 2px dashed #000;
  font-weight: 700;
  padding: 6px 2px;
}

.m1-table .m1-total td:first-of-type {
  border-top: none;
  border-bottom: none;
}

.m1-table .m1-net-amount td {
  border-top: 2px dashed #000;
  border-bottom: 2px dashed #000;
  font-weight: 700;
  padding: 6px 2px;
}

.m1-table .m1-net-amount td:first-of-type {
  border-top: none;
}

.m1-footer {
  font-size: 13px;
  line-height: 1.6;
  margin-top: 10px;
  border-top: 1px dashed #444;
  padding-top: 8px;
}


/* ==========================================================================
   Template 2: Modern Supermarket Tabular Invoice (Arial 450px) - Scoped: m2
   ========================================================================== */
.m2-outer {
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #111;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.m2-sheet {
  background-color: #fff;
  border-radius: 6px;
  padding: 20px;
  width: 450px;
  box-sizing: border-box;
  text-align: center;
  margin: 0 auto;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #111;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.m2-sheet.crambled-bg {
  background: url('../assets/images/crumpled-bg.png') !important;
  background-blend-mode: multiply !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}

.m2-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-direction: column;
}

.m2-mart-name {
  font-weight: bold;
  color: #000;
  margin-top: 8px;
  font-size: 18px;
  text-transform: uppercase;
}

.m2-address {
  margin: 6px auto;
  font-size: 13px;
  color: #444;
  line-height: 1.4;
}

.m2-meta-p {
  margin: 2px 0;
  font-size: 13px;
  color: #333;
}

.m2-divider {
  border: none;
  border-top: 1px dashed #838383;
  margin: 14px auto;
  width: 100%;
}

.m2-items-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 10px;
  font-size: 13px;
}

.m2-items-table th {
  padding: 8px 4px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  font-weight: 700;
  color: #222;
}

.m2-items-table td {
  padding: 8px 4px;
  text-align: left;
  border-top: 1px dashed #eee;
  word-break: break-word;
}

.m2-highlight-table {
  width: 100%;
  border-collapse: collapse;
  background: #fcbd024f !important;
  border-radius: 4px;
  font-size: 13px;
  margin: 6px 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.m2-highlight-table th {
  padding: 8px 6px;
  text-align: left;
}

.m2-savings-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  border: 1px dashed #00cd00;
  border-radius: 4px;
  font-size: 13px;
  background: #f0fff0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.m2-savings-table td {
  padding: 6px 8px;
  font-weight: 600;
  color: #008000;
}

.m2-footer {
  text-align: center;
  margin: 12px auto 0;
  line-height: 1.5;
  font-size: 12.5px;
  color: #4a4a4a;
}


/* ==========================================================================
   Template 3: Authentic 80mm Thermal POS Roll (Consolas 302px - DMart Style) - Scoped: dm
   ========================================================================== */
.dm-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

.dm-roll {
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.35;
  color: #111;
  background: #ffffff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  padding: 12px 10px;
  width: 302px;
  max-width: 302px;
  box-sizing: border-box;
  display: block;
  margin: 0 auto;
}

.dm-roll.crambled-bg {
  background: url('../assets/images/crumpled-bg.png') !important;
  background-blend-mode: multiply !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}

.dm-logo-block {
  text-align: center;
  margin-bottom: 4px;
}

.dm-logo-img {
  display: block;
  margin: 0 auto;
  max-width: 80px;
  max-height: 35px;
  object-fit: contain;
}

.dm-center {
  text-align: center;
  margin: 2px 0;
}

.dm-bold {
  font-weight: 700;
}

.dm-tiny {
  font-size: 9.5px;
  line-height: 1.3;
}

.dm-title {
  margin: 5px 0 3px;
  letter-spacing: 0.05em;
  font-size: 12px;
}

.dm-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin: 2px 0;
  text-align: left;
}

.dm-row-val {
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.dm-rule {
  width: 100%;
  margin: 5px 0;
  border: none;
}

.dm-rule-dash {
  border-top: 1px dashed #222;
}

.dm-rule-solid {
  border-top: 1px solid #222;
  margin-top: 6px;
}

.dm-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  table-layout: fixed;
}

.dm-items th,
.dm-items td {
  padding: 2px 2px 3px 0;
  vertical-align: top;
}

.dm-items th {
  font-weight: 700;
  text-align: left;
  border-bottom: 1px dashed #222;
}

.dm-c-part {
  width: 48%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dm-c-num {
  width: 16%;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dm-summary-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px;
  margin: 4px 0;
  font-size: 10.5px;
}

.dm-savings {
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  margin: 5px 0;
  color: #008000;
}

.dm-footer-addr {
  font-size: 9px;
  line-height: 1.35;
  text-align: center;
  margin: 6px 0 4px;
  overflow-wrap: anywhere;
}
