/* ── UNADA Fan Product Finder — frontend styles v2.8.0 ────────────────────── */
/* Brand: UNADA purple #4a2c81 | Light mode | Space Grotesk */

:root {
  --ufp-primary:       #4a2c81;
  --ufp-primary-h:     #3d2470;
  --ufp-primary-light: #6b47a8;
  --ufp-primary-soft:  rgba(74, 44, 129, 0.07);
  --ufp-primary-med:   rgba(74, 44, 129, 0.14);
  --ufp-primary-ring:  rgba(74, 44, 129, 0.22);

  --ufp-bg:         #f4f3f7;
  --ufp-surface:    #ffffff;
  --ufp-surface-2:  #faf9fc;

  --ufp-border:       rgba(74, 44, 129, 0.10);
  --ufp-border-md:    rgba(74, 44, 129, 0.22);
  --ufp-border-hover: rgba(74, 44, 129, 0.38);

  --ufp-text:       #0f0d1a;
  --ufp-text-soft:  #5a5470;
  --ufp-text-light: #9590a8;

  --ufp-green:        #16a34a;
  --ufp-green-soft:   rgba(22, 163, 74, 0.07);
  --ufp-green-border: rgba(22, 163, 74, 0.28);
  --ufp-green-ring:   rgba(22, 163, 74, 0.18);

  --ufp-radius-sm:  8px;
  --ufp-radius:     14px;
  --ufp-radius-lg:  20px;

  --ufp-shadow-xs:  0 1px 2px rgba(0,0,0,.04);
  --ufp-shadow-sm:  0 1px 4px rgba(74,44,129,.06), 0 2px 8px rgba(0,0,0,.04);
  --ufp-shadow-md:  0 4px 16px rgba(74,44,129,.10), 0 1px 4px rgba(0,0,0,.06);
  --ufp-shadow-lg:  0 12px 40px rgba(74,44,129,.14), 0 2px 8px rgba(0,0,0,.06);
}

/* ══════════════════════════════════════════════════════════════════════════
   DEFENSIVE ISOLATION — neutralise theme reset.css for buttons/inputs/links.

   Strategy: :where() contributes ZERO specificity, so these rules
   beat the theme's bare element selectors (plugin CSS loads after theme)
   but are ALWAYS overridden by any class-based plugin rule below.

   IMPORTANT: Only targets button/input/select/link — deliberately avoids
   table, label, ul, li so modal layout and checkbox rows stay intact.
   ══════════════════════════════════════════════════════════════════════════ */

