/* =========================================
   Product Finder Pro — Public Styles
   ========================================= */

:root {
  --pfp-primary: #f0a500;
  --pfp-secondary: #1a1a2e;
  --pfp-text: #1a1a2e;
  --pfp-text-muted: #6b7280;
  --pfp-bg: #f8f9fc;
  --pfp-card-bg: #ffffff;
  --pfp-border: #e5e7eb;
  --pfp-radius: 12px;
  --pfp-shadow: 0 2px 12px rgba(0,0,0,.08);
  --pfp-shadow-hover: 0 8px 24px rgba(0,0,0,.14);
  --pfp-transition: .22s ease;
}

.pfp-wizard-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 40px;
  font-family: inherit;
  color: var(--pfp-text);
  box-sizing: border-box;
}
.pfp-wizard-container *, .pfp-wizard-container *::before, .pfp-wizard-container *::after {
  box-sizing: inherit;
}

/* ============================================================
   "Match My Theme" mode (Design Settings → Match My Theme).
   A straight swap for .pfp-font-scope (see pfp-fonts.css) — this
   re-points every var(--pfp-*) the rest of this stylesheet already uses
   to neutral/inherited values instead, so buttons, borders, and text
   pick up the theme's own colors and typography through the normal CSS
   cascade instead of the plugin's own palette. No other selector in this
   file needs to know this mode exists.
   ============================================================ */
.pfp-theme-native {
  /* Modern block themes expose their palette as CSS custom properties;
     use the theme's own accent colors when available. NOTE: none of these
     fall back to currentColor/inherit — several rules elsewhere in this
     stylesheet set both `background: var(--pfp-primary-or-secondary)` and
     a hardcoded `color: #fff` on the SAME element (e.g. .pfp-btn-custom),
     and currentColor always resolves against that same element's own
     color wherever var() is finally substituted — not against wherever
     the custom property was declared. A currentColor/inherit fallback
     here would silently turn several buttons into white-text-on-white.
     Fixed, safe, theme-plausible fallback colors avoid that entirely. */
  --pfp-primary: var(--wp--preset--color--primary, #1e293b);
  --pfp-secondary: var(--wp--preset--color--secondary, var(--wp--preset--color--contrast, #1a1a2e));
  --pfp-text: var(--wp--preset--color--contrast, #1a1a2e);
  /* --pfp-text is never used as a background anywhere, so it's safe to
     derive the muted variant from it with color-mix() here. */
  --pfp-text-muted: color-mix(in srgb, var(--pfp-text) 65%, transparent);
  --pfp-bg: transparent;
  --pfp-card-bg: transparent;
  --pfp-border: color-mix(in srgb, var(--pfp-text) 20%, transparent);
  --pfp-radius: 6px;
  --pfp-shadow: none;
  --pfp-shadow-hover: none;
  color: inherit;
  font-family: inherit;
}
.pfp-theme-native * {
  font-family: inherit;
}

/* ---- Progress Bar ---- */
.pfp-progress-bar-wrap {
  height: 4px;
  background: var(--pfp-border);
  border-radius: 99px;
  margin-bottom: 0;
  overflow: hidden;
}
.pfp-progress-bar {
  height: 100%;
  background: var(--pfp-primary);
  border-radius: 99px;
  transition: width .5s ease;
}

/* ---- Top Nav ---- */
.pfp-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 4px;
  font-size: 13px;
  color: var(--pfp-text-muted);
}
.pfp-step-indicator { display: flex; align-items: center; gap: 4px; }
.pfp-step-indicator .pfp-step-sep { opacity: .5; }
.pfp-restart-btn {
  background: none;
  border: none;
  color: var(--pfp-text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--pfp-transition), color var(--pfp-transition);
}
.pfp-restart-btn:hover { background: var(--pfp-border); color: var(--pfp-text); }

/* ---- Step ---- */
.pfp-step { padding: 28px 0 0; animation: pfpFadeIn .3s ease; }
@keyframes pfpFadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

.pfp-step-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--pfp-primary);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.pfp-step-title {
  font-size: clamp(22px,4vw,34px);
  font-weight: 800;
  text-align: center;
  margin: 0 0 10px;
  line-height: 1.2;
  color: var(--pfp-secondary);
}
.pfp-step-subtitle {
  text-align: center;
  color: var(--pfp-text-muted);
  font-size: 15px;
  margin: 0 0 24px;
}
.pfp-step-description {
  text-align: center;
  color: var(--pfp-text-muted);
  font-size: 14px;
  margin: -12px 0 20px;
}

/* ---- Options — Cards layout ---- */
.pfp-options-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  justify-content: center;
  gap: 14px;
  margin: 0 0 24px;
}
.pfp-options-cards .pfp-option {
  background: var(--pfp-card-bg);
  border: 2px solid var(--pfp-border);
  border-radius: var(--pfp-radius);
  padding: 22px 16px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: border-color var(--pfp-transition), box-shadow var(--pfp-transition), transform var(--pfp-transition);
  user-select: none;
}
.pfp-options-cards .pfp-option:hover {
  border-color: var(--pfp-primary);
  box-shadow: var(--pfp-shadow-hover);
  transform: translateY(-2px);
}
.pfp-options-cards .pfp-option.selected {
  border-color: var(--pfp-primary);
  background: color-mix(in srgb, var(--pfp-primary) 8%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pfp-primary) 20%, transparent);
}
.pfp-option-icon { font-size: 36px; line-height: 1; }
.pfp-option-image img { width: 60px; height: 60px; object-fit: contain; border-radius: 8px; }
.pfp-option-name { font-weight: 700; font-size: 15px; color: var(--pfp-secondary); }
.pfp-option-desc { font-size: 12px; color: var(--pfp-text-muted); }

