/* ============================================================
   LBS cart + checkout (classic WooCommerce pages)
   Ported from the Claude Design export lib/pages.css (CHECKOUT
   STEPS / CARRINHO / CHECKOUT / Confirmation blocks).
   Relies on the site-wide tokens + .lbs-btn / .ct-form__row /
   .ct-form__consent / .cand-* rules in the hello-elementor-lbs
   child theme (lbs-components.css).
   ============================================================ */

.co-page { --color-danger: #B53A2A; --color-danger-bg: #FCE9E5; background: #fff; font-family: var(--font-sans); }

/* Body section gutter (design .lbs-section--tight, renamed so it
   does not fight the theme's .lbs-section padding rules). */
.co-section { padding: 64px 48px; }
.co-section__container { max-width: 1440px; margin: 0 auto; }

/* Hidden-but-submittable controls (cart update button, gateway radios). */
.lbs-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; border: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* WooCommerce notices, restyled to the design language. */
.co-page .woocommerce-message,
.co-page .woocommerce-info,
.co-page .woocommerce-error {
  list-style: none;
  margin: 0 0 28px; padding: 14px 18px;
  background: var(--lbs-bone); border: 1px solid var(--color-border);
  font-size: 14px; color: var(--lbs-ink-600);
}
.co-page .woocommerce-error { background: var(--color-danger-bg); border-color: var(--color-danger); color: var(--color-danger); }
.co-page .woocommerce-error li { margin: 0 0 4px; padding: 0; }
.co-page .woocommerce-error li:last-child { margin: 0; }
/* Woo paints its glyph as an absolutely-positioned ::before on the container
   (and on error list items) — the design language has no icon. */
.co-page .woocommerce-message::before,
.co-page .woocommerce-info::before,
.co-page .woocommerce-error::before,
.co-page .woocommerce-error li::before { display: none; content: none; }
.co-page .woocommerce-message .button,
.co-page .woocommerce-info .button { float: right; font-weight: 700; color: var(--lbs-navy); background: none; border: none; cursor: pointer; text-decoration: underline; font-size: 13px; }

/* ============================================================
   CHECKOUT STEPS + compact page header
   ============================================================ */
.co-steps { border-bottom: 1px solid var(--color-border); background: #fff; }
.co-steps__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 48px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.co-step { display: inline-flex; align-items: center; gap: 11px; }
.co-step__n {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border);
  font-size: 13px; font-weight: 800;
  color: var(--lbs-ink-400);
  background: #fff;
}
.co-step__label {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--lbs-ink-400);
}
.co-step[data-state="active"] .co-step__n { background: var(--lbs-navy); border-color: var(--lbs-navy); color: #fff; }
.co-step[data-state="active"] .co-step__label { color: var(--lbs-navy); }
.co-step[data-state="done"] .co-step__n { background: var(--lbs-cyan); border-color: var(--lbs-cyan); color: #fff; }
.co-step[data-state="done"] .co-step__label { color: var(--lbs-ink-600); }
.co-step__bar { flex: 1; height: 1px; background: var(--color-border); max-width: 120px; }
.co-step__bar[data-filled="true"] { background: var(--lbs-cyan); }

.co-pagehead { background: #fff; }
.co-pagehead__inner { max-width: 1440px; margin: 0 auto; padding: 44px 48px 28px; }
.co-pagehead h1 {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(34px, 4vw, 46px);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--lbs-navy);
  margin: 0;
  line-height: 1;
}
.co-pagehead p { font-size: 15px; color: var(--lbs-ink-600); margin: 14px 0 0; max-width: 60ch; line-height: 1.55; }
@media (max-width: 900px) { .co-pagehead__inner { padding: 32px 24px 20px; } }

/* ============================================================
   CARRINHO (cart) PAGE
   ============================================================ */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 384px;
  gap: 48px;
  align-items: start;
}
.cart-main__head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 18px; margin-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.cart-main__head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--lbs-ink); margin: 0; }
.cart-main__head a,
.cart-summary__cont {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--lbs-navy);
  cursor: pointer; text-decoration: none;
}
.cart-main__head a:hover, .cart-summary__cont:hover { color: var(--lbs-cyan-700); }

/* Shared order thumbnail */
.ord-thumb {
  position: relative; flex-shrink: 0; overflow: hidden;
  background: var(--lbs-navy);
}
.ord-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ord-thumb__mono {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.9); font-weight: 900; font-size: 22px; letter-spacing: -0.02em;
}

