/* =========================================================
   STOREFRONT INVOICE EXPERIENCE
   Presentation-only layer for every public invoice state and
   the checkout confirmation dialog. Business logic, output,
   polling, QRIS and fulfillment conditions remain unchanged.
   ========================================================= */

:where(.storefront-invoice-page, body.storefront-checkout-page) {
  --invoice-canvas: #f2f6f2;
  --invoice-surface: #fffefd;
  --invoice-surface-soft: #f3f7f3;
  --invoice-surface-quiet: #edf3ee;
  --invoice-text: #17251d;
  --invoice-text-soft: #46564c;
  --invoice-text-muted: #728078;
  --invoice-primary: #2f7258;
  --invoice-primary-deep: #245943;
  --invoice-border: #d6e1d9;
  --invoice-border-strong: #c2d3c7;
  --invoice-danger: #aa5a54;
  --invoice-warning: #9a712f;
  --invoice-radius-xl: 1.65rem;
  --invoice-radius-lg: 1.2rem;
  --invoice-shadow: 0 24px 70px rgba(27, 58, 41, 0.1);
}

.storefront-invoice-page {
  min-height: calc(100vh - 72px);
  color: var(--invoice-text);
  background:
    radial-gradient(circle at 10% 4rem, rgba(101, 151, 119, 0.12), transparent 25rem),
    radial-gradient(circle at 92% 28rem, rgba(218, 197, 151, 0.12), transparent 24rem),
    linear-gradient(180deg, #f8faf8 0%, var(--invoice-canvas) 55%, #edf3ee 100%);
}

.storefront-invoice-shell {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
  padding-block: clamp(1.5rem, 3.5vw, 3.4rem) 4rem;
}

.storefront-invoice-card {
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.storefront-invoice-decorations,
.storefront-receipt-divider {
  display: none;
}

.storefront-invoice-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.storefront-invoice-hero,
.storefront-qris-section,
.storefront-invoice-summary,
.storefront-invoice-detail,
.storefront-purchase-success {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--invoice-border);
  border-radius: var(--invoice-radius-xl);
  background: var(--invoice-surface);
  box-shadow: var(--invoice-shadow);
}

.storefront-invoice-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.storefront-invoice-hero::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.35rem;
  background: linear-gradient(180deg, var(--invoice-primary), rgba(47, 114, 88, 0.22));
}

.storefront-invoice-heading {
  min-width: 0;
}

