/* ============================================================================
 * Upsell block template styles (.wf-* classes).
 * Ported from the prototype (docs/upselling/prototype/style.css + templates.html).
 * Loaded both on the front (page render) and in admin (mini-preview).
 * ============================================================================ */

/* ── CTA buttons ────────────────────────────────────────────────────────── */
.wf-cta-button {
  background: #2271b1;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 3px;
  font-size: 14px;
  cursor: pointer;
}
.wf-cta-button:hover { background: #135e96; }

.wf-cta-button-secondary {
  background: #fff;
  color: #2271b1;
  border: 1px solid #2271b1;
  padding: 10px 20px;
  border-radius: 3px;
  font-size: 14px;
  cursor: pointer;
}

.wf-cta-button-sm { padding: 5px 12px; font-size: 12px; }

/* ── Generic upsell block ───────────────────────────────────────────────── */
.wf-upsell-block {
  margin: 0 0 24px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 20px 24px;
}
.wf-upsell-block .wf-upsell-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary, #1a2d60);
  line-height: 1.3;
}
.wf-upsell-block .wf-upsell-desc {
  margin: 0 0 16px;
  color: var(--primary, #1a2d60);
  font-size: 14px;
  line-height: 1.4;
}
.wf-upsell-block .wf-cta-button {
  background: var(--primary, #1a2d60);
  color: #fff; border: none;
  padding: 12px 22px; border-radius: 6px;
  font-weight: 700; font-size: 14px;
  cursor: pointer;
}
.wf-upsell-block .wf-cta-button:hover { filter: brightness(1.1); }
.wf-upsell-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.wf-upsell-savings {
  font-size: 12px;
  color: #2c7a4b;
  font-weight: 600;
  margin: 4px 0 8px;
}

.upsell-brow {
  font-size: 11px;
  color: #646970;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Inline (cart_inline) ──────────────────────────────────────────────── */
.wf-upsell-inline { margin: 8px 0 0 0; }

/* ── Snack (checkout_sb) ───────────────────────────────────────────────── */
.wf-upsell-snack {
  display: flex; align-items: center; gap: 12px;
  background: #f3f4f6; border-radius: 8px;
  padding: 8px 12px;
  margin: 6px 0 0 0;
}
.wf-snack-icon {
  width: 50px; height: 50px; flex-shrink: 0;
  padding: 6px;
  box-sizing: border-box;
  background-image: url('add-layer.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-origin: content-box;
}
.wf-snack-text {
  flex: 1; min-width: 0;
  font-weight: 700; color: var(--primary, #1a2d60); font-size: 14px; line-height: 1.3;
}
.wf-upsell-snack .wf-cta-button {
  white-space: nowrap;
  background: var(--primary, #1a2d60);
  color: #fff; border: none;
  padding: 10px 18px; border-radius: 6px;
  font-weight: 700; font-size: 13px;
  cursor: pointer;
}
.wf-upsell-snack .wf-cta-button:hover { filter: brightness(1.1); }

/* ── Multi-picker (3 variants) ─────────────────────────────────────────── */
.wf-upsell-multi { padding: 0; }
.wf-upsell-multi .wf-upsell-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary, #1a2d60);
  line-height: 1.3;
}
.wf-upsell-multi .wf-upsell-desc { margin: 0 0 24px; color: var(--primary, #1a2d60); font-size: 22px; font-weight: 700; line-height:1.3; }
.wf-multi-list { display: flex; flex-direction: column; gap: 12px; }
.wf-multi-row {
  display: flex; align-items: center; gap: 16px;
  background: #f3f4f6; border-radius: 8px; padding: 10px 14px;
}
.wf-multi-image {
  width: 64px; height: 64px; object-fit: contain; flex-shrink: 0;
  background: #fff; border-radius: 4px;
}
.wf-multi-image[src=""], .wf-multi-image:not([src]) { display: none; }
.wf-multi-name {
  flex: 1; min-width: 0;
  font-weight: 700; color: var(--primary, #1a2d60); font-size: 15px;
}
.wf-multi-price {
  white-space: nowrap; font-weight: 700; font-size: 15px;
  color: #16a34a;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.wf-multi-price .woocommerce-Price-amount { color: inherit; }
.wf-multi-price .woocommerce-price-suffix { font-size: 12px; font-weight: 500; color: #4b5563; }
.wf-multi-row .wf-cta-button {
  white-space: nowrap;
  background: var(--primary, #1a2d60);
  color: #fff; border: none;
  padding: 12px 22px; border-radius: 6px;
  font-weight: 700; font-size: 14px;
  cursor: pointer;
}
.wf-multi-row .wf-cta-button:hover { filter: brightness(1.1); }

/* ── Compare (compare_table) ───────────────────────────────────────────── */
.wf-upsell-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.wf-compare-cell {
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 10px;
  text-align: center;
  font-size: 12px;
  border-radius: 3px;
}
.wf-compare-cell-active {
  background: #f0f6fc;
  border: 2px solid #2271b1;
}
.wf-compare-label { font-weight: 600; }
.wf-compare-price { color: #646970; margin: 2px 0 6px; }
.wf-compare-meta  { color: #8c8f94; font-size: 11px; }

/* ── Card (product_card) ───────────────────────────────────────────────── */
.wf-upsell-card {}
.wf-upsell-card-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 8px;
}
.wf-upsell-thumb {
  width: 60px;
  height: 60px;
  background: #e0e0e0;
  border-radius: 3px;
  flex-shrink: 0;
}
.wf-upsell-card-body {
  flex: 1;
  min-width: 0;
}
.wf-upsell-price {
  color: #646970;
  font-size: 12px;
  margin: 2px 0 8px;
}

/* ── Info (without CTA) ────────────────────────────────────────────────── */
.wf-upsell-info {
  background: #fff8e5;
  border: 1px solid #e4b143;
  border-radius: 4px;
  padding: 14px 16px;
}

/* ── Popup / close ─────────────────────────────────────────────────────── */
.wf-upsell-popup { position: relative; }
.wf-upsell-close {
  position: absolute;
  top: 8px;
  right: 10px;
  color: #8c8f94;
  cursor: pointer;
  font-size: 16px;
}

/* ── Progress-bar ──────────────────────────────────────────────────────── */
.wf-progress-bar {
  background: #e5e7eb;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  margin: 0 0 14px;
}
.wf-progress-fill {
  background: linear-gradient(90deg, var(--primary, #1a2d60) 0%, #16a34a 100%);
  height: 100%;
  border-radius: 7px;
  transition: width .3s;
}