/* ---- Options — Pills layout ---- */
.pfp-options-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}
.pfp-options-pills .pfp-option {
  background: var(--pfp-card-bg);
  border: 2px solid var(--pfp-border);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--pfp-text);
  transition: all var(--pfp-transition);
  user-select: none;
}
.pfp-options-pills .pfp-option:hover { border-color: var(--pfp-primary); }
.pfp-options-pills .pfp-option.selected {
  background: var(--pfp-primary);
  border-color: var(--pfp-primary);
  color: #fff;
}
.pfp-options-pills .pfp-option-icon { display:inline; margin-right:6px; }
.pfp-options-pills .pfp-option-desc { display:none; }

/* ---- Options — List layout ---- */
.pfp-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.pfp-options-list .pfp-option {
  background: var(--pfp-card-bg);
  border: 2px solid var(--pfp-border);
  border-radius: var(--pfp-radius);
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--pfp-transition);
}
.pfp-options-list .pfp-option:hover { border-color: var(--pfp-primary); }
.pfp-options-list .pfp-option.selected { border-color: var(--pfp-primary); background: color-mix(in srgb, var(--pfp-primary) 6%, white); }
.pfp-options-list .pfp-option-icon { font-size: 26px; }
.pfp-options-list .pfp-option-name { font-weight: 600; }

/* ---- Options — Grid Icon layout ---- */
.pfp-options-grid-icon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.pfp-options-grid-icon .pfp-option {
  background: var(--pfp-card-bg);
  border: 2px solid var(--pfp-border);
  border-radius: var(--pfp-radius);
  padding: 18px 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: all var(--pfp-transition);
}
.pfp-options-grid-icon .pfp-option:hover { border-color: var(--pfp-primary); transform: translateY(-2px); }
.pfp-options-grid-icon .pfp-option.selected { border-color: var(--pfp-primary); background: color-mix(in srgb, var(--pfp-primary) 8%, white); }
.pfp-options-grid-icon .pfp-option-icon { font-size: 32px; }
.pfp-options-grid-icon .pfp-option-name { font-weight: 600; font-size: 13px; }

/* ---- Continue button (multi-select) ---- */
.pfp-multi-actions { text-align: center; margin-top: 8px; }
.pfp-continue-btn, .pfp-groups-continue-btn {
  background: var(--pfp-primary);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--pfp-transition);
}
.pfp-continue-btn:disabled { opacity: .4; cursor: default; }
.pfp-continue-btn:not(:disabled):hover, .pfp-groups-continue-btn:hover { opacity: .88; }