.storefront-invoice-label,
.storefront-qris-eyebrow {
  color: var(--invoice-primary);
  font-family: 'Manrope', sans-serif;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.storefront-invoice-token {
  max-width: 100%;
  margin-top: 0.35rem;
  color: var(--invoice-text);
  font-family: 'Manrope', sans-serif;
  font-size: clamp(1.05rem, 2.3vw, 1.5rem);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.storefront-invoice-subtitle {
  max-width: 36rem;
  margin-top: 0.5rem;
  color: var(--invoice-text-soft);
  font-family: 'Manrope', sans-serif;
  font-size: 0.86rem;
  line-height: 1.65;
}

.storefront-invoice-status {
  min-height: 2.2rem;
  padding: 0.55rem 0.82rem;
  border-radius: 999px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.storefront-invoice-status.is-success,
#invoice-status[data-status='PAID'],
#invoice-status[data-status='FULFILLING'] {
  color: var(--invoice-primary-deep);
  border: 1px solid #bad5c4;
  background: #e7f3eb;
}

.storefront-invoice-status.is-pending {
  color: #865f22;
  border: 1px solid #e5ce9f;
  background: #fff5de;
}

.storefront-invoice-status.is-danger,
#invoice-status[data-status='FULFILLMENT_FAILED'],
#invoice-status[data-status='FAILED'],
#invoice-status[data-status='CANCELLED'] {
  color: #9b4e49;
  border: 1px solid #e6c1bd;
  background: #fff0ee;
}

.storefront-invoice-status.is-neutral {
  color: var(--invoice-text-soft);
  border: 1px solid var(--invoice-border);
  background: var(--invoice-surface-soft);
}

.storefront-invoice-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.storefront-invoice-copy-button {
  min-width: 0;
  min-height: 3.25rem;
  padding: 0.75rem 0.9rem 0.75rem 1rem;
  border: 1px solid var(--invoice-border);
  border-radius: 1rem;
  background: rgba(255, 254, 253, 0.84);
  box-shadow: none;
  font-family: 'Manrope', sans-serif;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.storefront-invoice-copy-button:hover {
  border-color: var(--invoice-border-strong);
  background: var(--invoice-surface);
  transform: translateY(-1px);
}

.storefront-invoice-copy-value {
  color: var(--invoice-text-soft);
  font-size: 0.74rem;
  line-height: 1.4;
}

.storefront-invoice-copy-action {
  color: var(--invoice-primary);
  font-size: 0.72rem;
  font-weight: 800;
}

.storefront-qris-section,
.storefront-invoice-summary,
.storefront-invoice-detail {
  margin: 0;
  padding: clamp(1.15rem, 2.5vw, 1.65rem);
}

.storefront-qris-section {
  border-top: 1px solid var(--invoice-border);
}

.storefront-qris-header {
  justify-content: flex-start;
  margin-bottom: 1rem;
  text-align: left;
}

.storefront-qris-icon {
  width: 2.8rem;
  height: 2.8rem;
  border-color: var(--invoice-border-strong);
  border-radius: 0.9rem;
  color: var(--invoice-primary);
  background: var(--invoice-surface-soft);
}

.storefront-qris-title,
.storefront-invoice-detail-title,
.storefront-purchase-success-title {
  color: var(--invoice-text);
}

.storefront-qris-title {
  margin: 0.12rem 0 0;
  font-family: 'Source Serif 4', serif;
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.storefront-sandbox-notice,
.storefront-qris-state {
  border-radius: 1rem;
  font-family: 'Manrope', sans-serif;
}

.storefront-qris-wrap {
  width: min(100%, 25rem);
  margin-inline: auto;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  border-color: var(--invoice-border);
  border-radius: 1.2rem;
  background: #fff;
  box-shadow: none;
}

.storefront-qris-wrap::before,
.storefront-qris-corner {
  display: none;
}

.storefront-qris-wrap #qrcode,
.storefront-qris-wrap #qrcode canvas,
.storefront-qris-wrap #qrcode img {
  width: 220px !important;
  max-width: 100%;
  height: 220px !important;
  margin-inline: auto;
}

.storefront-qris-instruction {
  margin-top: 0.75rem;
  color: var(--invoice-text-soft);
  font-family: 'Manrope', sans-serif;
  font-size: 0.76rem;
  line-height: 1.6;
}

.storefront-qris-trust {
  margin-top: 0.85rem;
  color: var(--invoice-text-muted);
  font-family: 'Manrope', sans-serif;
  font-size: 0.66rem;
}

.storefront-qris-retry-button {
  min-height: 2.8rem;
  border-radius: 0.9rem;
  color: #fff;
  background: var(--invoice-primary);
  box-shadow: none;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
}

.storefront-invoice-summary {
  display: grid;
  align-content: start;
  gap: 0;
  padding: 0.45rem clamp(1.15rem, 2.5vw, 1.55rem);
  border-top: 1px solid var(--invoice-border);
  font-family: 'Manrope', sans-serif;
  font-size: 0.82rem;
}

.storefront-invoice-summary-row,
.storefront-invoice-summary > .storefront-invoice-total-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 1rem;
  min-height: 3.25rem;
  margin: 0;
  padding: 0.9rem 0;
  border: 0;
  border-bottom: 1px solid var(--invoice-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.storefront-invoice-summary > :last-child {
  border-bottom: 0;
}

.storefront-invoice-summary-label {
  color: var(--invoice-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
}

.storefront-invoice-summary-value {
  max-width: none;
  color: var(--invoice-text);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.5;
  text-align: right;
  overflow-wrap: anywhere;
}

.storefront-invoice-total-panel {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  padding-block: 1rem !important;
}

.storefront-invoice-total-label {
  color: var(--invoice-text);
  font-size: 0.78rem;
  font-weight: 800;
}

.storefront-invoice-total-note {
  color: var(--invoice-text-muted);
  font-size: 0.66rem;
}

.storefront-invoice-total-panel .storefront-invoice-total {
  color: var(--invoice-primary);
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  font-weight: 800;
  text-align: right;
}

.storefront-invoice-countdown {
  display: inline-flex;
  justify-self: end;
  min-height: 2rem;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border: 1px solid #e6cea2;
  border-radius: 999px;
  color: #805b25;
  background: #fff6e3;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.storefront-purchase-success {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  margin: 0;
  padding: clamp(1.1rem, 2.6vw, 1.55rem);
  border-color: #bfd8c7;
  background: linear-gradient(135deg, #edf7f0, #fffefd 72%);
  box-shadow: none;
}

.storefront-purchase-success-icon {
  width: 3rem;
  height: 3rem;
  border: 0;
  background: var(--invoice-primary);
  box-shadow: none;
}

.storefront-purchase-success-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.storefront-purchase-success-text {
  color: var(--invoice-text-soft);
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
  line-height: 1.6;
}

.storefront-purchase-success-button {
  min-height: 2.8rem;
  border-radius: 0.9rem;
  background: var(--invoice-primary);
  box-shadow: none;
  font-family: 'Manrope', sans-serif;
  font-size: 0.75rem;
}

.storefront-invoice-detail {
  padding: clamp(1.15rem, 2.5vw, 1.55rem);
  border-top: 1px solid var(--invoice-border);
}

.storefront-invoice-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.storefront-invoice-detail-title {
  font-family: 'Source Serif 4', serif;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.storefront-delivery-card {
  margin: 0 0 0.75rem;
  padding: 1rem;
  border-color: var(--invoice-border);
  border-radius: 1rem;
  background: var(--invoice-surface-soft);
  box-shadow: none;
  font-family: 'Manrope', sans-serif;
  font-size: 0.79rem;
}

.storefront-delivery-unit-label {
  color: var(--invoice-primary);
}

.storefront-delivery-key {
  color: var(--invoice-text-muted);
  font-weight: 650;
}

.storefront-delivery-value {
  color: var(--invoice-text);
}

.storefront-delivery-link {
  color: var(--invoice-primary);
}

.storefront-invoice-message {
  margin: 0;
  padding: 1rem 1.05rem;
  border: 1px solid var(--invoice-border);
  border-radius: 1rem;
  color: var(--invoice-text-soft);
  background: var(--invoice-surface-soft);
  font-family: 'Manrope', sans-serif;
  font-size: 0.82rem;
  line-height: 1.7;
}

.storefront-invoice-page[data-current-status='FULFILLMENT_FAILED'] .storefront-invoice-message,
.storefront-invoice-page[data-current-status='EXPIRED'] .storefront-invoice-message,
.storefront-invoice-page[data-current-status='REFUNDED'] .storefront-invoice-message,
.storefront-invoice-page[data-current-status='FAILED'] .storefront-invoice-message,
.storefront-invoice-page[data-current-status='CANCELLED'] .storefront-invoice-message {
  border-color: #e5c4c0;
  color: #874a45;
  background: #fff3f1;
}

.storefront-invoice-page[data-current-status='PENDING_PAYMENT'] .storefront-invoice-message {
  border-color: #ead6ac;
  color: #7d5d2c;
  background: #fff8e9;
}

.storefront-invoice-hidden-count {
  color: var(--invoice-text-muted);
  font-family: 'Manrope', sans-serif;
}

.storefront-copy-all-button {
  min-height: 2.9rem;
  margin-top: 0.2rem;
  border-color: var(--invoice-border-strong);
  border-radius: 0.9rem;
  color: var(--invoice-primary);
  background: var(--invoice-surface-soft);
  box-shadow: none;
  font-family: 'Manrope', sans-serif;
}

.storefront-invoice-support {
  margin: 0;
  padding: 0.25rem 0 0;
  border: 0;
  text-align: center;
}

.storefront-invoice-support-link {
  min-height: 2.9rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--invoice-border);
  border-radius: 999px;
  color: var(--invoice-primary);
  background: rgba(255, 254, 253, 0.72);
  font-family: 'Manrope', sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
}

/* Checkout confirmation — same visual language, unchanged copy and flow. */
body.storefront-checkout-page .storefront-confirmation-modal {
  padding: 1rem;
  transition: opacity 180ms ease, visibility 180ms ease;
}

body.storefront-checkout-page .storefront-confirmation-backdrop {
  background: rgba(13, 28, 20, 0.58);
  backdrop-filter: blur(10px);
}

body.storefront-checkout-page .storefront-confirmation-dialog {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.2rem 1rem;
  width: min(100%, 30rem);
  padding: 1.55rem;
  overflow: hidden;
  border: 1px solid var(--invoice-border);
  border-radius: 1.55rem 1.55rem 1.55rem 0.7rem;
  color: var(--invoice-text);
  background: var(--invoice-surface);
  box-shadow: 0 32px 90px rgba(10, 31, 19, 0.28);
  text-align: left;
  transform: translateY(14px) scale(0.97);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.storefront-checkout-page .storefront-confirmation-dialog::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 0.3rem;
  background: linear-gradient(90deg, var(--invoice-primary), #91b9a1 62%, transparent);
}

body.storefront-checkout-page .storefront-confirmation-modal.is-open .storefront-confirmation-dialog {
  transform: translateY(0) scale(1);
}

body.storefront-checkout-page .storefront-confirmation-icon {
  grid-row: 1 / 4;
  width: 3.3rem;
  height: 3.3rem;
  margin: 0;
  border: 1px solid var(--invoice-border-strong);
  border-radius: 1rem;
  color: var(--invoice-primary);
  background: var(--invoice-surface-soft);
}

body.storefront-checkout-page .storefront-confirmation-eyebrow {
  align-self: end;
  color: var(--invoice-primary);
  font-family: 'Manrope', sans-serif;
  font-size: 0.63rem;
}

body.storefront-checkout-page .storefront-confirmation-dialog h2 {
  margin: 0.15rem 0 0;
  font-family: 'Source Serif 4', serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.05;
}

body.storefront-checkout-page .storefront-confirmation-dialog > p:not(.storefront-confirmation-eyebrow) {
  max-width: none;
  margin: 0.45rem 0 0;
  color: var(--invoice-text-soft);
  font-family: 'Manrope', sans-serif;
  font-size: 0.79rem;
  line-height: 1.65;
}

body.storefront-checkout-page .storefront-confirmation-actions {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}

body.storefront-checkout-page .storefront-confirmation-actions button {
  min-height: 3rem;
  border-radius: 0.9rem;
  font-family: 'Manrope', sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
}

body.storefront-checkout-page .storefront-confirmation-cancel {
  border: 1px solid var(--invoice-border);
  color: var(--invoice-text-soft);
  background: var(--invoice-surface-soft);
}

body.storefront-checkout-page .storefront-confirmation-accept {
  color: #fff;
  background: var(--invoice-primary);
  box-shadow: none;
}

body.storefront-checkout-page .storefront-confirmation-accept:hover:not(:disabled) {
  background: var(--invoice-primary-deep);
}

body.storefront-checkout-page .storefront-confirmation-close {
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--invoice-border);
  color: var(--invoice-text-muted);
  background: var(--invoice-surface-soft);
}

@media (min-width: 860px) {
  .storefront-invoice-page[data-current-status='PENDING_PAYMENT'] .storefront-invoice-content {
    grid-template-columns: minmax(0, 1.06fr) minmax(20rem, 0.94fr);
    align-items: start;
  }

  .storefront-invoice-page[data-current-status='PENDING_PAYMENT'] .storefront-invoice-hero,
  .storefront-invoice-page[data-current-status='PENDING_PAYMENT'] .storefront-invoice-copy-grid,
  .storefront-invoice-page[data-current-status='PENDING_PAYMENT'] .storefront-purchase-success,
  .storefront-invoice-page[data-current-status='PENDING_PAYMENT'] .storefront-invoice-detail,
  .storefront-invoice-page[data-current-status='PENDING_PAYMENT'] .storefront-invoice-support {
    grid-column: 1 / -1;
  }

  .storefront-invoice-page[data-current-status='PENDING_PAYMENT'] .storefront-qris-section {
    grid-column: 1;
    align-self: start;
  }

  .storefront-invoice-page[data-current-status='PENDING_PAYMENT'] .storefront-invoice-summary {
    position: static;
    top: auto;
    grid-column: 2;
    align-self: start;
  }

  .storefront-invoice-page:not([data-current-status='PENDING_PAYMENT']) .storefront-invoice-content {
    width: min(100%, 52rem);
    margin-inline: auto;
  }
}

@media (max-width: 639px) {
  .storefront-invoice-shell {
    width: min(100% - 1rem, 72rem);
    padding-block: 0.85rem 2.5rem;
  }

  .storefront-invoice-content {
    gap: 0.75rem;
  }

  .storefront-invoice-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
    padding: 1.1rem;
    border-radius: 1.25rem;
  }

  .storefront-invoice-status {
    justify-self: start;
  }

  .storefront-invoice-subtitle {
    font-size: 0.78rem;
  }

  .storefront-invoice-copy-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
  }

  .storefront-invoice-copy-button {
    min-height: 3rem;
  }

  .storefront-qris-section,
  .storefront-invoice-summary,
  .storefront-invoice-detail,
  .storefront-purchase-success {
    border-radius: 1.25rem;
  }

  .storefront-qris-section,
  .storefront-invoice-detail {
    padding: 1rem;
  }

  .storefront-qris-wrap #qrcode,
  .storefront-qris-wrap #qrcode canvas,
  .storefront-qris-wrap #qrcode img {
    width: 205px !important;
    height: 205px !important;
  }

  .storefront-invoice-summary {
    padding-inline: 1rem;
  }

  .storefront-invoice-summary-row,
  .storefront-invoice-summary > .storefront-invoice-total-panel {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 0.65rem;
    min-height: 3rem;
    padding-block: 0.8rem;
  }

  .storefront-invoice-summary > .storefront-invoice-total-panel {
    grid-template-columns: minmax(0, 1fr) max-content !important;
    align-items: center !important;
  }

  .storefront-invoice-total-panel .storefront-invoice-total {
    min-width: max-content;
    font-size: 1.15rem;
    line-height: 1.15;
    white-space: nowrap;
  }

  .storefront-invoice-summary-label {
    font-size: 0.68rem;
  }

  .storefront-invoice-summary-value {
    font-size: 0.75rem;
  }

  .storefront-invoice-countdown {
    justify-self: end;
    padding-inline: 0.52rem;
    font-size: 0.67rem;
  }

  .storefront-purchase-success {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    padding: 1rem;
    text-align: left;
  }

  .storefront-purchase-success-icon {
    margin: 0;
  }

  .storefront-purchase-success-button {
    width: 100%;
  }

  .storefront-delivery-card {
    padding: 0.85rem;
  }

  .storefront-delivery-card .flex {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  }

  .storefront-delivery-key,
  .storefront-delivery-value,
  .storefront-delivery-link {
    max-width: none;
  }

  body.storefront-checkout-page .storefront-confirmation-dialog {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.15rem 0.75rem;
    padding: 1.35rem 1rem 1rem;
    border-radius: 1.35rem 1.35rem 1.35rem 0.6rem;
  }

  body.storefront-checkout-page .storefront-confirmation-icon {
    width: 2.8rem;
    height: 2.8rem;
  }

  body.storefront-checkout-page .storefront-confirmation-dialog h2 {
    font-size: 1.65rem;
  }

  body.storefront-checkout-page .storefront-confirmation-dialog > p:not(.storefront-confirmation-eyebrow) {
    font-size: 0.74rem;
  }

  body.storefront-checkout-page .storefront-confirmation-actions {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 1rem;
  }
}

html[data-theme='dark'] :where(.storefront-invoice-page, body.storefront-checkout-page) {
  --invoice-canvas: #0d1712;
  --invoice-surface: #14231b;
  --invoice-surface-soft: #192b21;
  --invoice-surface-quiet: #112018;
  --invoice-text: #edf4ee;
  --invoice-text-soft: #c2cec4;
  --invoice-text-muted: #93a299;
  --invoice-primary: #9bcfaf;
  --invoice-primary-deep: #b8dec6;
  --invoice-border: #294236;
  --invoice-border-strong: #365447;
  --invoice-shadow: none;
}

html[data-theme='dark'] .storefront-invoice-page {
  background:
    radial-gradient(circle at 10% 4rem, rgba(78, 130, 96, 0.15), transparent 24rem),
    linear-gradient(180deg, #0f1a14 0%, var(--invoice-canvas) 65%, #0b140f 100%);
}

html[data-theme='dark'] .storefront-invoice-copy-button,
html[data-theme='dark'] .storefront-invoice-support-link {
  background: rgba(20, 35, 27, 0.84);
}

html[data-theme='dark'] .storefront-qris-wrap {
  background: #fff;
}

html[data-theme='dark'] .storefront-invoice-status.is-pending,
html[data-theme='dark'] .storefront-invoice-countdown {
  color: #e2bd7d;
  border-color: #5a4729;
  background: #2b2216;
}

html[data-theme='dark'] .storefront-invoice-status.is-danger,
html[data-theme='dark'] #invoice-status[data-status='FULFILLMENT_FAILED'],
html[data-theme='dark'] #invoice-status[data-status='FAILED'],
html[data-theme='dark'] #invoice-status[data-status='CANCELLED'] {
  color: #efaaa4;
  border-color: #60403c;
  background: #2b1b19;
}

html[data-theme='dark'] .storefront-invoice-status.is-success,
html[data-theme='dark'] #invoice-status[data-status='PAID'],
html[data-theme='dark'] #invoice-status[data-status='FULFILLING'] {
  color: #b8dec6;
  border-color: #365447;
  background: #1b3226;
}

html[data-theme='dark'] .storefront-purchase-success {
  border-color: var(--invoice-border-strong);
  background: linear-gradient(135deg, #1b3226, var(--invoice-surface) 72%);
}

html[data-theme='dark'] .storefront-invoice-page[data-current-status='FULFILLMENT_FAILED'] .storefront-invoice-message,
html[data-theme='dark'] .storefront-invoice-page[data-current-status='EXPIRED'] .storefront-invoice-message,
html[data-theme='dark'] .storefront-invoice-page[data-current-status='REFUNDED'] .storefront-invoice-message,
html[data-theme='dark'] .storefront-invoice-page[data-current-status='FAILED'] .storefront-invoice-message,
html[data-theme='dark'] .storefront-invoice-page[data-current-status='CANCELLED'] .storefront-invoice-message {
  border-color: #60403c;
  color: #efb3ae;
  background: #2b1b19;
}

html[data-theme='dark'] .storefront-invoice-page[data-current-status='PENDING_PAYMENT'] .storefront-invoice-message {
  border-color: #5a4729;
  color: #e2c28d;
  background: #2b2216;
}

html[data-theme='dark'] body.storefront-checkout-page .storefront-confirmation-dialog {
  color: var(--invoice-text);
  border-color: var(--invoice-border);
  background: var(--invoice-surface);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
}

html[data-theme='dark'] body.storefront-checkout-page .storefront-confirmation-icon,
html[data-theme='dark'] body.storefront-checkout-page .storefront-confirmation-close,
html[data-theme='dark'] body.storefront-checkout-page .storefront-confirmation-cancel {
  border-color: var(--invoice-border);
  color: var(--invoice-text-soft);
  background: var(--invoice-surface-soft);
}

/* Delivery notes sit directly after account/code data. Typography is kept
   deliberately spacious because these instructions are part of fulfillment,
   not secondary marketing copy. */
.storefront-delivery-notes {
  margin: 0.15rem 0 0.85rem;
  padding: 1rem 1.05rem 1.08rem;
  border: 1px solid var(--invoice-border);
  border-radius: 1rem;
  color: var(--invoice-text);
  background: var(--invoice-surface-soft);
  font-family: 'Manrope', sans-serif;
}

.storefront-delivery-notes-title {
  margin: 0 0 0.72rem;
  color: var(--invoice-text-muted);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.storefront-delivery-note-group + .storefront-delivery-note-group {
  margin-top: 0.95rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--invoice-border);
}

.storefront-delivery-note-label {
  margin: 0 0 0.48rem;
  color: var(--invoice-primary);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.45;
}

.storefront-delivery-note-document {
  color: var(--invoice-text-soft);
  font-size: 0.8rem;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.storefront-delivery-note-document p {
  margin: 0;
  white-space: pre-wrap;
}

.storefront-delivery-note-document p + p {
  margin-top: 0.82rem;
}

.storefront-delivery-note-document ul,
.storefront-delivery-note-document ol {
  margin: 0.7rem 0;
  padding-left: 1.35rem;
}

.storefront-delivery-note-document li {
  padding-left: 0.08rem;
  white-space: pre-wrap;
}

.storefront-delivery-note-document li + li {
  margin-top: 0.3rem;
}

.storefront-delivery-note-document strong {
  color: var(--invoice-text);
  font-weight: 800;
}

.storefront-delivery-note-document a {
  color: #2563eb;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.storefront-delivery-note-document a:hover,
.storefront-delivery-note-document a:focus-visible {
  text-decoration-thickness: 2px;
}

@media (max-width: 640px) {
  .storefront-delivery-notes {
    padding: 0.92rem 0.95rem 1rem;
  }

  .storefront-delivery-note-document {
    font-size: 0.78rem;
    line-height: 1.75;
  }
}
