/* ====================================================================
   Order confirmation page (Užsakymo patvirtinimas) — page-scoped styles
   for templates/checkout/order-confirmation.tpl.

   The page renders the cart's own markup, so its grid, product rows,
   summary panel, typography and responsive bands all come from
   components/cart.css (loaded before this file). Everything below is
   either a #cart-scoped cart rule that has to be repeated for this
   page's body id, or a component the cart has no equivalent for.
   ==================================================================== */

/* --- Repeats of cart.css / design-system.css rules that are scoped to #cart --- */

/* all_styles.css:3536 adds padding-bottom: 20px to every .frn-cart-page__title,
   which stacks under the 22px margin cart.css gives it. The cart zeroes it for
   its own body id only; this page needs the same. */
#order-confirmation .frn-cart-page__title {
  padding-bottom: 0;
}

/* Page H1 — the cart's 24/20px title size, which no heading tier matches. */
#order-confirmation .frn-cart-head {
  font-size: 24px;
}

#order-confirmation #main > .frn-content-block:first-child {
  padding-top: 0;
}

/* cart.css unsets this wrapper's padding, but the blanket .frn-content-block
   rule in mobile.css re-applies it below 576px and the title drifts 32px away
   from the breadcrumb. Same repair the cart carries in design-system.css. */
#order-confirmation #wrapper > .frn-content-block.frn-product-item-list__content {
  padding-top: 0;
}

/* --- Confirmation message above the product list --- */
#order-confirmation .frn-order-confirmation__lead {
  margin: 0 0 26px;
  font-size: var(--fz-body);
  line-height: 1.6;
  color: var(--cTextLight2);
}

#order-confirmation .frn-order-confirmation__lead p {
  margin: 0 0 6px;
}

#order-confirmation .frn-order-confirmation__lead p:last-child {
  margin-bottom: 0;
}

#order-confirmation .frn-order-confirmation__lead a {
  color: var(--cText);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Static quantity, in place of the cart's stepper. Takes the stepper's
   pill so the two rows keep the same height and rhythm. --- */
#order-confirmation .frn-product-item-cart__qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  background: var(--bgcLight);
  font-size: var(--fz-body);
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}

/* --- Advance-payment rows, injected into the summary panel by the
   advancepayment module's displayOrderConfirmation1 hook. Same treatment the
   cart gives its own advance block: total-weight rows under the grand total. */
#order-confirmation .frn-cart-summary .frn-cart-page__total-item {
  margin: 8px 0 0;
  font-size: var(--fz-body);
  font-weight: 500;
}

/* --- Order / customer details panel, below the summary in the side column.
   The cart has nothing like it; it borrows the summary's row geometry so the
   two blocks read as one column. --- */
#order-confirmation .frn-order-info {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--bdcPrimary);
}

#order-confirmation .frn-order-info__title {
  margin: 0 0 18px;
  font-size: var(--fz-h4);
  font-weight: 500;
  line-height: var(--lh-heading);
}

#order-confirmation .frn-order-info__rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#order-confirmation .frn-order-info__row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: var(--fz-body);
  color: var(--cTextLight2);
}

/* min-width:0 on both halves: a flex item will not shrink below its content
   otherwise, and payment-method names ("Mokėjimas banko pavedimu per Paysera")
   are long enough to push the row past a 310px side column. */
#order-confirmation .frn-order-info__row > span {
  min-width: 0;
}

#order-confirmation .frn-order-info__row span:last-child {
  color: var(--cText);
  text-align: right;
  overflow-wrap: break-word;
}

#order-confirmation .frn-order-info__group {
  margin-top: 18px;
}

#order-confirmation .frn-order-info__subtitle {
  margin: 0 0 6px;
  font-size: var(--fz-body);
  font-weight: 500;
  line-height: 1.4;
  color: var(--cText);
}

/* font-style is reset for the <address> elements this class also lands on.
   break-word because an email address is one unbreakable token and the side
   column is only 310px in the narrowest desktop band. */
#order-confirmation .frn-order-info__text {
  margin: 0;
  font-size: var(--fz-body);
  font-style: normal;
  line-height: 1.6;
  color: var(--cTextLight2);
  overflow-wrap: break-word;
}

/* The order comment is escaped in the template, so its line breaks survive as
   newlines rather than <br>. */
#order-confirmation .frn-order-info__text--message {
  white-space: pre-line;
}

#order-confirmation .frn-order-confirmation__actions {
  margin-top: 26px;
}

/* --- Cross-sell block under the grid (ps_featuredproducts on
   displayOrderConfirmation2) --- */
#order-confirmation #content-hook-order-confirmation-footer {
  margin-top: 40px;
}

/* ====================================================================
   Responsive — the grid, rows and summary follow cart.css's own bands.
   Only what this page adds needs its own handling.
   ==================================================================== */

/* Below 768 the cart lays the controls out as actions | quantity | price.
   This page has no actions, so an empty first track would leave the quantity
   floating mid-row; two tracks put it under the product it belongs to and
   keep the price on the right edge. */
@media (max-width: 767.98px) {
  #order-confirmation .frn-product-item-cart__controls {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #order-confirmation .frn-product-item-cart__top-amount {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  #order-confirmation .frn-product-item-cart__price {
    grid-column: 2;
    grid-row: 1;
  }

  #order-confirmation .frn-cart-head {
    font-size: 20px;
  }

  #order-confirmation .frn-order-confirmation__lead {
    margin-bottom: 22px;
  }
}

/* Matches the cart's stepper, which drops to 40px in this band. */
@media (max-width: 576px) {
  #order-confirmation .frn-product-item-cart__qty {
    height: 40px;
    padding: 0 14px;
  }

  #order-confirmation .frn-order-info__title {
    margin-bottom: 16px;
  }
}
