/* Print-to-Web Wave 9. Loaded only for active, non-control store shells.
   The wrapper ID keeps this component layer above per-store revive sheets. */
:root {
  --voucher-ink: #1a1412;
  --voucher-muted: #5c4b42;
  --voucher-rule: #85715f;
  --voucher-paper: #fff7e8;
  --voucher-stub: #f3e9d8;
  --voucher-green: #176142;
  --voucher-valid: #e9f1e6;
  --voucher-rust: #9d321a;
  --voucher-white: #fffaf3;
  --voucher-mono: var(--font-mono, ui-monospace, monospace);
  --voucher-pad: clamp(.75rem, 2vw, 1.25rem);
  --voucher-accent: var(--voucher-rust);
  --voucher-gutter: clamp(.75rem, 2vw, 1.125rem);
}

/* The desktop Stores menu is anchored to its trigger, not the viewport.
   Keep it inside the page at the desktop switch, as on the seasonal hub. */
@media (min-width: 1101px) and (max-width: 1240px) {
  .header .coreNav__panel {
    left: -8rem;
    width: 48rem;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.5fr);
  }
}

#wrapper.singleStorePage .tm-rail-card__code code {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

#wrapper.singleStorePage .tm-offer-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  gap: 8px;
  min-inline-size: 0;
}

#wrapper.singleStorePage .tm-ticket {
  position: relative;
  gap: 8px;
  padding: 0 var(--voucher-gutter) 12px;
  border: 1.5px solid var(--voucher-ink);
  border-block-start: 4px solid var(--voucher-accent);
  border-radius: 2px;
  background: var(--voucher-paper);
  color: var(--voucher-ink);
  box-shadow: none;
  overflow-wrap: anywhere;
}

#wrapper.singleStorePage .tm-ticket--cashback {
  --voucher-accent: var(--voucher-green);
}

#wrapper.singleStorePage .tm-ticket__head {
  margin-inline: calc(-1 * var(--voucher-gutter));
  padding: 7px var(--voucher-gutter);
  background: var(--voucher-stub);
  border-block-end: 1px solid var(--voucher-rule);
  gap: 5px 10px;
}

#wrapper.singleStorePage .tm-ticket__eyebrow,
#wrapper.singleStorePage .tm-ticket__pill {
  font: 700 .75rem/1.3 var(--voucher-mono);
  font-variant-numeric: tabular-nums;
  color: var(--voucher-accent);
}

#wrapper.singleStorePage .tm-ticket__eyebrow {
  letter-spacing: .15em;
}

#wrapper.singleStorePage .tm-ticket__pill {
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--voucher-green);
  background: var(--voucher-valid);
}

#wrapper.singleStorePage .tm-ticket__rate {
  font: 800 clamp(1.65rem, 3vw, 2.25rem)/1.12 var(--voucher-mono);
  color: var(--voucher-green);
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}

#wrapper.singleStorePage .tm-ticket__qual {
  color: var(--voucher-muted);
}

#wrapper.singleStorePage .tm-ticket > .tm-ticket__math {
  display: grid;
  grid-template-columns: minmax(0, 1fr) .6rem minmax(0, 1fr);
  gap: .45rem;
  border: 0;
  border-block: 1px solid var(--voucher-rule);
  border-radius: 0;
  padding: 6px 0;
  background: transparent;
  color: var(--voucher-ink);
  font: 500 .8125rem/1.4 var(--voucher-mono);
  font-variant-numeric: tabular-nums;
}

#wrapper.singleStorePage .tm-ticket > .tm-ticket__math strong {
  grid-column: 3;
  grid-row: 1;
  text-align: end;
  color: var(--voucher-green);
}

/* Ledger arrow. The two amounts retain their original accessible text. */
#wrapper.singleStorePage .tm-ticket > .tm-ticket__math::before,
#wrapper.singleStorePage .tm-ticket > .tm-ticket__math::after {
  content: "";
  grid-column: 2;
  grid-row: 1;
}

#wrapper.singleStorePage .tm-ticket > .tm-ticket__math::before {
  inline-size: 8px;
  border-block-start: 1px solid;
}

#wrapper.singleStorePage .tm-ticket > .tm-ticket__math::after {
  justify-self: end;
  inline-size: 5px;
  block-size: 5px;
  border-block-start: 1px solid;
  border-inline-end: 1px solid;
  transform: rotate(45deg);
}

#wrapper.singleStorePage .tm-ticket__perforation {
  display: block;
  position: relative;
  margin: 5px calc(-1 * var(--voucher-gutter)) 4px;
  border-block-start: 1.5px dashed var(--voucher-rule);
}

#wrapper.singleStorePage .tm-ticket__perforation::before,
#wrapper.singleStorePage .tm-ticket__perforation::after {
  content: "";
  position: absolute;
  inset-block-start: -7px;
  inline-size: 13px;
  block-size: 13px;
  pointer-events: none;
}

/* A half circle ends where the frame begins, leaving an ink rim on the stock. */
#wrapper.singleStorePage .tm-ticket__perforation::before {
  inset-inline-start: -1.5px;
  background: radial-gradient(circle at left center,
    var(--sv2-surface) 4.5px, var(--voucher-ink) 5px 5.8px, transparent 6.4px);
}

