/* A deposit paid straight to the salon (renderOutsideDepositCard in app.js),
   laid out like a pay stub: by when and the cancellation warning, then the
   salon's own words on how to pay; its payment image in a white panel beside
   them, or under them when the card is narrow. The same card on Review, the
   booking confirmation and the appointment details: it lays itself out by
   its own width, so each page only spaces it. */
.deposit-pay-card {
  container: deposit-pay / inline-size;
  margin: 0;
  overflow: hidden;
  border: 1px solid #ecdcb3;
  border-radius: 18px;
  color: #2f2937;
  background: #fffaf0;
  box-shadow: 0 16px 34px -30px rgba(82, 59, 26, 0.55);
  text-align: left;
}

.deposit-pay-stub {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.deposit-pay-main {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 16px;
}

.deposit-pay-due {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.deposit-pay-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #8b5c25;
  background: #fbe8c0;
}

.deposit-pay-mark .icon {
  width: 18px;
  height: 18px;
}

.deposit-pay-due strong {
  display: block;
  color: #2f2937;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.deposit-pay-due .deposit-pay-warning {
  display: block;
  margin-top: 3px;
  color: #8b5c25;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
}

.deposit-pay-note {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding-top: 13px;
  border-top: 1px solid rgba(140, 101, 29, 0.16);
}

.deposit-pay-note > span {
  color: #8c651d;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.deposit-pay-note > p {
  margin: 0;
  color: #2f2937;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}

.deposit-pay-note > p.is-hint {
  color: #6f6879;
}

/* The payment image: white behind it so a QR code reads, a perforation
   between it and the words. */
.deposit-pay-image {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 16px;
  border-top: 1px dashed #e2cb94;
  background: #ffffff;
}

.deposit-pay-image > .deposit-image-trigger {
  width: min(100%, 230px);
  border: 1px solid rgba(140, 101, 29, 0.18);
  border-radius: 14px;
  box-shadow: 0 12px 26px -18px rgba(82, 59, 26, 0.45);
  transition:
    transform 0.4s cubic-bezier(0.32, 0.72, 0, 1),
    box-shadow 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.deposit-pay-image > .deposit-image-trigger > img {
  aspect-ratio: 1;
  padding: 8px;
}

.deposit-pay-image .deposit-image-trigger-caption {
  padding: 7px 6px;
  border-top-color: rgba(140, 101, 29, 0.13);
  color: #76591f;
  background: #fffdf7;
  font-size: 12px;
}

@media (hover: hover) and (pointer: fine) {
  .deposit-pay-image > .deposit-image-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px -18px rgba(82, 59, 26, 0.55);
  }
}

/* Wide enough: the image beside the words, as tall as the card. */
@container deposit-pay (min-width: 500px) {
  .deposit-pay-card.has-image .deposit-pay-stub {
    grid-template-columns: minmax(0, 1fr) clamp(184px, 38%, 250px);
  }

  .deposit-pay-main {
    gap: 16px;
    padding: 20px 22px;
  }

  .deposit-pay-image {
    padding: 14px;
    border-top: 0;
    border-left: 1px dashed #e2cb94;
  }

  .deposit-pay-image > .deposit-image-trigger {
    width: 100%;
  }
}

@container deposit-pay (min-width: 720px) {
  .deposit-pay-image {
    padding: 18px;
  }

  .deposit-pay-due strong {
    font-size: 1.12rem;
  }

  .deposit-pay-note > p {
    font-size: 0.96rem;
  }
}

/* Where each page puts it. */
.booking-submit-policy > .deposit-pay-card {
  margin-block: 2px;
}

.confirmation-details > .deposit-pay-card {
  margin: 18px 0;
}

.appointment-dialog-body .deposit-pay-card {
  border-radius: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .deposit-pay-image > .deposit-image-trigger {
    transition: none;
  }
}