/* ---- Multi-box step: several independent attribute boxes in one step ---- */
.pfp-attr-groups { display: flex; flex-direction: column; gap: 22px; margin-bottom: 20px; }
.pfp-attr-group-box.pfp-attr-group-box--bordered {
  background: var(--pfp-card-bg, #fff);
  border: 1px solid var(--pfp-border);
  border-radius: var(--pfp-radius, 12px);
  padding: 16px;
}
.pfp-attr-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.pfp-attr-group-bullet {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--pfp-primary);
  flex-shrink: 0;
}
.pfp-attr-group-label { font-size: 15px; font-weight: 700; margin: 0; color: var(--pfp-secondary); }
.pfp-attr-group-search { margin-bottom: 12px; }
.pfp-group-search-input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--pfp-border);
  border-radius: 999px;
  font-size: 14px;
  box-sizing: border-box;
}
.pfp-group-search-input:focus { outline: none; border-color: var(--pfp-primary); }
.pfp-group-expand-btn {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: var(--pfp-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.pfp-group-expand-btn:hover { opacity: .8; }

/* ---- Step Footer (Back button) ---- */
.pfp-step-footer { text-align: center; margin-top: 20px; }
.pfp-back-btn {
  background: none;
  border: 2px solid var(--pfp-border);
  border-radius: 999px;
  padding: 10px 28px;
  font-size: 14px;
  cursor: pointer;
  color: var(--pfp-text-muted);
  transition: all var(--pfp-transition);
}
.pfp-back-btn:hover { border-color: var(--pfp-secondary); color: var(--pfp-secondary); }

/* ---- Loading Spinner ---- */
.pfp-step-loading { display: flex; justify-content: center; align-items: center; min-height: 160px; }
.pfp-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--pfp-border);
  border-top-color: var(--pfp-primary);
  border-radius: 50%;
  animation: pfpSpin .7s linear infinite;
}
@keyframes pfpSpin { to { transform: rotate(360deg); } }
.pfp-results-loading-text { margin: 0; font-size: 14px; color: var(--pfp-text-muted); text-align: center; }
.pfp-retry-results-btn {
  margin-top: 14px;
  background: var(--pfp-primary);
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--pfp-transition);
}
.pfp-retry-results-btn:hover { opacity: .88; }

/* ---- No options ---- */
.pfp-no-options { text-align: center; color: var(--pfp-text-muted); padding: 40px; }

/* ============================================
   RESULTS
   ============================================ */
.pfp-results { animation: pfpFadeIn .4s ease; }

.pfp-results-header { text-align: center; margin-bottom: 28px; }
.pfp-results-count-badge {
  display: inline-block;
  background: var(--pfp-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 16px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.pfp-results-title {
  font-size: clamp(22px,4vw,32px);
  font-weight: 800;
  color: var(--pfp-secondary);
  margin: 0 0 14px;
}
.pfp-results-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.pfp-tag {
  background: color-mix(in srgb, var(--pfp-primary) 12%, white);
  color: var(--pfp-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pfp-primary) 30%, transparent);
}
.pfp-restart-results-btn {
  display: inline-block;
  background: none;
  border: 2px solid var(--pfp-border);
  border-radius: 999px;
  padding: 8px 22px;
  font-size: 13px;
  cursor: pointer;
  color: var(--pfp-text-muted);
  margin-top: 8px;
  transition: all var(--pfp-transition);
}
.pfp-restart-results-btn:hover { border-color: var(--pfp-secondary); color: var(--pfp-secondary); }

/* ---- Product Grid ---- */
.pfp-products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ---- Product Card ---- */
.pfp-product-card {
  background: var(--pfp-card-bg);
  border: 2px solid var(--pfp-border);
  border-radius: var(--pfp-radius);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  position: relative;
  transition: box-shadow var(--pfp-transition);
}
.pfp-product-card:hover { box-shadow: var(--pfp-shadow-hover); }
.pfp-product-card--top { border-color: var(--pfp-primary); }

.pfp-top-badge {
  position: absolute;
  top: -1px; right: 20px;
  background: var(--pfp-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 0 0 8px 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Similarity Circle — must sit on the OPPOSITE side of the product image
   (image is the first grid column; in LTR it renders on the left so the
   circle goes right, in RTL it renders on the right so the circle goes left) */
.pfp-similarity-circle {
  position: absolute;
  top: 20px; right: 20px; left: auto;
  width: 62px; height: 62px;
}
[dir="rtl"] .pfp-similarity-circle { right: auto; left: 20px; }
.pfp-circle-svg { transform: rotate(-90deg); }
.pfp-circle-bg { fill: none; stroke: var(--pfp-border); stroke-width: 3; }
.pfp-circle-fill {
  fill: none;
  stroke: var(--pfp-primary);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray .8s ease;
}
.pfp-circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--pfp-secondary);
}

.pfp-product-image { text-align: center; }
/* IMPORTANT: WooCommerce prints explicit width/height HTML attributes on
   this <img> (matching the "woocommerce_thumbnail" registered size, e.g.
   300x300). Without max-width:100% here, the browser honors those
   attributes literally and the image overflows the card on any viewport
   narrower than that intrinsic size — which is most phones. width/height:
   auto lets object-fit/max-height keep the aspect ratio while max-width
   guarantees it can never exceed its container. */
.pfp-product-image img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
}