/* Buttons — base state ----------------------------------------------------- */
:where(.ufp-root, #ufp-product-modal) button,
:where(.ufp-root, #ufp-product-modal) [type="button"],
:where(.ufp-root, #ufp-product-modal) [type="submit"],
:where(.ufp-root, #ufp-product-modal) [type="reset"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: transparent;
  border: none;
  border-radius: 0;
  color: inherit;
  display: inline-flex;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  padding: 0;
  text-align: left;
  text-transform: none;
  transition: none;
  white-space: normal;
  width: auto;
  cursor: pointer;
}
/* Buttons — hover/focus (neutralises theme's button:hover { bg:#c36 }) ----- */
:where(.ufp-root, #ufp-product-modal) button:hover,
:where(.ufp-root, #ufp-product-modal) button:focus,
:where(.ufp-root, #ufp-product-modal) [type="button"]:hover,
:where(.ufp-root, #ufp-product-modal) [type="button"]:focus,
:where(.ufp-root, #ufp-product-modal) [type="submit"]:hover,
:where(.ufp-root, #ufp-product-modal) [type="submit"]:focus {
  background-color: transparent;
  color: inherit;
  text-decoration: none;
}

/* Text / number / search inputs -------------------------------------------- */
:where(.ufp-root, #ufp-product-modal) input[type="text"],
:where(.ufp-root, #ufp-product-modal) input[type="number"],
:where(.ufp-root, #ufp-product-modal) input[type="search"],
:where(.ufp-root, #ufp-product-modal) input[type="email"],
:where(.ufp-root, #ufp-product-modal) input[type="url"],
:where(.ufp-root, #ufp-product-modal) input[type="tel"] {
  border: none;
  border-radius: 0;
  padding: 0;
  width: auto;
  transition: none;
  background-color: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Select ------------------------------------------------------------------- */
:where(.ufp-root, #ufp-product-modal) select {
  border: none;
  border-radius: 0;
  padding: 0;
  width: auto;
  display: inline-block;
  transition: none;
  background-color: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Links -------------------------------------------------------------------- */
:where(.ufp-root, #ufp-product-modal) a { color: inherit; text-decoration: none; background-color: transparent; }
:where(.ufp-root, #ufp-product-modal) a:hover,
:where(.ufp-root, #ufp-product-modal) a:active,
:where(.ufp-root, #ufp-product-modal) a:focus { color: inherit; text-decoration: none; }

/* ── Root wrapper ────────────────────────────────────────────────────────── */
.ufp-root {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ufp-text);
  background: var(--ufp-bg);
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  min-height: 100vh;
  overflow-x: clip;
}
.elementor-widget-ufp_product_finder,
.elementor-widget-ufp_product_finder .elementor-widget-container {
  overflow: visible !important;
}
.ufp-root *, .ufp-root *::before, .ufp-root *::after {
  box-sizing: border-box;
}

/* ── Loading / Error ─────────────────────────────────────────────────────── */
.ufp-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 80px 20px;
  color: var(--ufp-text-soft); gap: 16px;
}
.ufp-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(74,44,129,.12);
  border-top-color: var(--ufp-primary);
  border-radius: 50%;
  animation: ufp-spin .8s linear infinite;
}
@keyframes ufp-spin { to { transform: rotate(360deg); } }
.ufp-error { color: #dc2626; padding: 40px; text-align: center; font-weight: 600; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.ufp-hero {
  position: relative; height: 200px;
  border-radius: var(--ufp-radius-lg);
  overflow: hidden; margin: 28px 32px 0;
}
.ufp-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, rgba(30,15,60,.94) 0%, rgba(74,44,129,.75) 55%, rgba(74,44,129,.30) 100%);
  z-index: 1;
}
.ufp-hero-bg-placeholder {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1e0f3c 0%, #4a2c81 60%, #6b47a8 100%);
}
.ufp-hero-content {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 52px;
}
.ufp-hero-title {
  color: #fff; font-size: 2.6rem; font-weight: 700;
  letter-spacing: -.03em; line-height: 1.1; margin: 0 0 8px;
}
.ufp-hero-subtitle {
  color: rgba(255,255,255,.72); font-size: .95rem; font-weight: 400;
  margin: 0; max-width: 400px; line-height: 1.5;
}

/* ── Standalone Unit Toggle Bar ──────────────────────────────────────────── */
.ufp-unit-bar {
  display: flex; justify-content: center;
  padding: 24px 32px 0;
}
.ufp-unit-bar-inner {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 10px 28px;
  background: var(--ufp-surface);
  border: 1.5px solid var(--ufp-border-md);
  border-radius: 40px;
  box-shadow: 0 2px 12px rgba(74,44,129,.10), var(--ufp-shadow-sm);
}
.ufp-unit-bar-lbl {
  font-size: .88rem; font-weight: 600; color: var(--ufp-text-light);
  white-space: nowrap; transition: color .2s, font-weight .2s; letter-spacing: .02em;
  cursor: default;
}
.ufp-unit-bar-lbl.active {
  color: var(--ufp-primary); font-weight: 700;
}

/* Toggle switch — frontend unit bar */
.ufp-fe-toggle-switch {
  position: relative; display: inline-block;
  width: 46px; height: 26px; flex-shrink: 0; cursor: pointer;
}
.ufp-fe-toggle-switch input { opacity: 0; width: 0; height: 0; }
.ufp-fe-toggle-slider {
  position: absolute; inset: 0;
  background: #d1d5db; border-radius: 26px;
  transition: background .25s;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.12);
}
.ufp-fe-toggle-slider::before {
  content: '';
  position: absolute; width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .25s;
}
.ufp-fe-toggle-switch input:checked + .ufp-fe-toggle-slider { background: var(--ufp-primary); }
.ufp-fe-toggle-switch input:checked + .ufp-fe-toggle-slider::before { transform: translateX(20px); }
.ufp-fe-toggle-switch input:focus + .ufp-fe-toggle-slider { box-shadow: inset 0 1px 3px rgba(0,0,0,.12), 0 0 0 3px var(--ufp-primary-ring); }

/* ── Search (now lives inside .ufp-topbar-search) ───────────────────────── */
.ufp-topbar-search {
  position: relative; flex: 1; min-width: 180px; max-width: 340px;
}
.ufp-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  display: block; width: 16px; height: 16px; flex-shrink: 0;
  color: var(--ufp-text-light); pointer-events: none; z-index: 1;
  stroke: currentColor; fill: none; stroke-width: 2;
}
.ufp-root .ufp-search-input {
  width: 100%; padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--ufp-border);
  border-radius: 20px;
  background: var(--ufp-surface); font-size: .87rem;
  font-family: 'Space Grotesk', sans-serif; color: var(--ufp-text);
  box-shadow: var(--ufp-shadow-xs); transition: border-color .2s, box-shadow .2s;
  margin: 0; appearance: none; -webkit-appearance: none;
}
.ufp-root .ufp-search-input::placeholder { color: var(--ufp-text-light); }
.ufp-root .ufp-search-input:focus {
  outline: none; border-color: var(--ufp-primary);
  box-shadow: 0 0 0 3px var(--ufp-primary-ring), var(--ufp-shadow-xs);
}

/* ── Main layout ─────────────────────────────────────────────────────────── */
.ufp-layout { display: flex; gap: 24px; padding: 0 32px 56px; align-items: flex-start; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.ufp-sidebar {
  width: 268px; min-width: 252px; flex-shrink: 0;
  position: sticky; top: 96px;
  max-height: calc(100vh - 116px);
  overflow-y: auto; padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(74,44,129,.25) transparent;
}
.ufp-sidebar::-webkit-scrollbar { width: 3px; }
.ufp-sidebar::-webkit-scrollbar-track { background: transparent; }
.ufp-sidebar::-webkit-scrollbar-thumb { background: rgba(74,44,129,.25); border-radius: 10px; }

.ufp-filter-card {
  background: var(--ufp-surface);
  border: 1.5px solid var(--ufp-border);
  border-radius: var(--ufp-radius);
  padding: 20px;
  box-shadow: var(--ufp-shadow-sm);
}
.ufp-filter-head {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ufp-border);
}
.ufp-filter-head-title {
  font-size: 1rem; font-weight: 700; color: var(--ufp-text);
  letter-spacing: -.01em;
}
.ufp-root .ufp-clear-btn {
  background: none; border: none; color: var(--ufp-primary);
  font-size: .75rem; font-weight: 600; cursor: pointer;
  font-family: 'Space Grotesk', sans-serif; padding: 4px 8px;
  border-radius: 6px; transition: background .15s;
}
.ufp-root .ufp-clear-btn:hover { background: var(--ufp-primary-soft); }

.ufp-filter-groups { display: flex; flex-direction: column; gap: 20px; }

.ufp-filter-groups > div:not(:last-child) {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ufp-border);
}

.ufp-filter-group-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ufp-text-light);
  margin: 0 0 10px;
}

/* ── Fan Selection Engine ────────────────────────────────────────────────── */
.ufp-selection-section {
  background: var(--ufp-primary-soft);
  border: 1.5px solid var(--ufp-border-md);
  border-radius: var(--ufp-radius-sm);
  padding: 14px 14px 12px;
  transition: border-color .2s, background .2s;
}
.ufp-selection-section.ufp-selection-active {
  background: var(--ufp-primary-med);
  border-color: var(--ufp-primary);
  box-shadow: 0 0 0 3px var(--ufp-primary-ring);
}
.ufp-selection-title {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ufp-primary);
  margin: 0 0 4px;
}
.ufp-selection-desc {
  font-size: .78rem; color: var(--ufp-text-soft); margin: 0 0 10px;
  line-height: 1.45;
}
.ufp-selection-inputs { display: flex; flex-direction: column; gap: 10px; }
.ufp-selection-input-group { display: flex; flex-direction: column; gap: 4px; }
.ufp-selection-input-label {
  font-size: .7rem; font-weight: 700; color: var(--ufp-text-soft);
  text-transform: uppercase; letter-spacing: .06em;
}
.ufp-selection-input-row {
  display: flex; align-items: stretch; gap: 0;
  background: var(--ufp-surface);
  border: 1.5px solid var(--ufp-border-md);
  border-radius: var(--ufp-radius-sm);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.ufp-selection-input-row:focus-within {
  border-color: var(--ufp-primary);
  box-shadow: 0 0 0 3px var(--ufp-primary-ring);
}
.ufp-selection-input {
  flex: 1; padding: 9px 10px; border: none; outline: none;
  font-size: .9rem; font-family: 'Space Grotesk', sans-serif;
  color: var(--ufp-text); background: transparent;
  min-width: 0; -moz-appearance: textfield;
}
.ufp-selection-input::-webkit-outer-spin-button,
.ufp-selection-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ufp-selection-unit {
  display: flex; align-items: center; justify-content: center;
  padding: 0 10px; background: var(--ufp-primary-soft);
  border-left: 1.5px solid var(--ufp-border-md);
  font-size: .72rem; font-weight: 700; color: var(--ufp-primary);
  white-space: nowrap; flex-shrink: 0; min-width: 44px;
  letter-spacing: -.01em;
}
.ufp-selection-hint {
  font-size: .7rem; color: var(--ufp-primary); margin: 10px 0 0;
  text-align: center; line-height: 1.45; font-weight: 600; opacity: .8;
}
.ufp-selection-section.ufp-selection-active .ufp-selection-hint {
  opacity: 1; color: var(--ufp-primary);
}

/* ── Radio rows (voltage, direction — single select) ─────────────────────── */
.ufp-radio-row {
  display: flex; align-items: center; gap: 9px;
  font-size: .87rem; color: var(--ufp-text-soft);
  cursor: pointer; margin: 0 0 7px; transition: color .15s;
}
.ufp-radio-row:last-child { margin-bottom: 0; }
.ufp-radio-row:hover { color: var(--ufp-primary); }
.ufp-radio-row input[type="radio"] {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--ufp-primary); cursor: pointer;
}

/* ── Checkbox rows ───────────────────────────────────────────────────────── */
.ufp-check-row {
  display: flex; align-items: center; gap: 9px;
  font-size: .87rem; color: var(--ufp-text-soft);
  cursor: pointer; margin: 0 0 7px; transition: color .15s;
}
.ufp-check-row:last-child { margin-bottom: 0; }
.ufp-check-row:hover { color: var(--ufp-primary); }
.ufp-check-row input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--ufp-primary); cursor: pointer;
  border-radius: 4px;
}

/* Range + number */
.ufp-range-group { display: flex; flex-direction: column; gap: 8px; }
.ufp-range {
  width: 100%; appearance: none; -webkit-appearance: none;
  height: 5px; border-radius: 10px;
  background: linear-gradient(to right, var(--ufp-primary) var(--val, 100%), #e2e0e8 var(--val, 100%));
  cursor: pointer;
}
.ufp-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ufp-surface); cursor: pointer;
  border: 2.5px solid var(--ufp-primary);
  box-shadow: 0 1px 6px rgba(74,44,129,.30);
  transition: transform .15s;
}
.ufp-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.ufp-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ufp-surface); cursor: pointer;
  border: 2.5px solid var(--ufp-primary);
}
.ufp-range-input-row {
  display: flex; align-items: stretch; gap: 0;
  background: var(--ufp-surface); border: 1.5px solid var(--ufp-border);
  border-radius: var(--ufp-radius-sm); overflow: hidden;
  transition: border-color .2s;
}
.ufp-range-input-row:focus-within { border-color: var(--ufp-primary); }
.ufp-range-input-row input[type="number"] {
  flex: 1; padding: 8px 10px; border: none; outline: none;
  font-size: .88rem; font-family: 'Space Grotesk', sans-serif;
  color: var(--ufp-text); background: transparent;
  -moz-appearance: textfield; min-width: 0;
}
.ufp-range-input-row input[type="number"]::-webkit-outer-spin-button,
.ufp-range-input-row input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.ufp-range-unit {
  display: flex; align-items: center; padding: 0 10px;
  background: var(--ufp-primary-soft); border-left: 1.5px solid var(--ufp-border);
  font-size: .72rem; font-weight: 700; color: var(--ufp-primary);
  white-space: nowrap; flex-shrink: 0; min-width: 40px;
  justify-content: center;
}

/* ── Main content ────────────────────────────────────────────────────────── */
.ufp-main { flex: 1; min-width: 0; }

.ufp-topbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.ufp-topbar-left {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap;
}
.ufp-count {
  font-size: .87rem; color: var(--ufp-text-soft);
  background: var(--ufp-surface); border: 1px solid var(--ufp-border);
  padding: 6px 14px; border-radius: 20px;
  box-shadow: var(--ufp-shadow-xs);
}
.ufp-count strong { color: var(--ufp-primary); font-weight: 700; }
.ufp-sort-wrap {
  display: flex; align-items: center; flex-wrap: nowrap; flex-shrink: 0;
  gap: 6px; font-size: .85rem; color: var(--ufp-text-soft); white-space: nowrap;
  background: var(--ufp-surface); border: 1px solid var(--ufp-border);
  padding: 6px 14px; border-radius: 20px; box-shadow: var(--ufp-shadow-xs);
}
.ufp-root .ufp-sort {
  display: inline !important; border: none; background: transparent;
  font-weight: 700; color: var(--ufp-primary); font-size: .87rem;
  font-family: 'Space Grotesk', sans-serif; cursor: pointer;
  padding: 0; margin: 0; white-space: nowrap; width: auto;
}
.ufp-root .ufp-sort:focus { outline: none; }

/* ── Product Grid ────────────────────────────────────────────────────────── */
.ufp-grid { display: grid; gap: 18px; }

.ufp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ufp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ufp-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) {
  .ufp-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .ufp-cols-3, .ufp-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .ufp-cols-2, .ufp-cols-3, .ufp-cols-4 { grid-template-columns: 1fr; }
}

/* ── Mobile toggle ───────────────────────────────────────────────────────── */
.ufp-root .ufp-filter-toggle {
  display: none; width: 100%; align-items: center; justify-content: space-between;
  background: var(--ufp-surface); border: 1.5px solid var(--ufp-border);
  border-radius: var(--ufp-radius); padding: 14px 18px;
  font-family: 'Space Grotesk', sans-serif; font-size: .95rem; font-weight: 700;
  color: var(--ufp-primary); cursor: pointer; box-shadow: var(--ufp-shadow-sm);
  margin-bottom: 10px;
}
.ufp-root .ufp-filter-toggle svg {
  width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2;
  transition: transform .25s; flex-shrink: 0;
}
.ufp-root .ufp-filter-toggle.open svg { transform: rotate(180deg); }
.ufp-filter-body-wrap {
  overflow: hidden; transition: max-height .3s ease, opacity .3s ease;
  max-height: 2400px; opacity: 1;
}
.ufp-filter-body-wrap.collapsed { max-height: 0; opacity: 0; }

@media (max-width: 680px) {
  .ufp-layout { flex-direction: column; padding: 0 16px 32px; }
  .ufp-sidebar { width: 100%; min-width: unset; position: static; max-height: none; padding-right: 0; }
  .ufp-root .ufp-filter-toggle { display: flex; }
  .ufp-grid { grid-template-columns: 1fr !important; }
  .ufp-hero { margin: 0 16px 0; height: 150px; }
  .ufp-hero-title { font-size: 1.9rem; }
  .ufp-hero-content { padding: 0 24px; }
  .ufp-unit-bar { padding: 16px 16px 0; }
  .ufp-topbar-search { max-width: 100%; min-width: 0; flex: 1 1 100%; }
}

/* ── Searching / loading state ───────────────────────────────────────────── */
.ufp-grid--searching .ufp-card {
  opacity: 0.38;
  pointer-events: none;
  transform: none !important;
}
.ufp-hint--searching { opacity: 0.7; }
.ufp-hint--searching::before {
  content: '';
  display: inline-block;
  width: 9px; height: 9px;
  border: 1.5px solid var(--ufp-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: ufp-spin .7s linear infinite;
  margin-right: 5px;
  vertical-align: middle;
}

/* ── Product Card (vertical layout — image top, specs bottom) ─────────────── */
.ufp-card {
  background: var(--ufp-surface);
  border: 1.5px solid var(--ufp-border);
  border-radius: var(--ufp-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;   /* ← vertical */
  box-shadow: var(--ufp-shadow-sm);
  transition: opacity .25s, border-color .22s, box-shadow .22s, transform .22s;
}
.ufp-card:hover {
  border-color: var(--ufp-border-hover);
  box-shadow: var(--ufp-shadow-lg);
  transform: translateY(-4px);
}

/* Compatible card */
.ufp-card.ufp-card-compatible {
  border-color: var(--ufp-green-border);
  box-shadow: 0 0 0 2px var(--ufp-green-ring), var(--ufp-shadow-sm);
}
.ufp-card.ufp-card-compatible:hover {
  border-color: var(--ufp-green);
  box-shadow: 0 0 0 3px var(--ufp-green-ring), var(--ufp-shadow-lg);
  transform: translateY(-4px);
}

/* Card image — top, fixed height */
.ufp-card-img {
  position: relative;
  width: 100%;
  height: 180px;
  background: var(--ufp-surface-2);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  overflow: hidden;
  border-bottom: 1px solid var(--ufp-border);
}
.ufp-card-img img {
  max-height: 130px; max-width: 100%; object-fit: contain; display: block;
  transition: transform .45s cubic-bezier(.34,1.56,.64,1);
}
.ufp-card:hover .ufp-card-img img { transform: scale(1.08); }
.ufp-card-img-placeholder {
  width: 72px; height: 72px; background: var(--ufp-primary-soft); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ufp-primary); font-size: 1.6rem; font-weight: 700;
}

/* Badges */
.ufp-card-badge {
  position: absolute; top: 10px; left: 10px; padding: 3px 8px;
  border-radius: 5px; font-size: .58rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; line-height: 1.5;
  max-width: calc(100% - 90px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ufp-badge-primary { background: var(--ufp-primary); color: #fff; }

/* ✓ Compatible badge */
.ufp-badge-compatible {
  position: absolute; top: 10px; right: 10px;
  background: var(--ufp-green); color: #fff;
  padding: 3px 9px; border-radius: 20px;
  font-size: .6rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em;
  box-shadow: 0 2px 8px rgba(22,163,74,.35);
  white-space: nowrap;
}

/* Card body — below image */
.ufp-card-body {
  padding: 16px 18px 18px;
  flex: 1; display: flex; flex-direction: column;
  gap: 0; min-width: 0;
}
.ufp-card-header { margin-bottom: 10px; }
/* Card header block — identity + series share equal font size/weight */
.ufp-card-header { margin-bottom: 10px; }

/* "Blade Name · Motor Name" */
.ufp-card-identity {
  font-size: .8rem; font-weight: 600; color: var(--ufp-text-soft);
  letter-spacing: .01em; margin: 0 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Series — same size as identity, purple accent */
.ufp-card-series {
  font-size: .8rem; font-weight: 600; color: var(--ufp-primary);
  letter-spacing: .04em; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Profile Type — plain text below series, same size; always reserves one line */
.ufp-card-profile-type {
  font-size: .8rem; font-weight: 600; color: var(--ufp-primary);
  letter-spacing: .04em; margin: 2px 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-height: 1.2em;
}

/* Spec rows */
.ufp-card-specs {
  display: flex; flex-direction: column; gap: 0;
  margin: 10px 0 14px; flex: 1;
  border: 1px solid var(--ufp-border); border-radius: var(--ufp-radius-sm);
  overflow: hidden;
}
.ufp-spec-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; padding: 6px 10px;
}
.ufp-spec-row:not(:last-child) { border-bottom: 1px solid var(--ufp-border); }
.ufp-spec-row:nth-child(even) { background: var(--ufp-surface-2); }
.ufp-spec-lbl { color: var(--ufp-text-soft); }
.ufp-spec-val { font-weight: 600; color: var(--ufp-text); }
.ufp-spec-val-primary { font-weight: 700; color: var(--ufp-primary); }
.ufp-spec-ip {
  font-weight: 700; font-size: .7rem;
  background: var(--ufp-primary-soft); border-radius: 5px;
  padding: 2px 7px; color: var(--ufp-primary);
}

/* Buttons */
.ufp-card-footer { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ufp-root .ufp-btn-datasheet {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 10px;
  border: 1.5px solid var(--ufp-border-md); border-radius: var(--ufp-radius-sm);
  color: var(--ufp-primary); background: transparent;
  font-size: .78rem; font-weight: 700; text-decoration: none; cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: background .18s, border-color .18s;
}
.ufp-root .ufp-btn-datasheet:hover { background: var(--ufp-primary-soft); border-color: var(--ufp-primary); }
.ufp-root .ufp-btn-datasheet svg { width: 13px; height: 13px; flex-shrink: 0; }
.ufp-root .ufp-btn-datasheet.disabled { opacity: .38; cursor: default; pointer-events: none; }

.ufp-root .ufp-btn-details {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 10px;
  background: var(--ufp-primary); color: #fff;
  border: 1.5px solid var(--ufp-primary); border-radius: var(--ufp-radius-sm);
  font-size: .78rem; font-weight: 700; text-decoration: none; cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: background .18s, transform .12s;
}
.ufp-root .ufp-btn-details:hover { background: var(--ufp-primary-h); color: #fff; }
.ufp-root .ufp-btn-details:active { transform: scale(.97); }
.ufp-root .ufp-btn-details svg { width: 12px; height: 12px; flex-shrink: 0; }
.ufp-root .ufp-btn-details.disabled { opacity: .38; cursor: default; pointer-events: none; }

/* ── Empty / Reset ───────────────────────────────────────────────────────── */
.ufp-empty {
  text-align: center; padding: 56px 20px;
  color: var(--ufp-text-soft); grid-column: 1 / -1;
  line-height: 1.6;
}
.ufp-root .ufp-reset-inline {
  display: inline-block; margin-top: 12px; background: var(--ufp-primary);
  color: #fff; border: none; padding: 9px 20px; border-radius: 8px;
  cursor: pointer; font-size: .87rem; font-weight: 700;
  font-family: 'Space Grotesk', sans-serif; transition: background .18s;
}
.ufp-root .ufp-reset-inline:hover { background: var(--ufp-primary-h); }

/* ── Product Detail Modal ────────────────────────────────────────────────── */
/* Hidden via the HTML `hidden` attribute by default;
   JS removes `hidden` and adds .is-open to animate in */
#ufp-product-modal[hidden] {
  display: none !important;
}
#ufp-product-modal {
  display: block;
}

.ufp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 13, 26, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: ufp-modal-in .22s ease;
}
@keyframes ufp-modal-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ufp-modal-container {
  position: relative;
  background: var(--ufp-surface);
  border-radius: var(--ufp-radius-lg);
  box-shadow: var(--ufp-shadow-lg);
  width: 100%;
  max-width: 780px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  animation: ufp-modal-up .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes ufp-modal-up {
  from { transform: translateY(24px) scale(.96); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

#ufp-product-modal .ufp-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  background: var(--ufp-surface-2);
  border: 1.5px solid var(--ufp-border);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ufp-text-soft);
  transition: background .15s, color .15s;
  z-index: 2;
}
#ufp-product-modal .ufp-modal-close:hover {
  background: var(--ufp-primary-soft);
  color: var(--ufp-primary);
  border-color: var(--ufp-primary);
}

.ufp-modal-scroll {
  overflow-y: auto;
  padding: 32px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(74,44,129,.2) transparent;
}
.ufp-modal-scroll::-webkit-scrollbar { width: 4px; }
.ufp-modal-scroll::-webkit-scrollbar-thumb { background: rgba(74,44,129,.2); border-radius: 4px; }

.ufp-modal-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; gap: 16px;
  color: var(--ufp-text-soft);
}

/* Modal top section: image + info side by side */
.ufp-modal-top {
  display: flex; gap: 32px; align-items: flex-start;
  margin-bottom: 0;
}
.ufp-modal-image-wrap {
  flex: 0 0 calc(50% - 16px);   /* exactly half the content area */
  background: var(--ufp-surface-2);
  border: 1.5px solid var(--ufp-border);
  border-radius: var(--ufp-radius);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; min-height: 340px;
  overflow: hidden;
}
.ufp-modal-img {
  max-width: 100%; max-height: 380px;
  width: 100%;
  object-fit: contain; display: block;
}
.ufp-modal-img-placeholder {
  width: 120px; height: 120px; background: var(--ufp-primary-soft);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--ufp-primary); font-size: 3rem; font-weight: 700;
}
.ufp-modal-info {
  flex: 1; min-width: 0;
}

/* Product name — main title */
.ufp-modal-name {
  font-size: 1.4rem; font-weight: 700; color: var(--ufp-text);
  margin: 0 0 10px; line-height: 1.2; padding-right: 40px;
}

/* Blade·Motor and Series — same size, equal visual weight */
.ufp-modal-series {
  font-size: 1.5rem; font-weight: 700; color: var(--ufp-primary);
  letter-spacing: .01em; margin: 0 0 8px;
}

/* Profile Type — plain text below series in modal, same size */
.ufp-modal-profile-type {
  font-size: 1.5rem; font-weight: 700; color: var(--ufp-primary);
  letter-spacing: .01em; margin: 0 0 20px;
}
.ufp-modal-highlight {
  display: inline-block;
  background: var(--ufp-primary); color: #fff;
  padding: 4px 12px; border-radius: 6px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 14px;
}

/* Quick specs 2x2 grid */
.ufp-modal-quick-specs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 18px;
}
.ufp-mqs-item {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--ufp-surface-2);
  border: 1px solid var(--ufp-border);
  border-radius: var(--ufp-radius-sm);
  padding: 8px 12px;
}
.ufp-mqs-lbl {
  font-size: .62rem; font-weight: 700; color: var(--ufp-text-light);
  text-transform: uppercase; letter-spacing: .08em;
}
.ufp-mqs-val {
  font-size: .88rem; font-weight: 600; color: var(--ufp-text);
}

/* Divider */
.ufp-modal-divider {
  height: 1px; background: var(--ufp-border);
  margin: 24px 0;
}

/* Specs section */
.ufp-modal-section { margin-bottom: 0; }
.ufp-modal-section-title {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ufp-text-light);
  margin: 0 0 12px;
}
.ufp-modal-spec-table {
  width: 100%; border-collapse: collapse;
  border: 1px solid var(--ufp-border);
  border-radius: var(--ufp-radius-sm);
  overflow: hidden;
  font-size: .85rem;
}
.ufp-modal-spec-table tr:nth-child(even) { background: var(--ufp-surface-2); }
.ufp-modal-spec-table td {
  padding: 9px 12px;
  border-right: 1px solid var(--ufp-border);
  border-bottom: 1px solid var(--ufp-border);
  color: var(--ufp-text);
}
.ufp-modal-spec-table tr:last-child td { border-bottom: none; }
.ufp-modal-spec-table td:last-child { border-right: none; }
.ufp-mst-lbl {
  color: var(--ufp-text-soft); font-weight: 600; font-size: .8rem;
  white-space: nowrap;
}

