/* Cart, checkout and order placed (WS-02). WooCommerce's own CSS is off on
   these pages (inc/woocommerce.php), so its form rows, radio lists and
   update covers are styled here too. Phone layout at ≤720px. */

.flow-main {
  padding-top: 20px;
  padding-bottom: 48px;
}

.flow-title {
  margin: 0 0 16px;
  font-size: 30px;
}

.flow-note {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Steps: কার্ট › ঠিকানা ও পেমেন্ট › অর্ডার সম্পন্ন ---------- */

.flow-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 620px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.3;
  color: var(--muted);
}

.flow-steps__step {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.flow-steps__step:last-child {
  flex: 0 1 auto;
}

/* line to the next step */
.flow-steps__step:not(:last-child)::after {
  content: "";
  flex: 1 1 12px;
  min-width: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--line);
}

.flow-steps__step.is-done::after {
  background: var(--accent);
}

.flow-steps__mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}

.flow-steps__mark .ic {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.flow-steps__step.is-done .flow-steps__mark {
  border-color: var(--tint);
  background: var(--tint);
  color: var(--accent);
}

.flow-steps__step.is-current {
  color: var(--ink);
  font-weight: 600;
}

.flow-steps__step.is-current .flow-steps__mark {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

/* ---------- Form fields (checkout, coupon) ---------- */

.co-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.co-fields .form-row {
  grid-column: 1 / -1;
}

.co-fields .form-row-first,
.co-fields .form-row-last {
  grid-column: auto;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

/* India only: the country is sent, never shown */
.form-row-hidden {
  display: none !important;
}

.form-row > label {
  font-size: 14px;
  font-weight: 600;
}

/* Optional fields say so; the required mark adds nothing */
.form-row label .required {
  display: none;
}

.form-row label .optional {
  font-weight: 400;
  color: var(--muted);
}

.woocommerce-input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flow-main :is(input.input-text, select, textarea),
.coupon .input-text {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px; /* 16px: phones don't zoom in on focus */
}

.flow-main textarea {
  min-height: 72px;
  padding: 10px 14px;
  resize: vertical;
}

.flow-main select {
  padding-right: 40px;
  appearance: none;
  cursor: pointer;
}

/* Arrow on a select */
.woocommerce-input-wrapper:has(select)::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.flow-main :is(input.input-text, select, textarea)::placeholder {
  color: var(--muted);
}

.flow-main :is(input.input-text, select, textarea):focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--tint);
}

.form-row .description {
  font-size: 13px;
  color: var(--muted);
}

.woocommerce-invalid :is(input.input-text, select, textarea),
.coupon .input-text.has-error {
  border-color: var(--sale);
}

.checkout-inline-error-message,
.coupon-error-notice {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--sale);
}

