/* Buyback in the cart drawer — trade-in line, promo banner, the "Tagasiost"
   panel (interstitial / wizard / next steps) that slides over the theme's
   #cart-drawer. Loaded on every page where the drawer exists; the wizard's own
   styles (buyback.css) are fetched lazily the first time the wizard opens.
   Tokens mirror src/css/theme.scss (same values as buyback.css :root). */

:root {
  --bb-ink: #192435;
  --bb-muted: #5D6D86;
  --bb-muted-2: #D1D2D6;
  --bb-soft: #F4F8FF;
  --bb-soft-2: #E7EFFC;
  --bb-neutral-bg: #FAFAFA;
  --bb-line: #F0F0F0;
  --bb-green: #2AC769;
  --bb-green-wash: rgba(42, 199, 105, 0.08);
  --bb-accent: #3D4FE1;
  --bb-accent-ink: #192BC2;
  --bb-shadow-card: 0px 12px 80px 0px rgba(0, 0, 0, 0.08);
  --bb-shadow-sm: 0px 12px 40px 0px rgba(0, 0, 0, 0.04);
}

/* ---------- trade-in line inside the cart list ---------- */
#cart-drawer .tc-bb-item .tc-bb-thumb { width: 72px; height: 72px; border-radius: 8px; background: var(--bb-green-wash); color: var(--bb-green); display: grid; place-items: center; }
#cart-drawer .tc-bb-item .cart-drawer-name { color: var(--bb-ink); }
#cart-drawer .tc-bb-item .cart-drawer-meta { text-transform: none; }
/* the theme's sticky column .cart-drawer-footer rule also hits the per-item footer */
#cart-drawer .tc-bb-item .cart-drawer-footer { position: static; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 4px 16px; }
#cart-drawer .tc-bb-item .cart-drawer-price { color: var(--bb-green); white-space: nowrap; }

/* ---------- promo banner (no trade-in yet) ---------- */
#cart-drawer .tc-bb-promo { display: flex; align-items: center; gap: 14px; margin: 4px 0 0; padding: 16px 16px 16px 18px; border: 1px solid var(--bb-accent); border-radius: 12px; background: linear-gradient(180deg, var(--bb-soft-2), #fff); color: var(--bb-ink); text-decoration: none; transition: box-shadow 0.15s ease; cursor: pointer; }
#cart-drawer .tc-bb-promo:hover { box-shadow: var(--bb-shadow-sm); text-decoration: none; color: var(--bb-ink); }
#cart-drawer .tc-bb-promo .tc-bb-promo-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--bb-accent-ink); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
#cart-drawer .tc-bb-promo .tc-bb-promo-txt { display: flex; flex-direction: column; gap: 3px; }
#cart-drawer .tc-bb-promo .tc-bb-promo-txt b { font-size: 14px; font-weight: 700; line-height: 1.3; }
#cart-drawer .tc-bb-promo .tc-bb-promo-txt span { font-size: 12.5px; color: var(--bb-muted); line-height: 1.4; }
#cart-drawer .tc-bb-promo .tc-bb-promo-arrow { margin-left: auto; color: var(--bb-accent-ink); display: grid; place-items: center; flex-shrink: 0; }

/* ---------- "after trade-in" row under the subtotal ---------- */
#cart-drawer .tc-bb-after { display: none; justify-content: space-between; font-family: Inter, system-ui, sans-serif; font-size: 14px; line-height: 24px; color: var(--bb-accent-ink); margin-top: 2px; }
#cart-drawer .tc-bb-after.is-visible { display: flex; }
#cart-drawer .tc-bb-after b { font-weight: 700; }

/* ---------- the Tagasiost panel over the drawer ---------- */
#tc-bb-drawer { position: absolute; inset: 0; z-index: 5; display: none; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden; font-family: Inter, system-ui, sans-serif; color: var(--bb-ink); font-size: 14px; line-height: 1.5; }
#tc-bb-drawer.is-open { display: flex; }
#tc-bb-drawer *, #tc-bb-drawer *::before, #tc-bb-drawer *::after { box-sizing: border-box; }
#tc-bb-drawer h2, #tc-bb-drawer h3, #tc-bb-drawer h4, #tc-bb-drawer h5 { font-family: inherit; margin: 0; color: var(--bb-ink); }
#tc-bb-drawer button { font-family: inherit; }

#tc-bb-drawer .tc-bb-head { position: relative; display: flex; align-items: center; padding: 24px 48px 16px; border-bottom: 1px solid var(--bb-line); flex-shrink: 0; }
#tc-bb-drawer .tc-bb-head .tc-bb-title { position: absolute; left: 0; right: 0; text-align: center; font-size: 18px; font-weight: 600; pointer-events: none; }
#tc-bb-drawer .tc-bb-head .tc-bb-close { position: relative; z-index: 1; }
/* the theme sizes the padded 16px icon in content-box terms */
#tc-bb-drawer .tc-bb-head .round-icon { box-sizing: content-box; }
#tc-bb-drawer .tc-bb-body { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 24px 32px; display: flex; flex-direction: column; }
#tc-bb-drawer .tc-bb-body > .wiz { flex: 1; }