/* P-Q chart section */
.ufp-modal-chart-note {
  font-size: .78rem; color: var(--ufp-primary); font-weight: 600;
  margin: 0 0 10px;
}
.ufp-modal-chart-wrap {
  background: var(--ufp-surface-2);
  border: 1.5px solid var(--ufp-border);
  border-radius: var(--ufp-radius);
  padding: 16px;
}
.ufp-modal-chart-wrap canvas {
  max-height: 280px;
}

/* ── Responsive modal ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ufp-modal-scroll { padding: 20px; }
  .ufp-modal-top { flex-direction: column; }
  .ufp-modal-image-wrap { flex: unset; width: 100%; min-height: 220px; }
  .ufp-modal-name { font-size: 1.15rem; padding-right: 30px; }
  .ufp-modal-spec-table { font-size: .78rem; }
}

/* ── Modal: Features bullet list ────────────────────────────────────────────  */
.ufp-modal-features {
  margin: 0;
  padding: 0 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
}
.ufp-modal-features li {
  position: relative;
  padding-left: 20px;
  font-size: 1.05rem;
  color: var(--ufp-text);
  line-height: 1.6;
}
.ufp-modal-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .55em;
  width: 7px;
  height: 7px;
  background: var(--ufp-primary);
  border-radius: 50%;
  opacity: .65;
}

/* Inline features inside the right info column */
.ufp-modal-features-inline {
  margin: 0 0 20px;
  padding-left: 0;
}

/* ── Modal: Motor Specs section header ────────────────────────────────────── */
.ufp-motor-specs-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ufp-motor-specs-unit {
  font-size: .68rem; font-weight: 600; color: var(--ufp-primary);
  background: var(--ufp-primary-soft);
  border: 1px solid var(--ufp-border-md);
  border-radius: 20px;
  padding: 2px 10px;
}

/* ── Modal: blade / motor name sub-line — same size as series ────────────── */
.ufp-modal-blade-motor {
  font-size: 1.25rem; font-weight: 600; color: var(--ufp-text-soft);
  margin: 0 0 6px; letter-spacing: .01em;
}

/* ── Modal: Dimensional Drawing ─────────────────────────────────────────────  */
.ufp-modal-dim-drawing {
  background: var(--ufp-surface-2);
  border: 1.5px solid var(--ufp-border);
  border-radius: var(--ufp-radius);
  padding: 16px;
  text-align: center;
}
.ufp-modal-dim-drawing img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: var(--ufp-radius-sm);
}