.pfp-product-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pfp-product-meta-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pfp-product-brand { font-weight: 700; color: var(--pfp-primary); font-size: 14px; }
.pfp-product-sku { font-size: 12px; color: var(--pfp-text-muted); }
.pfp-product-title { margin: 0; font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.pfp-product-title a { color: var(--pfp-secondary); text-decoration: none; }
.pfp-product-title a:hover { color: var(--pfp-primary); }

.pfp-match-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--pfp-text-muted); }
.pfp-match-tag {
  background: color-mix(in srgb, var(--pfp-primary) 10%, white);
  color: var(--pfp-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}

.pfp-product-price { font-size: 18px; font-weight: 700; color: var(--pfp-secondary); }
.pfp-product-price del { color: var(--pfp-text-muted); font-weight: 400; font-size: 14px; }
.pfp-product-price ins { text-decoration: none; color: #e11d48; }

.pfp-in-stock { color: #16a34a; font-size: 13px; font-weight: 600; }
.pfp-out-of-stock { color: #dc2626; font-size: 13px; }

/* ---- Product Actions ---- */
.pfp-product-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.pfp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--pfp-transition);
  border: 2px solid transparent;
}
.pfp-btn-cart {
  background: var(--pfp-primary);
  color: #fff;
  border-color: var(--pfp-primary);
}
.pfp-btn-cart:hover { opacity: .88; color: #fff; }
.pfp-btn-view {
  background: transparent;
  color: var(--pfp-secondary);
  border-color: var(--pfp-border);
}
.pfp-btn-view:hover { border-color: var(--pfp-secondary); }
.pfp-btn-custom {
  background: var(--pfp-secondary);
  color: #fff;
}
.pfp-btn-custom:hover { opacity: .85; color: #fff; }

/* ---- No Results ---- */
.pfp-no-results { padding: 40px; }
.pfp-no-results-icon { font-size: 48px; margin-bottom: 16px; }
.pfp-no-results h3 { font-size: 22px; color: var(--pfp-secondary); margin: 0 0 8px; }
.pfp-no-results p { color: var(--pfp-text-muted); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 640px) {
  .pfp-product-card {
    grid-template-columns: 200px 1fr;
    align-items: start;
  }
  .pfp-similarity-circle { top: 24px; }
}
@media (max-width: 480px) {
  .pfp-options-cards { grid-template-columns: repeat(2, 1fr); }
  .pfp-product-actions { flex-direction: column; }
  .pfp-btn { width: 100%; }

  /* Product result cards: tighter padding + a smaller score circle so
     nothing crowds the card on narrow phones. */
  .pfp-product-card { padding: 16px; gap: 12px; }
  .pfp-similarity-circle { width: 48px; height: 48px; top: 12px; right: 12px; }
  [dir="rtl"] .pfp-similarity-circle { left: 12px; }
  .pfp-circle-text { font-size: 10px; }
  .pfp-top-badge { right: 12px; }
  .pfp-product-title { font-size: 16px; }
}

/* ============================================
   RTL
   ============================================ */
[dir="rtl"] .pfp-top-nav { direction: rtl; }
[dir="rtl"] .pfp-step-title, [dir="rtl"] .pfp-step-subtitle { direction: rtl; }
[dir="rtl"] .pfp-back-btn::before { content: '→ '; }

/* ============================================
   MODERN LAYOUT (Like Image 8)
   ============================================ */

.pfp-products-modern {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pfp-modern-card {
  background: var(--pfp-card-bg);
  border: 2px solid var(--pfp-border);
  border-radius: var(--pfp-radius);
  padding: 24px 24px 20px;
  position: relative;
  transition: box-shadow var(--pfp-transition);
}
.pfp-modern-card:hover { box-shadow: var(--pfp-shadow-hover); }
.pfp-modern-card--top { border-color: var(--pfp-primary); }

.pfp-modern-top-ribbon {
  position: absolute;
  top: -1px; right: 20px;
  background: var(--pfp-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 0 0 8px 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Header row: name + score circle */
.pfp-modern-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.pfp-modern-name-block { flex: 1; min-width: 0; }
.pfp-modern-brand {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--pfp-text-muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pfp-modern-product-name {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--pfp-secondary);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.pfp-modern-product-name a { color: inherit; text-decoration: none; }
.pfp-modern-product-name a:hover { color: var(--pfp-primary); }
.pfp-modern-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pfp-modern-sku {
  font-size: 12px;
  color: var(--pfp-text-muted);
  background: #f3f4f6;
  padding: 2px 10px;
  border-radius: 4px;
}
.pfp-modern-top-badge {
  font-size: 11px;
  font-weight: 800;
  background: var(--pfp-primary);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  letter-spacing: .05em;
}

/* Score circle for modern layout */
.pfp-modern-score-circle {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.pfp-modern-score-circle .pfp-circle-svg { transform: rotate(-90deg); }
.pfp-modern-score-circle .pfp-circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--pfp-secondary);
  text-align: center;
  line-height: 1.1;
}
.pfp-modern-score-circle .pfp-circle-text small {
  font-size: 9px;
  font-weight: 500;
  color: var(--pfp-text-muted);
}

/* Match row */
.pfp-modern-match-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--pfp-text-muted);
}
.pfp-modern-match-label { font-weight: 600; }

/* Divider */
.pfp-modern-divider {
  border: none;
  border-top: 1px solid var(--pfp-border);
  margin: 12px 0;
}

/* Excerpt */
.pfp-modern-excerpt {
  font-size: 13px;
  color: var(--pfp-text-muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

/* Price */
.pfp-modern-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--pfp-secondary);
  margin-bottom: 6px;
}
.pfp-modern-price del { color: var(--pfp-text-muted); font-size: 14px; font-weight: 400; }
.pfp-modern-price ins { text-decoration: none; color: #e11d48; }

/* Stock */
.pfp-modern-stock { margin-bottom: 14px; font-size: 13px; }

/* Action buttons — stacked, full width */
.pfp-modern-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.pfp-modern-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 98%;
  margin: 0 auto;
  padding: 13px 18px;
  border-radius: var(--pfp-radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--pfp-border);
  background: var(--pfp-card-bg);
  color: var(--pfp-secondary);
  transition: all var(--pfp-transition);
  cursor: pointer;
  box-sizing: border-box;
}
.pfp-modern-btn:hover {
  border-color: var(--pfp-primary);
  background: color-mix(in srgb, var(--pfp-primary) 5%, white);
  color: var(--pfp-secondary);
}
.pfp-modern-btn-icon { font-size: 18px; flex-shrink: 0; }
.pfp-modern-btn-url {
  margin-left: auto;
  font-size: 11px;
  color: var(--pfp-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* Cart button accent */
.pfp-modern-btn--cart {
  background: color-mix(in srgb, var(--pfp-primary) 8%, white);
  border-color: color-mix(in srgb, var(--pfp-primary) 40%, transparent);
}
.pfp-modern-btn--cart:hover { background: var(--pfp-primary); color: #fff; }
.pfp-modern-btn--cart:hover .pfp-modern-btn-url { color: rgba(255,255,255,.7); }

.pfp-modern-btn--custom { background: color-mix(in srgb, var(--pfp-secondary) 6%, white); border-color: var(--pfp-border); }

/* Responsive */
@media (max-width: 480px) {
  .pfp-modern-card { padding: 16px 16px 14px; }
  .pfp-modern-header { flex-direction: column-reverse; align-items: flex-start; }
  .pfp-modern-score-circle { width: 56px; height: 56px; }
  .pfp-modern-btn-url { display: none; }
  .pfp-modern-btn { width: 100%; }
}
.pfp-step-header-icon-img { width:40px; height:40px; object-fit:cover; border-radius:8px; }

/* ── Email Form ──────────────────────────────── */
.pfp-email-form { margin-top: 28px; background: #f8f9fc; border: 1px solid #e5e7eb; border-radius: 14px; padding: 22px 24px; text-align: center; }
.pfp-email-form-inner { max-width: 420px; margin: 0 auto; }
.pfp-email-icon { font-size: 28px; display: block; margin-bottom: 8px; }
.pfp-email-form p { margin: 0 0 12px; color: #374151; font-size: 14px; font-weight: 600; }
.pfp-email-input-row { display: flex; gap: 8px; }
.pfp-email-input { flex: 1; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 14px; font-size: 14px; }
.pfp-email-send-btn { border-radius: 8px !important; }
.pfp-email-msg { margin-top: 8px; font-size: 13px; color: #10b981; font-weight: 600; }

/* ── Wishlist / Compare buttons ──────────────── */
.pfp-btn-wishlist, .pfp-btn-compare { background: none; border: 1px solid #d1d5db; border-radius: 8px; padding: 7px 14px; cursor: pointer; font-size: 13px; color: #6b7280; transition: all .2s; }
.pfp-btn-wishlist:hover { border-color: #f43f5e; color: #f43f5e; }
.pfp-btn-compare:hover, .pfp-compare-active { border-color: #3b82f6 !important; color: #3b82f6 !important; }

/* ── Compare Bar ─────────────────────────────── */
.pfp-compare-bar { position: sticky; bottom: 0; background: #1a1a2e; color: #fff; padding: 12px 20px; border-radius: 12px 12px 0 0; display: flex; align-items: center; gap: 14px; margin-top: 20px; z-index: 99; }
.pfp-compare-bar-text { font-size: 13px; flex: 1; }
.pfp-compare-bar-btn { background: #f0a500; color: #fff; padding: 7px 18px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 700; border: none; cursor: pointer; }
.pfp-compare-bar-clear { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 12px; }

/* Compare modal */
.pfp-compare-modal { position: fixed; inset: 0; z-index: 999999; }
.pfp-compare-modal-overlay { position: absolute; inset: 0; background: rgba(20,20,30,.6); backdrop-filter: blur(2px); }
.pfp-compare-modal-box {
    position: relative; max-width: 1000px; width: 94%; max-height: 86vh; margin: 5vh auto;
    background: #fff; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
    animation: pfp-compare-pop .22s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pfp-compare-pop {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.pfp-compare-modal-close {
    position: absolute; top: 12px; left: 12px; width: 36px; height: 36px; border-radius: 50%;
    border: none; background: #f3f3f5; font-size: 16px; cursor: pointer; z-index: 2;
    transition: background .15s, transform .15s;
}
.pfp-compare-modal-close:hover { background: #e8e8ec; transform: rotate(90deg); }
.pfp-compare-modal-body { padding: 28px; overflow: auto; }
.pfp-compare-loading { text-align: center; padding: 50px; color: #999; font-size: 14px; }
.pfp-compare-error { text-align: center; padding: 36px; color: #d33; }
.pfp-compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pfp-compare-table thead th { background: #fafafa; border-bottom: 2px solid #f0f0f0; padding-top: 18px; }
.pfp-compare-table th, .pfp-compare-table td { padding: 13px 16px; text-align: center; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.pfp-compare-table tbody tr:hover td { background: #fffaf0; }
.pfp-compare-row-label { text-align: right !important; font-weight: 700; color: #555; background: #fafafa !important; white-space: nowrap; min-width: 110px; }
.pfp-compare-col { min-width: 160px; }
.pfp-compare-product-link { display: block; text-decoration: none; color: inherit; }
.pfp-compare-product-link img {
    width: 92px; height: 92px; object-fit: contain; margin: 0 auto 10px; display: block;
    border-radius: 10px; background: #fafafa; padding: 6px; transition: transform .15s;
}
.pfp-compare-product-link:hover img { transform: scale(1.05); }
.pfp-compare-name { font-size: 13px; font-weight: 700; color: #222; line-height: 1.5; }
.pfp-in-stock { color: #2e9e44; font-weight: 700; }
.pfp-out-stock { color: #d33; font-weight: 700; }
@media (max-width: 640px) {
  .pfp-compare-modal-box { width: 98%; margin: 2vh auto; max-height: 92vh; }
  .pfp-compare-modal-body { padding: 16px; }
  .pfp-compare-table { font-size: 12px; }
  .pfp-compare-table th, .pfp-compare-table td { padding: 8px; }
  .pfp-compare-product-link img { width: 60px; height: 60px; }
}

/* ── No-results custom ───────────────────────── */
.pfp-no-results-img { max-width: 180px; margin: 0 auto 16px; display: block; border-radius: 10px; }

/* ── AI "type what you want" search ──────────── */
.pfp-ai-search-toggle { text-align: center; margin-bottom: 18px; }
.pfp-ai-search-link {
    background: none; border: 1px dashed var(--pfp-border); border-radius: 999px;
    padding: 8px 18px; font-size: 13px; font-weight: 600; color: var(--pfp-primary);
    cursor: pointer; transition: all .2s;
}
.pfp-ai-search-link:hover { border-color: var(--pfp-primary); background: color-mix(in srgb, var(--pfp-primary) 6%, white); }
.pfp-ai-search-box {
    background: #f8f9fc; border: 1px solid var(--pfp-border); border-radius: var(--pfp-radius);
    padding: 18px 20px; margin-bottom: 18px;
}
.pfp-ai-search-input {
    width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 10px 14px;
    font-size: 14px; font-family: inherit; resize: vertical; box-sizing: border-box;
}
.pfp-ai-search-input:focus { outline: none; border-color: var(--pfp-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pfp-primary) 18%, transparent); }
.pfp-ai-search-actions { display: flex; gap: 10px; margin-top: 10px; align-items: center; }
.pfp-ai-search-submit { border-radius: 8px !important; background: var(--pfp-primary) !important; color: #fff !important; border: none !important; padding: 8px 20px !important; font-weight: 700 !important; cursor: pointer; }
.pfp-ai-search-submit:disabled { opacity: .6; cursor: default; }
.pfp-ai-search-cancel { background: none; border: none; color: #6b7280; font-size: 13px; cursor: pointer; text-decoration: underline; }
.pfp-ai-search-error { margin-top: 10px; font-size: 13px; color: #dc2626; font-weight: 600; }

/* ---- AI-only mode: no step screens, the AI box is the whole wizard ---- */
.pfp-wizard-ai-only .pfp-progress-bar-wrap { display: none; }
.pfp-wizard-ai-only .pfp-ai-only-indicator .pfp-step-label { font-weight: 700; color: var(--pfp-text); }
.pfp-wizard-ai-only .pfp-ai-search-box { margin-bottom: 0; }
.pfp-wizard-ai-only .pfp-ai-search-input { min-height: 90px; }
.pfp-ai-only-intro { margin: 0 0 12px; font-size: 14px; color: var(--pfp-text-muted); line-height: 1.6; }

/* ── AI Open Search (catalog mode) chat UI ──────────── */
.pfp-wizard-ai-catalog .pfp-progress-bar-wrap { display: none; }

.pfp-ai-catalog-chat {
    display: flex;
    flex-direction: column;
    background: #f8f9fc;
    border: 1px solid var(--pfp-border);
    border-radius: var(--pfp-radius);
    overflow: hidden;
}
.pfp-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    max-height: 420px;
    min-height: 120px;
    overflow-y: auto;
}
.pfp-chat-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.pfp-chat-bubble-assistant {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--pfp-border);
    color: var(--pfp-text);
    border-start-start-radius: 4px;
}
.pfp-chat-bubble-user {
    align-self: flex-end;
    background: var(--pfp-primary);
    color: #fff;
    border-start-end-radius: 4px;
}
.pfp-chat-bubble-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}
.pfp-chat-typing {
    align-self: flex-start;
    margin: 0 16px 10px;
    display: flex;
    gap: 4px;
}
.pfp-chat-typing span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--pfp-text-muted);
    animation: pfp-chat-typing-bounce 1.2s infinite ease-in-out;
}
.pfp-chat-typing span:nth-child(2) { animation-delay: .15s; }
.pfp-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes pfp-chat-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}
.pfp-chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--pfp-border);
    background: #fff;
}
.pfp-chat-input {
    flex: 1;
    min-width: 0;
    resize: none;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    max-height: 100px;
}
.pfp-chat-input:focus { outline: none; border-color: var(--pfp-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pfp-primary) 18%, transparent); }
.pfp-chat-input:disabled { opacity: .6; }
.pfp-chat-send {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--pfp-primary) !important;
    color: #fff !important;
    border: none !important;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
[dir="rtl"] .pfp-chat-send { transform: scaleX(-1); }
.pfp-chat-send:disabled { opacity: .6; cursor: default; }

@media (max-width: 480px) {
    .pfp-chat-messages { max-height: 320px; padding: 12px; }
    .pfp-chat-bubble { max-width: 90%; font-size: 13px; }
}