#wrapper.singleStorePage .tm-ticket__perforation::after {
  inset-inline-end: -1.5px;
  background: radial-gradient(circle at right center,
    var(--sv2-surface) 4.5px, var(--voucher-ink) 5px 5.8px, transparent 6.4px);
}

#wrapper.singleStorePage .tm-proof-line {
  align-self: flex-start;
  border: 3px double var(--voucher-green);
  border-radius: 0;
  padding: 4px 8px;
  color: var(--voucher-green);
  background: var(--voucher-valid);
  font: 700 .75rem/1.4 var(--voucher-mono);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

#wrapper.singleStorePage .tm-proof-line svg {
  margin-block-start: 1px;
}

/* A single contract track is the default. Detail/history rows use both tracks. */
#wrapper.singleStorePage :is(.fr-coupon, .couponCard) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  min-inline-size: 0;
  padding: 0;
  border: 1.5px solid var(--voucher-ink);
  border-block-start: 3px solid var(--voucher-ink);
  border-radius: 2px;
  background: var(--voucher-paper);
  color: var(--voucher-ink);
  box-shadow: none;
  overflow-wrap: anywhere;
}

#wrapper.singleStorePage :is(.fr-coupon, .couponCard) > * {
  box-sizing: border-box;
  grid-column: 1 / -1;
  min-inline-size: 0;
  margin: 0;
  padding: var(--voucher-pad);
}

#wrapper.singleStorePage :is(.fr-coupon, .couponCard) > :is(.fr-coupon__right, .couponCard__action) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  inline-size: auto;
  max-inline-size: none;
  padding: var(--voucher-pad);
  border: 0;
  border-block-start: 1.5px dashed var(--voucher-rule);
  border-radius: 0;
  background: var(--voucher-stub);
}

#wrapper.singleStorePage :is(.fr-coupon__right, .couponCard__action):not(:has(> *)) {
  display: none;
}

@media (min-width: 768px) {
  #wrapper.singleStorePage :is(.fr-coupon, .couponCard):has(> :is(.fr-coupon__right, .couponCard__action) > *) {
    grid-template-columns: minmax(0, 7fr) minmax(min(36%, 10.75rem), 3fr);
  }

  #wrapper.singleStorePage :is(.fr-coupon__left, .couponCard__info) {
    grid-column: 1;
  }

  #wrapper.singleStorePage :is(.fr-coupon, .couponCard):not(:has(> :is(.fr-coupon__right, .couponCard__action) > *))
    > :is(.fr-coupon__left, .couponCard__info) {
    grid-column: 1 / -1;
  }

  #wrapper.singleStorePage :is(.fr-coupon, .couponCard) > :is(.fr-coupon__right, .couponCard__action) {
    grid-column: 2;
    border-block-start: 0;
    border-inline-start: 1.5px dashed var(--voucher-rule);
  }
}

#wrapper.singleStorePage :is(.fr-coupon__discount, .couponCard__name) {
  color: var(--voucher-ink);
}

#wrapper.singleStorePage .fr-cards > .fr-coupon:first-of-type:has(.fr-badge--tested) .fr-coupon__discount {
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.25;
}

#wrapper.singleStorePage .fr-coupon .fr-note {
  margin: 0;
}

#wrapper.singleStorePage .fr-coupon .fr-note strong {
  color: var(--voucher-ink);
}

#wrapper.singleStorePage :is(.fr-coupon, .couponCard)
  :is(.fr-coupon__desc, .fr-coupon__meta, .fr-note, .code-test__took, .couponCard__desc, .couponCard__took, .couponCard__exp) {
  color: var(--voucher-muted);
}

#wrapper.singleStorePage :is(.fr-coupon, .couponCard) :is(.fr-badge--tested, .fr-badge--verified, .couponCard__tested) {
  border: 1px solid var(--voucher-green);
  border-radius: 2px;
  background: var(--voucher-valid);
  color: var(--voucher-green);
}

/* The signed-in note arrives with inline flex and inherited-color settings. */
#wrapper.singleStorePage :is(.tm-ticket, .fr-coupon, .couponCard) .clickfirst-note {
  --fr-muted: var(--voucher-muted);
}

/* Machine-set code in a double rule. Keep the original case and copy hooks. */
#wrapper.singleStorePage :is(.tm-ticket__code, .fr-coupon__right .fr-code, .couponCard__code) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  inline-size: 100%;
  max-inline-size: 100%;
  min-block-size: 44px;
  padding: 6px 9px;
  border: 3px double var(--voucher-rule);
  border-radius: 0;
  color: var(--voucher-rust);
  background: var(--voucher-paper);
  box-shadow: none;
  font: 750 .9375rem/1.25 var(--voucher-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .055em;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: start;
}

#wrapper.singleStorePage :is(.tm-ticket__code, .fr-coupon__right .fr-code) .js-code-text {
  min-inline-size: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  white-space: normal;
  overflow-wrap: anywhere;
}