.flow-main input[type="checkbox"],
.flow-main input[type="radio"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

/* Coupon: code + Apply */
.coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.coupon .input-text {
  flex: 1 1 160px;
  text-transform: uppercase;
}

.coupon .input-text::placeholder {
  text-transform: none;
}

.coupon .btn {
  min-height: 48px;
}

.coupon-error-notice {
  flex-basis: 100%;
}

/* ---------- Summary card (cart, checkout, order placed) ---------- */

.summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary__title {
  margin: 0;
  font-size: 20px;
}

.sums {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.sums__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  font-size: 15px;
}

.sums__row dt {
  min-width: 0;
}

.sums__row dd {
  margin: 0 0 0 auto;
  font-weight: 600;
  text-align: right;
}

.sums__row--off dd {
  color: var(--sale);
}

.sums__row--total {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 19px;
  font-weight: 700;
}

.sums__row--total dd {
  font-weight: 700;
}

.sums__muted {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.sums__remove {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 600;
}

.sums__save {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--tint);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.sums__note {
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Several delivery options */
.ship-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-weight: 400;
  text-align: left;
}

.ship-opts li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ship-opts label {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  cursor: pointer;
}

.ship-opts__price {
  font-weight: 600;
}

.wc-proceed-to-checkout .btn {
  width: 100%;
  font-size: 17px;
}

/* ---------- Cart ---------- */

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 24px;
  align-items: start;
}

.cart-books {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.cart-books__count {
  margin: 0;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}

.cart-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto minmax(84px, auto);
  grid-template-areas:
    "cover info   qty total"
    "cover remove qty total";
  gap: 4px 20px;
  padding: 16px 20px;
}

.cart-line + .cart-line {
  border-top: 1px solid var(--line);
}

.cart-line__cover {
  grid-area: cover;
  align-self: start;
  display: block;
}

.cart-line__info {
  grid-area: info;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cart-line__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

.cart-line__title a {
  color: var(--ink);
}

.cart-line__title a:hover {
  color: var(--accent);
}

.cart-line__by {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* author · binding */
.cart-line__by span + span::before {
  content: " · ";
}

/* Data plugins add (WooCommerce's list) */
.cart-line__info dl.variation {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.cart-line__info dl.variation :is(dd, p) {
  margin: 0;
}

.cart-line__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 6px 0 0;
}

.cart-line__now {
  font-size: 17px;
  font-weight: 700;
}

.cart-line__mrp {
  font-size: 13px;
  color: var(--muted);
}

.cart-line__note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--sale);
}

.cart-line__qty {
  grid-area: qty;
  align-self: center;
}

.cart-line__one {
  font-size: 14px;
  color: var(--muted);
}

.cart-line__total {
  grid-area: total;
  align-self: center;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.cart-line__remove {
  grid-area: remove;
  align-self: end;
}

.cart-line__remove a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.cart-line__remove a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* − quantity + */
.stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stepper__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
}

.stepper__btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.stepper__btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.stepper__btn:hover:not(:disabled) {
  background: var(--soft);
}

.stepper__btn:disabled {
  color: var(--line);
  cursor: default;
}

.stepper .quantity {
  display: flex;
}

.stepper input.qty {
  width: 44px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.stepper input.qty::-webkit-inner-spin-button,
.stepper input.qty::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.stepper input.qty:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Coupon, more books, (Update cart without JS) */
.cart-books__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.coupon-box {
  flex: 1 1 280px;
  min-width: 0;
}

.coupon-box summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.coupon-box summary::-webkit-details-marker {
  display: none;
}

.coupon-box[open] summary {
  margin-bottom: 8px;
}

.cart-books__more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}

/* cart.js updates the cart a moment after − / + */
.has-cart-js .cart-books__update {
  display: none;
}

.cart-collaterals {
  min-width: 0;
}

/* Wide screens: the summary stays in view beside a long cart */
@media (min-width: 901px) {
  .cart-collaterals {
    position: sticky;
    top: 16px;
  }
}

@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.flow-main .book-rail {
  margin-top: 40px;
}

/* Empty cart */
.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 0 16px;
  text-align: center;
}

.cart-empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--accent);
}

.cart-empty-state .flow-title {
  margin: 0;
}

.cart-empty-state p {
  margin: 0 0 8px;
  color: var(--muted);
}

/* ---------- Checkout ---------- */

.coupon-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 12px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--soft);
  font-size: 15px;
}

.coupon-line .ic {
  color: var(--accent);
}

.coupon-line .showcoupon {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-weight: 600;
}

.coupon-form {
  max-width: 520px;
  margin: 0 0 16px;
}

.co-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 24px;
  align-items: start;
}

.co-main,
.co-details,
.woocommerce-billing-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.co-step,
.co-more {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.co-step__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 19px;
}

.co-step__n {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
}

/* Send to someone else + note */
.co-more .woocommerce-shipping-fields,
.co-more .shipping_address,
.co-more .woocommerce-additional-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.co-check {
  margin: 0;
}

.co-check label,
.create-account label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
}

.co-more__title {
  margin: 0;
  font-size: 16px;
}

/* Ways to pay */
.pay-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pay-opt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.pay-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--tint);
}

/* One way to pay: WooCommerce hides its radio button */
.pay-opt > input[style*="none"] + label {
  grid-column: 1 / -1;
}

.pay-opt label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-height: 32px;
  font-weight: 600;
  cursor: pointer;
}

.pay-opt label .ic {
  color: var(--accent);
}

/* A payment service's own logo (dark ink): on a light chip in both themes */
.pay-opt label img {
  max-height: 24px;
  width: auto;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--paper);
}

.payment_box {
  grid-column: 1 / -1;
  font-size: 14px;
  color: var(--muted);
}

.payment_box p {
  margin: 0;
}

.pay-opts__none {
  font-size: 15px;
  color: var(--sale);
}

.place-order {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.woocommerce-privacy-policy-text p,
.woocommerce-terms-and-conditions-checkbox-text {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.place-order__btn {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
}

/* Order summary beside the form */
.co-side {
  min-width: 0;
}

@media (min-width: 721px) {
  .co-side {
    position: sticky;
    top: 16px;
  }
}

.co-summary__panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.co-summary__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.co-summary__edit {
  font-size: 14px;
  font-weight: 600;
}

.co-review {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 1080px) {
  .co-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  }
}

/* ---------- Order lines (checkout summary, order placed) ---------- */

.order-lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.order-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

/* Too small for the generated title: colour, band and rule only */
.order-line__cover .book-cover__title {
  display: none;
}

.order-line__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.order-line__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.order-line__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.order-line__total {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Order placed ---------- */

.placed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.placed__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  text-align: center;
}

.placed__head .flow-title {
  margin: 4px 0 0;
}

.placed__head p {
  margin: 0;
  color: var(--muted);
}

.placed__tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--accent);
}

