/**
 * Zhiva Panel — customer-facing wallet cashback bar
 *
 * Rendered in the classic cart (above the totals box) and via the
 * [zhiva_wallet_cashback] shortcode. Minimal, theme-neutral, no JS.
 *
 * The markup is <div>/<span> only — no <p>, <strong>, <h*>, <ul> etc. — so
 * store themes have nothing of their own to style here. On top of that every
 * descendant is hard-reset below, and each colour is a CSS custom property so
 * a theme can restyle the whole element with one override block on `.zhiva-cbb`.
 */

/* fragment wrapper (shortcode instance) — a bare passthrough */
.zhiva-cbb-fragment {
  display: block;
}

.zhiva-cbb-fragment:empty {
  display: none;
}

/* ---- reset: wipe anything the theme puts on generic elements ------------- */
.zhiva-cbb,
.zhiva-cbb * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  outline: 0;
  float: none;
  list-style: none;
  text-align: inherit;
  text-transform: none;
  text-shadow: none;
  letter-spacing: normal;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-style: normal;
  line-height: inherit;
  color: inherit;
  text-decoration: none;
  box-shadow: none;
  transition: none;
  animation: none;
}

/* WooCommerce injects <span class="woocommerce-Price-amount"><bdi>…</bdi></span>
   through wc_price(); keep it inline and inheriting, whatever the theme does. */
.zhiva-cbb .woocommerce-Price-amount,
.zhiva-cbb .woocommerce-Price-currencySymbol,
.zhiva-cbb bdi {
  display: inline;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

/* ---- element ------------------------------------------------------------- */
.zhiva-cbb {
  --zhiva-cbb-bg: #f4faf6;
  --zhiva-cbb-border: #d7ebdf;
  --zhiva-cbb-fg: #1f2d27;
  --zhiva-cbb-muted: #5c6f66;
  --zhiva-cbb-accent: #129a5b;
  --zhiva-cbb-track: #e4efe8;
  --zhiva-cbb-radius: 14px;

  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  direction: rtl;
  text-align: right;
  background: var(--zhiva-cbb-bg);
  border: 1px solid var(--zhiva-cbb-border);
  border-radius: var(--zhiva-cbb-radius);
  color: var(--zhiva-cbb-fg);
  font-size: 14px;
  line-height: 1.75;
}

/* progress state leans "informational blue" rather than "reward green" */
.zhiva-cbb--progress {
  --zhiva-cbb-bg: #f5f8fb;
  --zhiva-cbb-border: #e0e7ee;
  --zhiva-cbb-accent: #2b74e0;
  --zhiva-cbb-track: #e6ebf2;
}

.zhiva-cbb__icon {
  flex: 0 0 auto;
  display: block;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  color: var(--zhiva-cbb-accent);
}

.zhiva-cbb__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.zhiva-cbb__icon svg,
.zhiva-cbb__icon svg * {
  fill: none;
  stroke: currentColor;
}

.zhiva-cbb__body {
  flex: 1 1 auto;
  min-width: 0;
}

.zhiva-cbb__title {
  display: block;
  font-weight: 500;
  color: var(--zhiva-cbb-fg);
}

.zhiva-cbb__em {
  font-weight: 700;
  color: var(--zhiva-cbb-accent);
  white-space: nowrap;
}

.zhiva-cbb__hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 13px;
  color: var(--zhiva-cbb-muted);
}

.zhiva-cbb__hint .zhiva-cbb__em {
  font-weight: 600;
  color: var(--zhiva-cbb-fg);
}

.zhiva-cbb__track {
  display: block;
  margin: 0.55rem 0 0.15rem;
  height: 8px;
  border-radius: 999px;
  background: var(--zhiva-cbb-track);
  overflow: hidden;
}

.zhiva-cbb__fill {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: var(--zhiva-cbb-accent);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .zhiva-cbb__fill {
    transition: none;
  }
}