#wrapper.singleStorePage :is(.tm-ticket__code, .fr-coupon__right .fr-code) svg {
  color: inherit;
  flex: 0 0 16px;
}

#wrapper.singleStorePage :is(.tm-ticket__cta, .fr-coupon__right .fr-cta, .couponCard__action .btn.primary) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 100%;
  max-inline-size: 100%;
  min-block-size: 44px;
  padding: 8px 10px;
  border: 1px solid var(--voucher-ink);
  border-radius: var(--radius-button);
  color: var(--voucher-white);
  background: var(--voucher-ink);
  box-shadow: none;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

#wrapper.singleStorePage :is(.tm-ticket__cta, .fr-coupon__right .fr-cta, .couponCard__action .btn.primary) > span {
  min-inline-size: 0;
}

@media (prefers-reduced-motion: no-preference) {
  #wrapper.singleStorePage :is(.tm-ticket__code, .fr-coupon__right .fr-code, .tm-ticket__cta, .fr-coupon__right .fr-cta, .couponCard__action .btn.primary) {
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  #wrapper.singleStorePage :is(.tm-ticket__code, .fr-coupon__right .fr-code, .tm-ticket__cta, .fr-coupon__right .fr-cta, .couponCard__action .btn.primary) {
    transition: none;
  }
}

@media (hover: hover) {
  #wrapper.singleStorePage :is(.tm-ticket__code, .fr-coupon__right .fr-code):hover {
    border-color: var(--voucher-rust);
    background: var(--voucher-white);
  }
}

#wrapper.singleStorePage :is(.tm-ticket__code, .fr-coupon__right .fr-code):active {
  transform: none;
  background: var(--voucher-stub);
  border-style: solid;
}

#wrapper.singleStorePage :is(.tm-ticket__code, .fr-coupon__right .fr-code).is-copied {
  color: var(--voucher-green);
  background: var(--voucher-valid);
  border-color: currentColor;
  border-style: solid;
}

#wrapper.singleStorePage :is(.tm-ticket__cta, .fr-coupon__right .fr-cta, .couponCard__action .btn.primary):is(:hover, :active) {
  color: var(--voucher-white);
  background: var(--voucher-rust);
  border-color: var(--voucher-rust);
}

#wrapper.singleStorePage :is(.tm-ticket, .fr-coupon, .couponCard, .code-test) :is(a, button):focus-visible {
  outline: 2px solid var(--voucher-rust);
  outline-offset: 2px;
}

/* The proof's crop and caption are mounted together on a ruled paper plate. */
#wrapper.singleStorePage figure:is(.code-test, .fr-proof, .couponCard__proof) {
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: 30rem;
  min-inline-size: 0;
  margin: 8px 0 0;
  padding: 7px;
  border: 1px solid var(--voucher-rule);
  background: var(--voucher-stub);
  overflow-wrap: anywhere;
}

#wrapper.singleStorePage .code-test > a {
  display: block;
}

#wrapper.singleStorePage figure:is(.code-test, .fr-proof, .couponCard__proof) .code-test__proof {
  display: block;
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: 100%;
  block-size: auto;
  margin: 0;
  padding: 0;
  border: 1px solid var(--voucher-rule);
  border-radius: 0;
  background: var(--voucher-paper);
  object-fit: contain;
}

#wrapper.singleStorePage figure:is(.code-test, .fr-proof, .couponCard__proof) figcaption {
  margin-block-start: 6px;
  padding-block-start: 5px;
  border-block-start: 1px solid var(--voucher-rule);
  color: var(--voucher-muted);
  font: 500 .75rem/1.5 var(--voucher-mono);
  font-variant-numeric: tabular-nums;
}

#wrapper.singleStorePage figure:is(.code-test, .fr-proof, .couponCard__proof) figcaption a {
  color: var(--voucher-rust);
  margin-inline-start: 0;
  white-space: normal;
}

@media (forced-colors: active) {
  #wrapper.singleStorePage {
    --voucher-ink: CanvasText;
    --voucher-muted: CanvasText;
    --voucher-rule: CanvasText;
    --voucher-paper: Canvas;
    --voucher-stub: Canvas;
    --voucher-green: CanvasText;
    --voucher-valid: Canvas;
    --voucher-rust: CanvasText;
    --voucher-white: Canvas;
  }

  #wrapper.singleStorePage .tm-ticket__perforation::before,
  #wrapper.singleStorePage .tm-ticket__perforation::after {
    display: none;
  }

  #wrapper.singleStorePage :is(.tm-ticket__code, .fr-coupon__right .fr-code) {
    border-color: ButtonText;
    color: ButtonText;
    background: ButtonFace;
  }

  #wrapper.singleStorePage :is(.tm-ticket__cta, .fr-coupon__right .fr-cta, .couponCard__action .btn.primary),
  #wrapper.singleStorePage figure:is(.code-test, .fr-proof, .couponCard__proof) figcaption a {
    border-color: LinkText;
    color: LinkText;
    background: Canvas;
  }

  #wrapper.singleStorePage :is(.tm-ticket, .fr-coupon, .couponCard, .code-test) :is(a, button):focus-visible {
    outline-color: CanvasText;
  }
}