.placed__tick .ic {
  stroke-width: 2.4;
}

.placed__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
}

.placed__meta strong {
  color: var(--ink);
}

.placed__pay {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--tint);
}

.placed__pay > .ic {
  color: var(--accent);
}

.placed__pay p {
  margin: 0;
}

.placed__pay-main {
  font-size: 17px;
  font-weight: 600;
}

.placed__pay-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.placed__grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 20px;
  align-items: start;
}

.placed__address {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-style: normal;
  line-height: 1.7;
}

.placed__phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.placed__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.placed__head--failed {
  padding: 20px;
  border-radius: 16px;
  background: var(--sale-bg);
}

.placed__head--failed p,
.placed__head--failed .flow-title {
  color: var(--sale);
}

@media (max-width: 900px) {
  .placed__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Pay for an order (Razorpay's button and window) ---------- */

.pay-now {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.pay-now .placed__meta {
  margin: 0 0 8px;
  color: var(--muted);
}

.pay-now__box {
  width: 100%;
  align-items: center;
}

.pay-now__box p {
  margin: 0;
}

.pay-now__box p:has(#btn-razorpay) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

/* Razorpay's own buttons and "please wait" line (it styles them inline) */
#btn-razorpay,
#btn-razorpay-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
}

#btn-razorpay {
  flex: 1 1 200px;
  background: var(--accent);
  color: var(--on-accent);
}

#btn-razorpay-cancel {
  background: var(--surface);
  color: var(--accent);
}

#msg-razorpay-success {
  padding: 12px 16px !important;
  border: 0 !important;
  border-radius: var(--radius-lg);
  background: var(--tint) !important;
  color: var(--ink);
}

/* ---------- Phone bar: total + Checkout / Place order ---------- */

.flow-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.flow-bar__sum {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  font-size: 12px;
  color: var(--muted);
}

.flow-bar__sum strong {
  font-size: 18px;
  color: var(--ink);
}

.flow-bar .btn {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------- Phones ---------- */

@media (max-width: 720px) {
  .flow-main {
    padding-top: 14px;
    padding-bottom: 32px;
  }

  .flow-title {
    font-size: 24px;
  }

  .flow-steps {
    gap: 6px;
    font-size: 12px;
  }

  .flow-steps__step {
    gap: 6px;
  }

  .flow-steps__mark {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .cart-books__count {
    padding: 12px 16px;
  }

  /* Phones: cover | title, price … | remove; − qty + and line total below */
  .cart-line {
    grid-template-columns: 60px minmax(0, 1fr) auto;
    grid-template-areas:
      "cover info info"
      "cover qty  total";
    gap: 10px 14px;
    padding: 14px 16px;
    position: relative;
  }

  .cart-line__info {
    padding-right: 36px; /* room for the remove icon */
  }

  .cart-line__title {
    font-size: 16px;
  }

  .cart-line__remove {
    position: absolute;
    top: 6px;
    right: 4px;
  }

  .cart-line__remove a {
    justify-content: center;
    width: 44px;
    min-height: 44px;
  }

  .cart-line__remove a span {
    display: none;
  }

  .cart-line__qty,
  .cart-line__total {
    align-self: center;
  }

  .cart-books__foot {
    padding: 12px 16px;
  }

  .summary,
  .co-step,
  .co-more {
    padding: 16px;
  }

  .co-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  /* The order summary comes first, folded under its button (cart.js) */
  .co-side {
    order: -1;
  }

  .co-summary {
    gap: 0;
    padding: 0;
  }

  .co-summary__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--ink);
    font-weight: 600;
    text-align: left;
  }

  .co-summary__toggle strong {
    margin-left: auto;
  }

  .co-summary__toggle .ic {
    color: var(--muted);
    transition: transform 0.2s ease;
  }

  .co-summary__toggle[aria-expanded="true"] .ic {
    transform: rotate(180deg);
  }

  .co-summary__panel {
    padding: 0 16px 16px;
  }

  .co-summary__panel.is-folded {
    display: none;
  }

  .co-summary__toggle:not([hidden]) + .co-summary__panel .co-summary__head {
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--line);
  }

  /* The button above already names it; the heading stays for screen readers */
  .co-summary__toggle:not([hidden]) + .co-summary__panel .summary__title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .placed__pay {
    padding: 14px 16px;
  }
}

/* A narrow form column (phones, tablets beside the summary): one field per row */
.co-main {
  container-type: inline-size;
}

@container (max-width: 520px) {
  .co-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .co-fields .form-row-first,
  .co-fields .form-row-last {
    grid-column: 1 / -1;
  }
}