/* Cart line */
.cart-line {
  display: grid;
  grid-template-columns: 104px 1fr auto;
  gap: 22px;
  padding: 26px 0;
  border-bottom: 1px solid var(--color-border);
}
.cart-line__cat {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--lbs-cyan-700); margin-bottom: 6px;
}
.cart-line__title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--lbs-ink); margin: 0 0 4px; line-height: 1.3; }
.cart-line__title a { color: inherit; text-decoration: none; }
.cart-line__title a:hover { color: var(--lbs-navy); }
.cart-line__instr { font-size: 13px; color: var(--lbs-ink-600); margin-bottom: 10px; }
.cart-line__meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--lbs-ink-400); margin-bottom: 16px; }
.cart-line__meta .dot { color: var(--lbs-mist); }
.cart-line__controls { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cart-line__qty { display: flex; align-items: center; gap: 12px; }
.cart-line__qty-l { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lbs-ink-600); }
.cart-line__remove {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600; color: var(--lbs-ink-400);
  text-decoration: none;
  transition: color 160ms;
}
.cart-line__remove:hover { color: var(--color-danger); }
.cart-line__price { text-align: right; min-width: 96px; }
.cart-line__price-now { font-size: 19px; font-weight: 800; color: var(--lbs-navy); letter-spacing: -0.01em; }
.cart-line__price-old { font-size: 13px; color: var(--lbs-ink-400); text-decoration: line-through; margin-top: 2px; }
.cart-line__price-unit { font-size: 11.5px; color: var(--lbs-ink-400); margin-top: 4px; }

/* Quantity stepper (design used a span; ours is a real qty input) */
.qty-stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--lbs-slate-300);
}
.co-page .qty-stepper button {
  width: 34px; height: 34px; padding: 0; margin: 0; border-radius: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: none; cursor: pointer; color: var(--lbs-navy);
  transition: background 150ms;
}
.co-page .qty-stepper button:hover:not(:disabled) { background: var(--lbs-bone); }
.co-page .qty-stepper button:disabled { color: var(--lbs-mist); cursor: not-allowed; }
.qty-stepper input {
  width: 40px; height: 34px; text-align: center;
  font-family: var(--font-sans); font-size: 15px; font-weight: 700; color: var(--lbs-ink);
  border: none; border-left: 1px solid var(--lbs-slate-300); border-right: 1px solid var(--lbs-slate-300);
  outline: none; background: #fff;
  -moz-appearance: textfield; appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Summary card (shared shell) */
.cart-summary, .co-summary {
  position: sticky; top: 104px;
  background: #fff;
  border: 1px solid var(--color-border);
  padding: 28px;
}
.cart-summary__head {
  font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--lbs-navy); margin: 0 0 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.cart-summary__rows { display: flex; flex-direction: column; gap: 11px; padding: 4px 0 18px; }
.sum-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--lbs-ink-600); }
.sum-row span:last-child { font-weight: 600; color: var(--lbs-ink); }
.sum-row--save span { color: var(--color-success) !important; font-weight: 700; }
.sum-row--muted span { color: var(--lbs-ink-400) !important; font-weight: 500 !important; }
.sum-row__remove { font-size: 11px; font-weight: 600; color: var(--lbs-ink-400) !important; margin-left: 6px; text-decoration: underline; }
.sum-row__remove:hover { color: var(--color-danger) !important; }

/* Promo */
.promo { border-top: 1px solid var(--color-border); padding-top: 18px; margin-bottom: 4px; }
.promo__row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.promo__row input {
  font-family: var(--font-sans); font-size: 14px;
  padding: 11px 13px; border: 1px solid var(--lbs-slate-300); background: #fff;
  min-width: 0; outline: none;
}
.promo__row input:focus { border-color: var(--lbs-navy); box-shadow: 0 0 0 3px rgba(0,162,195,0.16); }
.promo__row .lbs-btn { padding: 11px 18px; }
.promo__msg { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; margin-top: 9px; }
.promo__msg--ok { color: var(--color-success); }
.promo__msg--err { color: var(--color-danger); }

.cart-summary__total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 18px 0 4px; margin-top: 14px;
  border-top: 1px solid var(--lbs-navy);
}
.cart-summary__total span { font-size: 15px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--lbs-ink); }
.cart-summary__total strong { font-size: 28px; font-weight: 800; color: var(--lbs-navy); letter-spacing: -0.02em; }
.cart-summary__split { font-size: 12.5px; color: var(--lbs-ink-400); text-align: right; margin-bottom: 20px; }
.cart-summary__go { margin-top: 20px; }
.cart-summary__cont { justify-content: center; width: 100%; margin-top: 14px; }

