/* CityPaws order receipt — isolated to the standalone order page in both app
   and public shared-link contexts. Load before commerce-flow.css. */
@layer order-receipt {
  body[data-page="order"] {
    --receipt-forest: #104b37;
    --receipt-deep: #0b3b2b;
    --receipt-green-wash: #edf5ed;
    --receipt-paper: #fffefa;
    --receipt-ink: #202a24;
    --receipt-muted: #727a74;
    --receipt-line: #dce3dc;
    --receipt-gold: #b88a2c;
    --receipt-gold-soft: #e6d5a4;
    box-sizing: border-box !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 24px 16px 48px !important;
    overflow-x: clip !important;
    color: var(--receipt-ink) !important;
    background: #f1f3ed !important;
  }

  body[data-page="order"] *,
  body[data-page="order"] *::before,
  body[data-page="order"] *::after {
    box-sizing: border-box !important;
  }

  /* This route is a self-contained customer document, not the shopping shell. */
  body[data-page="order"] > :not(#app) {
    display: none !important;
  }

  body[data-page="order"] .flow-icon {
    display: inline-block !important;
    flex: 0 0 auto !important;
    width: 20px !important;
    height: 20px !important;
    fill: none !important;
    stroke: currentColor !important;
  }

  body[data-page="order"] #app {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  body[data-page="order"] .page.order-receipt-page {
    width: min(100%, 900px) !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    color: var(--receipt-ink) !important;
    background: transparent !important;
    direction: inherit !important;
    text-align: start !important;
  }

  body[data-page="order"] .receipt-back-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 9px 15px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--receipt-forest) !important;
    font: inherit !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    margin-block-end: 12px !important;
  }

  body[data-page="order"] .receipt-back-link:focus-visible {
    outline: 3px solid var(--receipt-gold) !important;
    outline-offset: 3px !important;
  }

  body[data-page="order"] .order-receipt-document {
    position: relative !important;
    isolation: isolate !important;
    width: min(100%, 794px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 34px clamp(22px, 4.2vw, 46px) 28px !important;
    overflow: hidden !important;
    border: 1px solid #e4e8e1 !important;
    border-radius: 3px !important;
    background: var(--receipt-paper) !important;
    color: var(--receipt-ink) !important;
    box-shadow: 0 12px 38px rgb(33 54 39 / 8%) !important;
    direction: inherit !important;
    text-align: start !important;
  }

  body[data-page="order"] .receipt-leaves {
    position: absolute !important;
    z-index: 0 !important;
    top: 0 !important;
    width: clamp(94px, 18vw, 190px) !important;
    height: clamp(105px, 19vw, 168px) !important;
    overflow: hidden !important;
    pointer-events: none !important;
    opacity: .82 !important;
  }

  body[data-page="order"] .receipt-leaves svg {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  body[data-page="order"] .receipt-leaves-start { inset-inline-start: 0 !important; }
  body[data-page="order"] .receipt-leaves-end { inset-inline-end: 0 !important; }

  body[data-page="order"] .receipt-brand {
    position: relative !important;
    z-index: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    min-height: 66px !important;
    margin: 0 auto 22px !important;
    color: var(--receipt-forest) !important;
    text-align: center !important;
  }

  body[data-page="order"] .receipt-brand .flow-icon {
    width: 38px !important;
    height: 38px !important;
    color: var(--receipt-gold) !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.8 !important;
  }

  body[data-page="order"] .receipt-wordmark {
    color: var(--receipt-gold) !important;
    font-size: clamp(27px, 4vw, 35px) !important;
    font-weight: 850 !important;
    letter-spacing: -.045em !important;
    line-height: 1 !important;
  }

  body[data-page="order"] .receipt-brand-tagline {
    color: var(--receipt-deep) !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    line-height: 1.35 !important;
    letter-spacing: .015em !important;
  }

  body[data-page="order"] .receipt-heading {
    position: relative !important;
    z-index: 1 !important;
    margin: 0 0 25px !important;
    text-align: center !important;
  }

  body[data-page="order"] .receipt-heading h1 {
    margin: 0 0 7px !important;
    color: var(--receipt-deep) !important;
    font-size: clamp(28px, 4.8vw, 36px) !important;
    font-weight: 850 !important;
    letter-spacing: -.025em !important;
    line-height: 1.16 !important;
  }

  body[data-page="order"] .receipt-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px 13px !important;
    margin: 0 !important;
    color: #415148 !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
  }

  body[data-page="order"] .receipt-meta bdi {
    color: var(--receipt-deep) !important;
    font-weight: 800 !important;
  }

  body[data-page="order"] .receipt-meta time {
    color: #39483f !important;
  }

  body[data-page="order"] .receipt-info-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 14px !important;
    margin: 0 0 20px !important;
    direction: inherit !important;
  }

  body[data-page="order"] .receipt-info-card {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 0 13px !important;
    overflow: hidden !important;
    border: 1px solid var(--receipt-line) !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body[data-page="order"] .receipt-info-card h2 {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    min-height: 47px !important;
    margin: 0 0 12px !important;
    padding: 9px 13px !important;
    background: #edf5ed !important;
    color: var(--receipt-deep) !important;
    font-size: 18px !important;
    font-weight: 850 !important;
    line-height: 1.3 !important;
  }

  body[data-page="order"] .receipt-info-card h2 .flow-icon,
  body[data-page="order"] .receipt-status-card .flow-icon,
  body[data-page="order"] .receipt-thanks .flow-icon {
    flex: 0 0 auto !important;
    width: 27px !important;
    height: 27px !important;
    color: var(--receipt-gold) !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.8 !important;
  }

  body[data-page="order"] .receipt-info-card dl {
    display: grid !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 14px !important;
  }

  body[data-page="order"] .receipt-info-card dl > div {
    display: grid !important;
    gap: 2px !important;
    min-width: 0 !important;
  }

  body[data-page="order"] .receipt-info-card dt {
    margin: 0 !important;
    color: var(--receipt-deep) !important;
    font-size: 13px !important;
    font-weight: 800 !important;
  }

  body[data-page="order"] .receipt-info-card dd {
    min-width: 0 !important;
    margin: 0 !important;
    color: #38443c !important;
    font-size: 14px !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere !important;
  }

  body[data-page="order"] .receipt-info-card .receipt-privacy-note {
    margin: 10px 14px 0 !important;
    padding-top: 8px !important;
    border-top: 1px solid #e8ece6 !important;
    color: var(--receipt-muted) !important;
    font-size: 11px !important;
    line-height: 1.45 !important;
  }

  body[data-page="order"] .receipt-items-wrap {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 20px !important;
    overflow-x: hidden !important;
    border: 1px solid var(--receipt-line) !important;
    border-radius: 9px !important;
    background: #fff !important;
  }

  body[data-page="order"] table.receipt-items-table {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    background: transparent !important;
    color: var(--receipt-ink) !important;
    table-layout: fixed !important;
    text-align: start !important;
  }

  body[data-page="order"] .receipt-items-table th {
    padding: 9px 10px !important;
    border: 0 !important;
    border-inline-end: 1px solid #e1e9e1 !important;
    background: var(--receipt-green-wash) !important;
    color: var(--receipt-deep) !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    line-height: 1.35 !important;
    text-align: start !important;
  }

  body[data-page="order"] .receipt-items-table td {
    padding: 9px 10px !important;
    border: 0 !important;
    border-top: 1px solid #e8ece8 !important;
    border-inline-end: 1px solid #edf0ed !important;
    background: transparent !important;
    color: #303b34 !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    vertical-align: middle !important;
    overflow-wrap: anywhere !important;
  }

  body[data-page="order"] .receipt-items-table :is(th, td):last-child {
    border-inline-end: 0 !important;
  }

  body[data-page="order"] .receipt-items-table td b {
    display: block !important;
    color: var(--receipt-ink) !important;
    font-weight: 750 !important;
  }

  body[data-page="order"] .receipt-items-table td small {
    display: block !important;
    margin-top: 2px !important;
    color: var(--receipt-muted) !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  body[data-page="order"] .receipt-bottom-grid {
    display: grid !important;
    grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr) !important;
    align-items: start !important;
    gap: 15px !important;
    margin: 0 0 29px !important;
    direction: inherit !important;
  }

  body[data-page="order"] .receipt-status-grid {
    display: grid !important;
    gap: 9px !important;
    min-width: 0 !important;
  }

  body[data-page="order"] .page.order-receipt-page[dir="rtl"] .receipt-status-grid {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  body[data-page="order"] .page.order-receipt-page[dir="rtl"] .receipt-totals {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  body[data-page="order"] .page.order-receipt-page[dir="ltr"] .receipt-status-grid {
    grid-column: 1 !important;
  }

  body[data-page="order"] .page.order-receipt-page[dir="ltr"] .receipt-totals {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  body[data-page="order"] .receipt-status-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 40px !important;
    align-items: center !important;
    gap: 9px !important;
    min-width: 0 !important;
    min-height: 75px !important;
    margin: 0 !important;
    padding: 11px 13px !important;
    border: 1px solid #dce8dc !important;
    border-radius: 10px !important;
    background: #f5f9f3 !important;
  }

  body[data-page="order"] .receipt-status-card > div {
    min-width: 0 !important;
  }

  body[data-page="order"] .receipt-status-card label {
    display: block !important;
    margin: 0 0 3px !important;
    color: #435349 !important;
    font-size: 13px !important;
    font-weight: 650 !important;
  }

  body[data-page="order"] .receipt-status-card p {
    margin: 0 !important;
    color: var(--receipt-deep) !important;
    font-size: 17px !important;
    font-weight: 850 !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
  }

  body[data-page="order"] .receipt-status-card .flow-icon {
    justify-self: center !important;
    width: 35px !important;
    height: 35px !important;
  }

  body[data-page="order"] dl.receipt-totals {
    display: grid !important;
    gap: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 7px 15px !important;
    border: 1px solid var(--receipt-line) !important;
    border-radius: 10px !important;
    background: #fff !important;
  }

  body[data-page="order"] .receipt-totals > div {
    display: flex !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    gap: 12px !important;
    min-width: 0 !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #e7ebe6 !important;
  }

  body[data-page="order"] .receipt-totals dt {
    color: #455047 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
  }

  body[data-page="order"] .receipt-totals dd {
    margin: 0 !important;
    color: #24332a !important;
    font-size: 15px !important;
    font-weight: 750 !important;
    white-space: nowrap !important;
  }

  body[data-page="order"] .receipt-totals .receipt-grand-total {
    align-items: center !important;
    margin: 5px -8px 0 !important;
    padding: 12px 9px !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: var(--receipt-green-wash) !important;
  }

  body[data-page="order"] .receipt-totals .receipt-grand-total :is(dt, dd) {
    color: var(--receipt-deep) !important;
    font-size: 17px !important;
    font-weight: 850 !important;
  }

  body[data-page="order"] .receipt-thanks {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding-top: 12px !important;
    border-top: 1px solid var(--receipt-gold-soft) !important;
    text-align: center !important;
  }

  body[data-page="order"] .receipt-thanks::before,
  body[data-page="order"] .receipt-thanks::after {
    content: "" !important;
    position: absolute !important;
    width: 30% !important;
    height: 1px !important;
    background: var(--receipt-gold-soft) !important;
  }

  body[data-page="order"] .receipt-thanks { position: relative !important; }
  body[data-page="order"] .receipt-thanks::before { inset-inline-start: 0 !important; top: 0 !important; }
  body[data-page="order"] .receipt-thanks::after { inset-inline-end: 0 !important; top: 0 !important; }

  body[data-page="order"] .receipt-thanks > .flow-icon {
    box-sizing: content-box !important;
    margin-top: -26px !important;
    padding-inline: 10px !important;
    background: var(--receipt-paper) !important;
  }

  body[data-page="order"] .receipt-thanks > .flow-icon {
    position: relative !important;
    z-index: 1 !important;
  }

  body[data-page="order"] .receipt-thanks > div {
    display: grid !important;
    justify-items: center !important;
    gap: 4px !important;
  }

  body[data-page="order"] .receipt-thanks .flow-icon {
    width: 24px !important;
    height: 24px !important;
    color: var(--receipt-gold) !important;
  }

  body[data-page="order"] .receipt-thanks h2 {
    margin: 0 !important;
    color: var(--receipt-deep) !important;
    font-size: clamp(18px, 3vw, 23px) !important;
    font-weight: 850 !important;
    line-height: 1.35 !important;
  }

  body[data-page="order"] .receipt-thanks p {
    margin: 0 !important;
    color: var(--receipt-muted) !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  body[data-page="order"] p.receipt-document-note {
    margin: 18px 0 0 !important;
    color: #8a908b !important;
    font-size: 10px !important;
    line-height: 1.4 !important;
    text-align: center !important;
  }

  @media (max-width: 600px) {
    body[data-page="order"] {
      padding: 12px 9px 24px !important;
    }

    body[data-page="order"] .order-receipt-document {
      min-height: 0 !important;
      padding: 25px 14px 22px !important;
      border-radius: 8px !important;
    }

    body[data-page="order"] .receipt-brand { margin-bottom: 15px !important; }
    body[data-page="order"] .receipt-heading { margin-bottom: 19px !important; }
    body[data-page="order"] .receipt-meta { font-size: 13px !important; }
    body[data-page="order"] .receipt-info-grid { gap: 9px !important; }
    body[data-page="order"] .receipt-info-card h2 {
      gap: 6px !important;
      min-height: 42px !important;
      padding: 8px 9px !important;
      font-size: 15px !important;
    }
    body[data-page="order"] .receipt-info-card h2 .flow-icon {
      width: 22px !important;
      height: 22px !important;
    }
    body[data-page="order"] .receipt-info-card dl { padding-inline: 10px !important; }
    body[data-page="order"] .receipt-info-card dt { font-size: 12px !important; }
    body[data-page="order"] .receipt-info-card dd { font-size: 13px !important; }
    body[data-page="order"] table.receipt-items-table {
      min-width: 0 !important;
      table-layout: fixed !important;
    }
    body[data-page="order"] .receipt-items-table :is(th, td) {
      padding: 7px 3px !important;
      font-size: 11px !important;
      white-space: normal !important;
      overflow-wrap: anywhere !important;
    }
    body[data-page="order"] .receipt-items-table :is(th, td):first-child { width: 34% !important; }
    body[data-page="order"] .receipt-items-table :is(th, td):nth-child(2) { width: 13% !important; }
    body[data-page="order"] .receipt-items-table :is(th, td):nth-child(3) { width: 27% !important; }
    body[data-page="order"] .receipt-items-table :is(th, td):nth-child(4) { width: 26% !important; }
    body[data-page="order"] .receipt-items-table bdi { white-space: nowrap !important; }
    body[data-page="order"] .receipt-bottom-grid {
      grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr) !important;
      gap: 10px !important;
    }
    body[data-page="order"] .receipt-status-card {
      grid-template-columns: minmax(0, 1fr) 26px !important;
      gap: 6px !important;
      padding: 9px 8px !important;
    }
    body[data-page="order"] .receipt-status-card .flow-icon { width: 26px !important; height: 26px !important; }
    body[data-page="order"] .receipt-status-card label { font-size: 12px !important; }
    body[data-page="order"] .receipt-status-card p { font-size: 14px !important; }
    body[data-page="order"] dl.receipt-totals { padding: 4px 8px !important; }
    body[data-page="order"] .receipt-totals > div { gap: 6px !important; }
    body[data-page="order"] .receipt-totals :is(dt, dd) { font-size: 12px !important; }
    body[data-page="order"] .receipt-totals .receipt-grand-total :is(dt, dd) { font-size: 14px !important; }
  }

  @media (max-width: 380px) {
    body[data-page="order"] .receipt-info-grid { grid-template-columns: 1fr !important; }
    body[data-page="order"] .receipt-info-card { padding-bottom: 12px !important; }
    body[data-page="order"] .receipt-back-link {
      min-height: 39px !important;
      padding-inline: 10px !important;
      font-size: 13px !important;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    body[data-page="order"] *,
    body[data-page="order"] *::before,
    body[data-page="order"] *::after {
      scroll-behavior: auto !important;
      animation-duration: .01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: .01ms !important;
    }
  }

  @media print {
    @page {
      size: A4 portrait;
      margin: 12mm;
    }

    html:has(body[data-page="order"]),
    body[data-page="order"] {
      min-height: 0 !important;
      margin: 0 !important;
      padding: 0 !important;
      overflow: visible !important;
      background: #fff !important;
      print-color-adjust: exact !important;
      -webkit-print-color-adjust: exact !important;
    }

    body[data-page="order"] > :not(#app),
    body[data-page="order"] :is(header, footer, nav, .site-header, .site-footer,
      .mobile-nav, .bottom-nav, .floating-widget, .chat-widget, [data-global-widget]) {
      display: none !important;
    }

    body[data-page="order"] #app,
    body[data-page="order"] .page.order-receipt-page {
      display: block !important;
      width: 100% !important;
      max-width: none !important;
      margin: 0 !important;
      padding: 0 !important;
      overflow: visible !important;
      background: transparent !important;
    }

    body[data-page="order"] .receipt-back-link { display: none !important; }

    body[data-page="order"] .order-receipt-document {
      width: 100% !important;
      max-width: none !important;
      min-height: 0 !important;
      margin: 0 !important;
      padding: 8mm 7mm 6mm !important;
      overflow: visible !important;
      border: 0 !important;
      border-radius: 0 !important;
      box-shadow: none !important;
      background: var(--receipt-paper) !important;
      print-color-adjust: exact !important;
      -webkit-print-color-adjust: exact !important;
    }

    body[data-page="order"] .receipt-leaves { -webkit-print-color-adjust: exact !important; }

    body[data-page="order"] .receipt-items-wrap {
      overflow: visible !important;
      break-inside: auto !important;
      page-break-inside: auto !important;
    }

    body[data-page="order"] .receipt-leaves {
      z-index: 0 !important;
      opacity: .62 !important;
    }

    body[data-page="order"] .receipt-brand,
    body[data-page="order"] .receipt-heading,
    body[data-page="order"] .receipt-info-grid,
    body[data-page="order"] .receipt-items-wrap,
    body[data-page="order"] .receipt-bottom-grid,
    body[data-page="order"] .receipt-thanks,
    body[data-page="order"] .receipt-document-note {
      position: relative !important;
      z-index: 1 !important;
    }

    body[data-page="order"] .receipt-privacy-note {
      color: #626d64 !important;
    }

    body[data-page="order"] table.receipt-items-table {
      min-width: 0 !important;
      width: 100% !important;
      break-inside: auto !important;
      page-break-inside: auto !important;
    }

    body[data-page="order"] .receipt-items-table thead {
      display: table-header-group !important;
    }

    body[data-page="order"] .receipt-items-table tr,
    body[data-page="order"] .receipt-info-card,
    body[data-page="order"] .receipt-status-card,
    body[data-page="order"] .receipt-totals .receipt-grand-total {
      break-inside: avoid !important;
      page-break-inside: avoid !important;
    }

    body[data-page="order"] .receipt-bottom-grid,
    body[data-page="order"] .receipt-thanks {
      break-inside: avoid !important;
      page-break-inside: avoid !important;
    }
  }
}