/* interstitial */
#tc-bb-drawer .tc-bb-inter { display: flex; flex-direction: column; flex: 1; }
#tc-bb-drawer .tc-bb-inter h2 { font-size: 20px; font-weight: 600; line-height: 1.3; margin-bottom: 16px; text-wrap: balance; }
#tc-bb-drawer .tc-bb-inter-card { border: 1px solid var(--bb-line); border-radius: 12px; background: #fff; padding: 16px; box-shadow: var(--bb-shadow-sm); }
#tc-bb-drawer .tc-bb-inter-tag { display: inline-block; background: var(--bb-soft-2); color: var(--bb-accent-ink); font-weight: 600; font-size: 11px; padding: 4px 8px; border-radius: 6px; margin-bottom: 12px; }
#tc-bb-drawer .tc-bb-inter-row { display: flex; gap: 14px; align-items: center; }
#tc-bb-drawer .tc-bb-inter-thumb { width: 56px; height: 64px; border-radius: 8px; background: var(--bb-neutral-bg); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
#tc-bb-drawer .tc-bb-inter-thumb img { max-width: 48px; max-height: 56px; object-fit: contain; }
#tc-bb-drawer .tc-bb-inter-name { font-weight: 600; font-size: 15px; }
#tc-bb-drawer .tc-bb-inter-price { font-weight: 700; font-size: 24px; color: var(--bb-accent-ink); line-height: 1.1; margin-top: 2px; }
#tc-bb-drawer .tc-bb-inter-price .woocommerce-Price-amount, #tc-bb-drawer .tc-bb-inter-price .woocommerce-Price-currencySymbol { font: inherit; color: inherit; }
#tc-bb-drawer .tc-bb-inter-price sup { font-size: 12px; vertical-align: top; }
#tc-bb-drawer .tc-bb-inter-note { color: var(--bb-muted); font-size: 12px; line-height: 1.5; margin: 12px 0 0; }
#tc-bb-drawer .tc-bb-inter-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 24px; }
#tc-bb-drawer .tc-bb-inter-opt { border: 1px solid var(--bb-line); border-radius: 10px; padding: 12px; text-align: center; cursor: pointer; background: #fff; transition: all 0.15s ease; width: 100%; }
#tc-bb-drawer .tc-bb-inter-opt:hover { border-color: var(--bb-accent); background: var(--bb-soft); }
#tc-bb-drawer .tc-bb-inter-opt.primary { border-color: var(--bb-accent-ink); background: var(--bb-soft); }
#tc-bb-drawer .tc-bb-inter-opt .io-t { font-weight: 600; font-size: 15px; }
#tc-bb-drawer .tc-bb-inter-opt .io-s { color: var(--bb-muted); font-size: 12px; margin-top: 1px; }

/* next steps */
#tc-bb-drawer .tc-bb-ns h3 { font-size: 18px; font-weight: 600; line-height: 1.3; margin-bottom: 8px; }
#tc-bb-drawer .tc-bb-ns > p { color: var(--bb-muted); font-size: 14px; line-height: 1.55; margin: 0 0 22px; }
#tc-bb-drawer .tc-bb-ns > p b { color: var(--bb-ink); }
#tc-bb-drawer .tc-bb-ns .ns-steps { display: flex; flex-direction: column; gap: 18px; }
#tc-bb-drawer .tc-bb-ns .ns-step { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start; }
#tc-bb-drawer .tc-bb-ns .ns-num { width: 26px; height: 26px; border-radius: 50%; background: var(--bb-soft-2); color: var(--bb-ink); font-weight: 600; font-size: 13px; display: grid; place-items: center; }
#tc-bb-drawer .tc-bb-ns h5 { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
#tc-bb-drawer .tc-bb-ns .ns-step p { color: var(--bb-muted); font-size: 13px; margin: 0; line-height: 1.5; }
#tc-bb-drawer .tc-bb-ns-actions { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 10px; }

/* shared buttons (same ramp as buyback.css, needed before it is loaded) */
#tc-bb-drawer .tc-bb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; border-radius: 8px; padding: 14px 20px; cursor: pointer; border: 1px solid transparent; transition: all 0.15s ease; white-space: nowrap; text-decoration: none; line-height: 16px; width: 100%; }
#tc-bb-drawer .tc-bb-btn-accent { background: var(--bb-accent-ink); color: #fff; }
#tc-bb-drawer .tc-bb-btn-accent:hover { background: var(--bb-accent); }
#tc-bb-drawer .tc-bb-btn-ghost { background: #fff; color: var(--bb-ink); border-color: var(--bb-line); }
#tc-bb-drawer .tc-bb-btn-ghost:hover { background: var(--bb-neutral-bg); }

#tc-bb-drawer .tc-bb-loading { color: var(--bb-muted); font-size: 14px; text-align: center; padding: 40px 0; }
#tc-bb-drawer .tc-bb-err { color: #C5014C; font-size: 13px; margin-top: 10px; text-align: center; }

@media only screen and (max-width: 767px) {
  #tc-bb-drawer { border-radius: 0; }
  #tc-bb-drawer .tc-bb-head { padding: 24px 24px 16px; }
  #tc-bb-drawer .tc-bb-inter h2 { font-size: 19px; }
}