.cart-trust { list-style: none; margin: 22px 0 0; padding: 20px 0 0; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 12px; }
.cart-trust li { display: flex; align-items: center; gap: 11px; font-size: 13px; color: var(--lbs-ink-600); }
.cart-trust li svg { color: var(--lbs-navy); flex-shrink: 0; }

/* Empty */
.cart-empty { text-align: center; padding: 80px 24px; max-width: 480px; margin: 0 auto; }
.cart-empty__icon {
  width: 84px; height: 84px; margin: 0 auto 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--lbs-bone); border: 1px solid var(--color-border); color: var(--lbs-navy);
}
.cart-empty h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; color: var(--lbs-ink); margin: 0 0 12px; }
.cart-empty p { font-size: 15px; line-height: 1.6; color: var(--lbs-ink-600); margin: 0 auto 28px; max-width: 40ch; }

/* ============================================================
   CHECKOUT PAGE
   ============================================================ */
.co-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 48px;
  align-items: start;
}
.co-form {
  background: #fff;
  border: 1px solid var(--color-border);
  padding: 36px 40px 32px;
}
.co-form .cand-fieldset:last-of-type { margin-bottom: 24px; }

.co-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 18px; font-size: 14px; font-weight: 600; color: var(--lbs-ink); }
.co-switch input { width: 17px; height: 17px; accent-color: var(--lbs-navy); }
.co-consent { margin-bottom: 0 !important; }

/* WooCommerce form rows mapped onto the design's .ct-field look. */
.co-form .form-row {
  display: flex; flex-direction: column; gap: 7px;
  float: none; width: auto; padding: 0; margin: 0;
}
.co-form .form-row label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lbs-ink-600); }
.co-form .form-row label .optional { display: none; }
.co-form .form-row .required { display: none; } /* the design marks nothing as required */
.co-form .woocommerce-input-wrapper { display: block; width: 100%; }
.co-form .form-row input.input-text {
  font-family: var(--font-sans); font-size: 14px; color: var(--lbs-ink); background: var(--lbs-paper);
  border: 1px solid var(--color-border-strong); padding: 12px 14px; outline: none; width: 100%; box-sizing: border-box;
  border-radius: 0;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.co-form .form-row input.input-text:focus { border-color: var(--lbs-navy); box-shadow: 0 0 0 3px rgba(0,162,195,0.16); }
.co-form .form-row.woocommerce-invalid input.input-text { border-color: var(--color-danger); box-shadow: none; }
/* The design has no green "validated" state — keep the neutral border. */
.co-form .form-row.woocommerce-validated input.input-text { border-color: var(--color-border-strong); }
.co-form .form-row.woocommerce-validated input.input-text:focus { border-color: var(--lbs-navy); }
.co-form .ct-form__row { margin-bottom: 16px; }
.co-form .ct-form__row:last-child { margin-bottom: 0; }
.co-company { margin-bottom: 0; }
.co-company[hidden] { display: none; }

/* Payment methods */
.pay-methods { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.wc_payment_method { position: relative; }
.pay-method {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 16px 18px; border: 1px solid var(--lbs-slate-300); cursor: pointer;
  transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out);
}
.pay-method:hover { border-color: var(--lbs-navy); }
.wc_payment_method input.input-radio:checked + .pay-method { border-color: var(--lbs-navy); background: var(--lbs-bone); }
.pay-method__icon { color: var(--lbs-navy); display: inline-flex; }
.pay-method__text { display: flex; flex-direction: column; gap: 2px; }
.pay-method__label { font-size: 14.5px; font-weight: 700; color: var(--lbs-ink); }
.pay-method__desc { font-size: 12.5px; color: var(--lbs-ink-400); }
.pay-method__radio {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--lbs-slate-300); position: relative; flex-shrink: 0;
  transition: border-color 160ms;
}
.wc_payment_method input.input-radio:checked + .pay-method .pay-method__radio { border-color: var(--lbs-navy); }
.wc_payment_method input.input-radio:checked + .pay-method .pay-method__radio::after {
  content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--lbs-navy);
}

/* Kill WooCommerce's stock #payment chrome (grey panel + box arrows). */
.co-page #payment { background: transparent; border-radius: 0; }
.co-page #payment div.payment_box::before { display: none; }
.co-page #payment ul.payment_methods { border-bottom: none; padding: 0; }

/* Gateway detail box (fields / instructions of the selected method) */
.co-page #payment div.payment_box.pay-detail,
.payment_box.pay-detail {
  margin-top: 10px; padding: 14px 16px;
  background: var(--lbs-bone); border: 1px solid var(--color-border);
  font-size: 13px; line-height: 1.5; color: var(--lbs-ink-600);
}
.payment_box.pay-detail p { margin: 0 0 8px; }
.payment_box.pay-detail p:last-child { margin: 0; }
.payment_box.pay-detail input.input-text,
.payment_box.pay-detail input[type="text"],
.payment_box.pay-detail input[type="tel"] {
  font-family: var(--font-sans); font-size: 14px; color: var(--lbs-ink);
  border: 1px solid var(--color-border-strong); padding: 10px 12px; width: 100%; box-sizing: border-box;
  background: #fff; outline: none; border-radius: 0;
}

/* Checkout summary line items */
.co-summary__items { display: flex; flex-direction: column; gap: 14px; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid var(--color-border); }
.co-sumline { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; }
.co-sumline__title { font-size: 13.5px; font-weight: 700; color: var(--lbs-ink); line-height: 1.3; }
.co-sumline__meta { font-size: 12px; color: var(--lbs-ink-400); margin-top: 3px; }
.co-sumline__price { font-size: 14px; font-weight: 700; color: var(--lbs-navy); }
.co-summary__fine { font-size: 12px; line-height: 1.55; color: var(--lbs-ink-400); margin: 16px 0 0; }
.co-summary #place_order { margin-top: 20px; }
/* Lock glyph via mask — checkout.js rewrites the button's text content. */
.co-summary #place_order::before {
  content: ''; width: 15px; height: 15px; margin-right: 8px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="11" width="14" height="9"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="11" width="14" height="9"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/></svg>') center / contain no-repeat;
}

/* Confirmation */
.co-done { max-width: 680px; margin: 0 auto; text-align: center; padding: 40px 0; }
.co-done__icon {
  width: 72px; height: 72px; margin: 0 auto 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--lbs-navy); color: #fff;
}
.co-done__icon--failed { background: var(--color-danger); }
.co-done__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--lbs-cyan-700); margin-bottom: 14px; }
.co-done__title { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: var(--lbs-ink); margin: 0 0 16px; line-height: 1.15; }
.co-done__lead { font-size: 16px; line-height: 1.6; color: var(--lbs-ink-600); margin: 0 auto 32px; max-width: 54ch; }
.co-done__ref {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--color-border); margin-bottom: 32px;
}
.co-done__ref div { padding: 20px 16px; }
.co-done__ref div:not(:last-child) { border-right: 1px solid var(--color-border); }
.co-done__ref span { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lbs-ink-400); margin-bottom: 8px; }
.co-done__ref strong { font-size: 20px; font-weight: 800; color: var(--lbs-navy); letter-spacing: -0.01em; }
.co-done__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Gateway thank-you instructions (Multibanco ref, IBAN…) inside .co-done */
.co-done .woocommerce-bacs-bank-details,
.co-done section, .co-done ul.order_details {
  list-style: none; margin: 0 0 32px; padding: 18px;
  border: 1px solid var(--color-border); text-align: left; font-size: 14px;
}

/* Cart / checkout responsive */
@media (max-width: 1080px) {
  .cart-layout { grid-template-columns: 1fr 340px; gap: 32px; }
  .co-layout { grid-template-columns: 1fr 360px; gap: 32px; }
}
@media (max-width: 900px) {
  .co-section { padding: 40px 24px; }
  .co-steps__inner { padding: 18px 24px; }
  .co-step__label { display: none; }
  .co-step__bar { max-width: none; }
  .cart-layout, .co-layout { grid-template-columns: 1fr; gap: 36px; }
  .cart-summary, .co-summary { position: static; }
  .co-form { padding: 28px 22px 26px; }
  .cart-line { grid-template-columns: 84px 1fr; }
  .cart-line__price { grid-column: 2; text-align: left; margin-top: 4px; }
  .co-done__title { font-size: 27px; }
}
@media (max-width: 560px) {
  .cart-line { grid-template-columns: 1fr; }
  .co-done__ref { grid-template-columns: 1fr; }
  .co-done__ref div:not(:last-child) { border-right: none; border-bottom: 1px solid var(--color-border); }
}
