/*
 * Vendora – Product Form Builder + Vendor Product Form Styles
 *
 * @since 1.2.0
 */

/* ─────────────────────────────────────────────────────────────────────────
   1. CSS Custom Properties
   ───────────────────────────────────────────────────────────────────────── */
:root {
	--vfb-brand:         #6c47ff;
	--vfb-brand-dark:    #5533cc;
	--vfb-brand-light:   #ede9ff;
	--vfb-accent:        #ff6b6b;
	--vfb-success:       #16a34a;
	--vfb-warning:       #d97706;
	--vfb-error:         #dc2626;
	--vfb-bg:            #f0f2f5;
	--vfb-surface:       #ffffff;
	--vfb-border:        #e2e8f0;
	--vfb-text:          #1e293b;
	--vfb-text-muted:    #64748b;
	--vfb-radius:        10px;
	--vfb-radius-sm:     6px;
	--vfb-shadow:        0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
	--vfb-shadow-lg:     0 8px 32px rgba(0,0,0,.12);
	--vfb-font:          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--vfb-transition:    180ms ease;
	--vfb-panel-width:   360px;
	--vfb-palette-width: 260px;
}

/* ─────────────────────────────────────────────────────────────────────────
   2. Topbar
   ───────────────────────────────────────────────────────────────────────── */
.vfb-wrap { font-family: var(--vfb-font); color: var(--vfb-text); }

.vfb-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--vfb-surface);
	border-bottom: 1px solid var(--vfb-border);
	padding: 10px 20px;
	position: sticky;
	top: 32px; /* WP admin bar */
	z-index: 200;
	gap: 12px;
	flex-wrap: wrap;
}

.vfb-topbar__left  { display: flex; align-items: center; gap: 10px; }
.vfb-topbar__right { display: flex; align-items: center; gap: 8px; }

.vfb-topbar__icon  { font-size: 22px; color: var(--vfb-brand); }
.vfb-topbar__title { margin: 0; font-size: 18px; font-weight: 700; color: var(--vfb-text); }

.vfb-topbar__badge {
	background: var(--vfb-brand-light);
	color: var(--vfb-brand);
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 100px;
}

/* ─────────────────────────────────────────────────────────────────────────
   3. Buttons
   ───────────────────────────────────────────────────────────────────────── */
.vfb-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: var(--vfb-radius-sm);
	font-size: 13px;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background var(--vfb-transition), box-shadow var(--vfb-transition);
	white-space: nowrap;
}
.vfb-btn .iconsax { font-size: 16px; width: 16px; height: 16px; line-height: 1; }

.vfb-btn--primary {
	background: var(--vfb-brand);
	color: #fff;
	border-color: var(--vfb-brand-dark);
}
.vfb-btn--primary:hover { background: var(--vfb-brand-dark); }

.vfb-btn--ghost {
	background: transparent;
	color: var(--vfb-text-muted);
	border-color: var(--vfb-border);
}
.vfb-btn--ghost:hover { background: var(--vfb-bg); color: var(--vfb-text); }

.vfb-btn--danger:hover { background: #fef2f2; color: var(--vfb-error); border-color: var(--vfb-error); }
.vfb-btn--block { width: 100%; justify-content: center; }

/* ─────────────────────────────────────────────────────────────────────────
   4. Three-column Layout
   ───────────────────────────────────────────────────────────────────────── */
.vfb-layout {
	display: grid;
	grid-template-columns: var(--vfb-palette-width) 1fr;
	grid-template-rows: 1fr;
	min-height: calc(100vh - 120px);
	background: var(--vfb-bg);
	position: relative;
}

/* When config panel is open, canvas shrinks */
.vfb-layout:has(.vfb-config-panel--open) {
	grid-template-columns: var(--vfb-palette-width) 1fr var(--vfb-panel-width);
}

/* ─────────────────────────────────────────────────────────────────────────
   5. Palette
   ───────────────────────────────────────────────────────────────────────── */
.vfb-palette {
	background: var(--vfb-surface);
	border-right: 1px solid var(--vfb-border);
	overflow-y: auto;
	padding: 12px 0 24px;
}

.vfb-palette__search-wrap {
	position: relative;
	padding: 12px 12px 8px;
}
.vfb-palette__search {
	width: 100%;
	padding: 8px 32px 8px 10px;
	border: 1px solid var(--vfb-border);
	border-radius: var(--vfb-radius-sm);
	font-size: 13px;
	background: var(--vfb-bg);
	color: var(--vfb-text);
	box-sizing: border-box;
}
.vfb-palette__search:focus { outline: none; border-color: var(--vfb-brand); box-shadow: 0 0 0 3px var(--vfb-brand-light); }
.vfb-palette__search-icon { position: absolute; right: 20px; top: 50%; transform: translateY(-35%); color: var(--vfb-text-muted); pointer-events: none; }

.vfb-palette__group-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px 6px;
	cursor: pointer;
	user-select: none;
}
.vfb-palette__group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--vfb-text-muted); }
.vfb-palette__chevron     { font-size: 14px; width: 14px; height: 14px; color: var(--vfb-text-muted); transition: transform var(--vfb-transition); }

.vfb-palette__group-body--collapsed { display: none !important; }

.vfb-palette__item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	cursor: grab;
	border-radius: 0;
	transition: background var(--vfb-transition);
	border-left: 3px solid transparent;
}
.vfb-palette__item:hover { background: var(--vfb-brand-light); border-left-color: var(--vfb-brand); }
.vfb-palette__item-icon  { font-size: 15px; width: 15px; height: 15px; color: var(--vfb-brand); flex-shrink: 0; }
.vfb-palette__item-label { font-size: 13px; color: var(--vfb-text); flex: 1; }
.vfb-palette__item-add   { font-size: 14px; width: 14px; height: 14px; color: var(--vfb-brand); opacity: 0; transition: opacity var(--vfb-transition); }
.vfb-palette__item:hover .vfb-palette__item-add { opacity: 1; }

/* ─────────────────────────────────────────────────────────────────────────
   6. Canvas
   ───────────────────────────────────────────────────────────────────────── */
.vfb-canvas-wrap { display: flex; flex-direction: column; min-height: 0; }

.vfb-canvas-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 20px;
	background: var(--vfb-surface);
	border-bottom: 1px solid var(--vfb-border);
	font-size: 13px;
	color: var(--vfb-text-muted);
}
.vfb-canvas-toolbar .iconsax { vertical-align: middle; font-size: 15px; width: 15px; height: 15px; }
.vfb-canvas-toolbar__count {
	background: var(--vfb-brand-light);
	color: var(--vfb-brand);
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 100px;
}

.vfb-canvas {
	flex: 1;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	overflow-y: auto;
}

.vfb-canvas__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 80px 40px;
	border: 2px dashed var(--vfb-border);
	border-radius: var(--vfb-radius);
	color: var(--vfb-text-muted);
	text-align: center;
	min-height: 200px;
}
.vfb-canvas__empty-icon { font-size: 40px; width: 40px; height: 40px; opacity: .4; }

/* ─────────────────────────────────────────────────────────────────────────
   7. Field Cards
   ───────────────────────────────────────────────────────────────────────── */
.vfb-field-card {
	display: grid;
	grid-template-columns: 32px 36px 1fr auto;
	align-items: center;
	gap: 12px;
	background: var(--vfb-surface);
	border: 1px solid var(--vfb-border);
	border-radius: var(--vfb-radius);
	padding: 12px 14px;
	transition: box-shadow var(--vfb-transition), border-color var(--vfb-transition), opacity .2s, transform .2s;
	position: relative;
}
.vfb-field-card:hover { box-shadow: var(--vfb-shadow); border-color: #c7d3e4; }

.vfb-field-card--locked { border-left: 3px solid var(--vfb-brand); }

.vfb-field-card--step {
	border-left: 3px solid var(--vfb-brand);
	background: linear-gradient(90deg, rgba(99, 102, 241, 0.06) 0%, transparent 100%);
}
.vfb-field-card--step .vfb-field-card__label { font-size: 15px; }
.vfb-field-card--step .vfb-field-card__type { color: var(--vfb-brand); }

/* Drag states */
.vfb-field-card--ghost  { opacity: .4; background: var(--vfb-brand-light); }
.vfb-field-card--chosen { box-shadow: var(--vfb-shadow-lg); }
.vfb-field-card--drag   { opacity: .9; box-shadow: var(--vfb-shadow-lg); transform: scale(1.02); }

/* New animation */
@keyframes vfbSlideIn {
	from { opacity: 0; transform: translateY(-8px); }
	to   { opacity: 1; transform: translateY(0); }
}
.vfb-field-card--new { animation: vfbSlideIn .35s ease forwards; }

/* Remove animation */
@keyframes vfbFadeOut {
	to { opacity: 0; transform: scale(.95); max-height: 0; padding: 0; margin: 0; }
}
.vfb-field-card--removing { animation: vfbFadeOut .2s ease forwards; overflow: hidden; }

.vfb-field-card__handle {
	cursor: grab;
	color: #b0bec5;
	display: flex;
	align-items: center;
	justify-content: center;
}
.vfb-field-card__handle:hover { color: var(--vfb-text-muted); }
.vfb-field-card__handle .iconsax { font-size: 18px; width: 18px; height: 18px; }

.vfb-field-card__icon {
	width: 36px; height: 36px;
	background: var(--vfb-brand-light);
	border-radius: 8px;
	display: flex; align-items: center; justify-content: center;
}
.vfb-field-card__icon .iconsax { font-size: 18px; width: 18px; height: 18px; color: var(--vfb-brand); }

.vfb-field-card__info  { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vfb-field-card__label { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vfb-field-card__type  { font-size: 12px; color: var(--vfb-text-muted); }
.vfb-field-card__required {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--vfb-accent);
	background: #fff1f1;
	padding: 1px 6px;
	border-radius: 4px;
	width: fit-content;
}

.vfb-field-card__actions { display: flex; align-items: center; gap: 4px; }
.vfb-field-card__btn {
	width: 30px; height: 30px;
	border: none;
	border-radius: var(--vfb-radius-sm);
	background: transparent;
	color: var(--vfb-text-muted);
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	transition: background var(--vfb-transition), color var(--vfb-transition);
}
.vfb-field-card__btn .iconsax { font-size: 16px; width: 16px; height: 16px; }
.vfb-field-card__btn--edit:hover   { background: var(--vfb-brand-light); color: var(--vfb-brand); }
.vfb-field-card__btn--remove:hover { background: #fef2f2; color: var(--vfb-error); }
.vfb-field-card__lock { color: #c7d3e4; display: flex; align-items: center; padding: 0 7px; }

/* ─────────────────────────────────────────────────────────────────────────
   8. Config Panel
   ───────────────────────────────────────────────────────────────────────── */
.vfb-config-panel {
	background: var(--vfb-surface);
	border-left: 1px solid var(--vfb-border);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	max-width: 0;
	transition: max-width .25s ease;
	position: relative;
}
.vfb-config-panel--open { max-width: var(--vfb-panel-width); }

.vfb-config-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--vfb-border);
}
.vfb-config-panel__header h2 { margin: 0; font-size: 15px; font-weight: 700; }
.vfb-config-panel__close {
	width: 28px; height: 28px;
	border: none;
	border-radius: var(--vfb-radius-sm);
	background: var(--vfb-bg);
	color: var(--vfb-text-muted);
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.vfb-config-panel__close:hover { background: #fef2f2; color: var(--vfb-error); }

.vfb-config-panel__body  { flex: 1; overflow-y: auto; padding: 16px 20px; }
.vfb-config-panel__footer { padding: 12px 20px; border-top: 1px solid var(--vfb-border); }

/* Config form rows */
.vfb-config-row { margin-bottom: 16px; }
.vfb-config-row__label { display: block; font-size: 12px; font-weight: 600; color: var(--vfb-text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.vfb-config-row__control { }

.vfb-config-input,
.vfb-config-select,
.vfb-config-textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--vfb-border);
	border-radius: var(--vfb-radius-sm);
	font-size: 13px;
	color: var(--vfb-text);
	background: var(--vfb-bg);
	box-sizing: border-box;
	transition: border-color var(--vfb-transition), box-shadow var(--vfb-transition);
}
.vfb-config-input:focus,
.vfb-config-select:focus,
.vfb-config-textarea:focus {
	outline: none;
	border-color: var(--vfb-brand);
	box-shadow: 0 0 0 3px var(--vfb-brand-light);
	background: #fff;
}
.vfb-config-input--wide { width: 100%; }
.vfb-config-textarea { resize: vertical; min-height: 80px; }
.vfb-config-note { font-size: 11px; color: var(--vfb-text-muted); margin: 4px 0 0; }

/* Toggle switch */
.vfb-toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.vfb-toggle input { opacity: 0; width: 0; height: 0; }
.vfb-toggle__slider {
	position: absolute; inset: 0;
	background: var(--vfb-border);
	border-radius: 100px;
	cursor: pointer;
	transition: background .2s;
}
.vfb-toggle__slider::before {
	content: '';
	position: absolute;
	width: 16px; height: 16px;
	left: 3px; top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s;
	box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.vfb-toggle input:checked + .vfb-toggle__slider { background: var(--vfb-brand); }
.vfb-toggle input:checked + .vfb-toggle__slider::before { transform: translateX(18px); }

/* ─────────────────────────────────────────────────────────────────────────
   9. Preview Modal
   ───────────────────────────────────────────────────────────────────────── */
.vfb-modal { display: none; position: fixed; inset: 0; z-index: 10000; }
.vfb-modal--open { display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; }

.vfb-modal__backdrop {
	position: fixed; inset: 0;
	background: rgba(15,23,42,.55);
	backdrop-filter: blur(4px);
}
.vfb-modal__dialog {
	position: relative;
	background: var(--vfb-surface);
	border-radius: var(--vfb-radius);
	box-shadow: var(--vfb-shadow-lg);
	width: 100%;
	max-width: 640px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: vfbSlideIn .2s ease;
}
.vfb-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--vfb-border);
}
.vfb-modal__header h2 { margin: 0; font-size: 16px; }
.vfb-modal__close {
	width: 30px; height: 30px;
	border: none; border-radius: 50%;
	background: var(--vfb-bg);
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	color: var(--vfb-text-muted);
}
.vfb-modal__close:hover { background: #fef2f2; color: var(--vfb-error); }
.vfb-modal__body { overflow-y: auto; padding: 20px; flex: 1; }

/* Preview form styles */
.vfb-preview-form { display: flex; flex-direction: column; gap: 16px; }
.vfb-preview-field { display: flex; flex-direction: column; gap: 4px; }
.vfb-preview-label { font-weight: 600; font-size: 13px; }
.vfb-preview-label .vfb-req { color: var(--vfb-accent); }
.vfb-preview-hint  { font-size: 12px; color: var(--vfb-text-muted); margin: 0; }
.vfb-preview-input,
.vfb-preview-select,
.vfb-preview-textarea {
	padding: 8px 10px;
	border: 1px solid var(--vfb-border);
	border-radius: var(--vfb-radius-sm);
	font-size: 13px;
	background: var(--vfb-bg);
	color: var(--vfb-text-muted);
	width: 100%;
	box-sizing: border-box;
}
.vfb-preview-rich-placeholder {
	padding: 20px;
	border: 1px dashed var(--vfb-border);
	border-radius: var(--vfb-radius-sm);
	background: var(--vfb-bg);
	color: var(--vfb-text-muted);
	text-align: center;
	font-size: 13px;
}
.vfb-preview-upload-zone {
	border: 2px dashed var(--vfb-border);
	border-radius: var(--vfb-radius-sm);
	padding: 28px;
	text-align: center;
	color: var(--vfb-text-muted);
	font-size: 13px;
}
.vfb-preview-upload-zone .iconsax { font-size: 28px; width: 28px; height: 28px; color: var(--vfb-brand); display: block; margin: 0 auto 8px; }
.vfb-preview-divider   { border: none; border-top: 1px solid var(--vfb-border); margin: 4px 0; }
.vfb-preview-heading   { margin: 8px 0 0; font-size: 16px; color: var(--vfb-text); }
.vfb-preview-step-title { margin: 16px 0 8px; font-size: 15px; font-weight: 600; color: var(--vfb-brand); }
.vfb-preview-step-title:first-child { margin-top: 0; }
.vfb-preview-subheading { margin: 0; font-size: 13px; color: var(--vfb-text-muted); }
.vfb-intro { margin: 0 0 16px; padding: 10px 14px; background: var(--vfb-brand-light); border-radius: var(--vfb-radius-sm); font-size: 13px; color: var(--vfb-text); border-left: 3px solid var(--vfb-brand); }
.vfb-preview-price-wrap { display: flex; align-items: center; gap: 6px; }
.vfb-preview-currency { font-weight: 700; color: var(--vfb-text-muted); }
.vfb-preview-price { width: 120px; padding: 8px 10px; border: 1px solid var(--vfb-border); border-radius: var(--vfb-radius-sm); background: var(--vfb-bg); }
.vfb-preview-pricing-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.vfb-preview-pricing-row input { flex: 1; }
.vfb-preview-add-tier { font-size: 12px; background: var(--vfb-bg); border: 1px dashed var(--vfb-border); padding: 6px 12px; border-radius: var(--vfb-radius-sm); cursor: default; color: var(--vfb-text-muted); }

/* ─────────────────────────────────────────────────────────────────────────
   10. Toast Notification
   ───────────────────────────────────────────────────────────────────────── */
.vfb-toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	padding: 12px 20px;
	border-radius: var(--vfb-radius-sm);
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	box-shadow: var(--vfb-shadow-lg);
	z-index: 99999;
	transform: translateY(20px);
	opacity: 0;
	transition: transform .3s ease, opacity .3s ease;
}
.vfb-toast--visible  { transform: translateY(0); opacity: 1; }
.vfb-toast--success  { background: var(--vfb-success); }
.vfb-toast--error    { background: var(--vfb-error); }
.vfb-toast--info     { background: var(--vfb-brand); }

/* Spinner */
.vfb-spin { animation: vfbSpin 1s linear infinite; display: inline-block; }
@keyframes vfbSpin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────────────────────────
   11. VENDOR PRODUCT FORM – Multi-step wizard
   ───────────────────────────────────────────────────────────────────────── */

/* Wrapper */
.vpf-wrap {
	font-family: var(--vfb-font);
	color: var(--vfb-text);
	max-width: 900px;
	margin: 0 auto;
}

/* Progress Steps */
.vpf-steps {
	display: flex;
	align-items: center;
	gap: 0;
	margin-bottom: 32px;
	background: var(--vfb-surface);
	border: 1px solid var(--vfb-border);
	border-radius: var(--vfb-radius);
	overflow: hidden;
	padding: 0;
}
.vpf-step {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	font-size: 13px;
	font-weight: 500;
	color: var(--vfb-text-muted);
	border-right: 1px solid var(--vfb-border);
	cursor: pointer;
	transition: background var(--vfb-transition);
	position: relative;
}
.vpf-step:last-child { border-right: none; }
.vpf-step__num {
	width: 28px; height: 28px;
	border-radius: 50%;
	background: var(--vfb-bg);
	border: 2px solid var(--vfb-border);
	display: flex; align-items: center; justify-content: center;
	font-size: 12px; font-weight: 700;
	flex-shrink: 0;
	transition: background var(--vfb-transition), border-color var(--vfb-transition), color var(--vfb-transition);
}
.vpf-step.is-active {
	background: var(--vfb-brand-light);
	color: var(--vfb-brand);
}
.vpf-step.is-active .vpf-step__num {
	background: var(--vfb-brand);
	border-color: var(--vfb-brand);
	color: #fff;
}
.vpf-step.is-done .vpf-step__num {
	background: var(--vfb-success);
	border-color: var(--vfb-success);
	color: #fff;
}
.vpf-step.is-done .vpf-step__num::after { content: '✓'; }
.vpf-step.is-done .vpf-step__num span { display: none; }

/* Auto-save indicator */
.vpf-autosave {
	font-size: 12px;
	color: var(--vfb-text-muted);
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 12px;
	min-height: 20px;
}
.vpf-autosave.saving { color: var(--vfb-brand); }
.vpf-autosave.saved  { color: var(--vfb-success); }

/* Step panels */
.vpf-panel { display: none; }
.vpf-panel.is-active { display: block; animation: vfbSlideIn .2s ease; }

/* Form fields */
.vpf-field { margin-bottom: 22px; }
.vpf-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--vfb-text);
}
.vpf-label .vpf-req { color: var(--vfb-accent); }
.vpf-hint { font-size: 12px; color: var(--vfb-text-muted); margin: 4px 0 0; }
.vpf-input,
.vpf-select,
.vpf-textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--vfb-border);
	border-radius: var(--vfb-radius-sm);
	font-size: 14px;
	color: var(--vfb-text);
	background: #fff;
	box-sizing: border-box;
	transition: border-color var(--vfb-transition), box-shadow var(--vfb-transition);
}
.vpf-input:focus, .vpf-select:focus, .vpf-textarea:focus {
	outline: none;
	border-color: var(--vfb-brand);
	box-shadow: 0 0 0 3px var(--vfb-brand-light);
}
.vpf-textarea { resize: vertical; min-height: 120px; }

/* Price field */
.vpf-price-row  { display: flex; align-items: center; gap: 8px; }
.vpf-currency   { font-weight: 700; font-size: 16px; color: var(--vfb-text-muted); }
.vpf-price-input { width: 160px; }

/* Variable pricing */
.vpf-pricing-tiers { display: flex; flex-direction: column; gap: 8px; }
.vpf-pricing-tier {
	display: grid;
	grid-template-columns: 24px 1fr 1fr auto;
	align-items: center;
	gap: 8px;
	background: var(--vfb-bg);
	border: 1px solid var(--vfb-border);
	border-radius: var(--vfb-radius-sm);
	padding: 8px 10px;
}
.vpf-pricing-tier__handle { cursor: grab; color: var(--vfb-text-muted); }
.vpf-pricing-tier__handle .iconsax { font-size: 14px; width: 14px; height: 14px; }
.vpf-pricing-tier__remove {
	background: none;
	border: none;
	color: var(--vfb-error);
	cursor: pointer;
	padding: 2px 4px;
	border-radius: 4px;
}
.vpf-add-tier {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 1px dashed var(--vfb-brand);
	border-radius: var(--vfb-radius-sm);
	background: none;
	color: var(--vfb-brand);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	margin-top: 6px;
}
.vpf-add-tier:hover { background: var(--vfb-brand-light); }

/* Tags input */
.vpf-tags-wrap  { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--vfb-border); border-radius: var(--vfb-radius-sm); min-height: 42px; background: #fff; cursor: text; }
.vpf-tags-wrap:focus-within { border-color: var(--vfb-brand); box-shadow: 0 0 0 3px var(--vfb-brand-light); }
.vpf-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: var(--vfb-brand-light);
	color: var(--vfb-brand);
	padding: 3px 8px;
	border-radius: 100px;
	font-size: 12px;
	font-weight: 600;
}
.vpf-tag-remove { cursor: pointer; border: none; background: none; padding: 0; color: inherit; font-size: 14px; line-height: 1; }
.vpf-tag-input  { border: none; outline: none; font-size: 13px; min-width: 100px; flex: 1; padding: 0 4px; }

/* Upload zones */
.vpf-upload-zone {
	border: 2px dashed var(--vfb-border);
	border-radius: var(--vfb-radius);
	padding: 36px 24px;
	text-align: center;
	cursor: pointer;
	transition: border-color var(--vfb-transition), background var(--vfb-transition);
}
.vpf-upload-zone:hover,
.vpf-upload-zone.drag-over { border-color: var(--vfb-brand); background: var(--vfb-brand-light); }
.vpf-upload-zone__icon { font-size: 36px; width: 36px; height: 36px; color: var(--vfb-brand); margin: 0 auto 10px; display: block; }
.vpf-upload-zone__title { font-weight: 700; font-size: 14px; margin: 0 0 4px; }
.vpf-upload-zone__sub   { font-size: 12px; color: var(--vfb-text-muted); margin: 0; }
.vpf-upload-zone input[type="file"] { display: none; }

/* Thumbnail preview */
.vpf-thumb-preview {
	position: relative;
	width: 160px;
	height: 160px;
	border-radius: var(--vfb-radius);
	overflow: hidden;
	border: 2px solid var(--vfb-border);
}
.vpf-thumb-preview img { width: 100%; height: 100%; object-fit: cover; }
.vpf-thumb-preview__remove {
	position: absolute;
	top: 6px; right: 6px;
	background: rgba(220,38,38,.9);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 24px; height: 24px;
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	font-size: 12px;
}

/* Gallery grid */
.vpf-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 8px;
}
.vpf-gallery-item {
	position: relative;
	aspect-ratio: 1;
	border-radius: var(--vfb-radius-sm);
	overflow: hidden;
	border: 1px solid var(--vfb-border);
	cursor: grab;
}
.vpf-gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.vpf-gallery-item__remove {
	position: absolute;
	top: 4px; right: 4px;
	background: rgba(220,38,38,.85);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 22px; height: 22px;
	cursor: pointer;
	font-size: 11px;
	display: flex; align-items: center; justify-content: center;
}

/* File list */
.vpf-file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.vpf-file-item {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 10px;
	background: var(--vfb-bg);
	border: 1px solid var(--vfb-border);
	border-radius: var(--vfb-radius-sm);
	padding: 8px 12px;
}
.vpf-file-item__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vpf-file-item__name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vpf-file-item__meta { font-size: 11px; color: var(--vfb-text-muted); }
.vpf-file-item__progress {
	height: 3px;
	background: var(--vfb-border);
	border-radius: 2px;
	overflow: hidden;
	margin-top: 4px;
}
.vpf-file-item__progress-bar {
	height: 100%;
	background: var(--vfb-brand);
	border-radius: 2px;
	transition: width .3s ease;
	width: 0;
}
.vpf-file-item__remove {
	border: none;
	background: none;
	color: var(--vfb-error);
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	padding: 2px;
}

/* Nav buttons */
.vpf-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--vfb-border);
}
.vpf-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border-radius: var(--vfb-radius-sm);
	font-size: 14px;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background var(--vfb-transition);
}
.vpf-btn--primary { background: var(--vfb-brand); color: #fff; border-color: var(--vfb-brand-dark); }
.vpf-btn--primary:hover { background: var(--vfb-brand-dark); }
.vpf-btn--ghost   { background: #fff; color: var(--vfb-text-muted); border-color: var(--vfb-border); }
.vpf-btn--ghost:hover { background: var(--vfb-bg); }
.vpf-btn--success { background: var(--vfb-success); color: #fff; }
.vpf-btn--danger  { background: #fef2f2; color: var(--vfb-error); border-color: var(--vfb-error); }

/* Rich-text placeholder */
.vpf-rich-editor {
	border: 1px solid var(--vfb-border);
	border-radius: var(--vfb-radius-sm);
	min-height: 180px;
	padding: 10px;
	font-size: 14px;
	line-height: 1.6;
	background: #fff;
	color: var(--vfb-text);
}
.vpf-rich-editor:focus { outline: none; border-color: var(--vfb-brand); box-shadow: 0 0 0 3px var(--vfb-brand-light); }

/* Character counter */
.vpf-char-count { font-size: 11px; color: var(--vfb-text-muted); text-align: right; margin-top: 3px; }
.vpf-char-count.over-limit { color: var(--vfb-error); }

/* ─────────────────────────────────────────────────────────────────────────
   Download files + variable pricing hint (always visible in download section)
   ───────────────────────────────────────────────────────────────────────── */
.vpf-file-tier-hint {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-bottom: 14px;
	padding: 12px 14px;
	background: var(--vfb-brand-light);
	border-radius: var(--vfb-radius-sm);
	border-left: 3px solid var(--vfb-brand);
}
.vpf-file-tier-hint .iconsax {
	flex-shrink: 0;
	color: var(--vfb-brand);
	font-size: 18px;
	width: 18px;
	height: 18px;
	margin-top: 1px;
}
.vpf-file-tier-hint p {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--vfb-text);
}

/* ─────────────────────────────────────────────────────────────────────────
   File Condition / Tier-Access Control
   ─────────────────────────────────────────────────────────────────────────
   Injected by JS per download-file item when variable pricing is enabled.
   ───────────────────────────────────────────────────────────────────────── */
.vpf-file-condition {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px dashed var(--vfb-border);
	flex-wrap: wrap;
}
.vpf-file-condition__label {
	font-size: 12px;
	font-weight: 600;
	color: var(--vfb-text);
	white-space: nowrap;
}
.vpf-file-condition-select {
	flex: 1;
	font-size: 12px;
	padding: 3px 8px;
	border: 1px solid var(--vfb-border);
	border-radius: 4px;
	background: #fff;
	color: var(--vfb-text);
	cursor: pointer;
	transition: border-color 0.15s ease;
}
.vpf-file-condition-select:focus {
	outline: none;
	border-color: var(--vfb-brand);
	box-shadow: 0 0 0 2px var(--vfb-brand-light);
}

/* ─────────────────────────────────────────────────────────────────────────
   13. New Custom Field Types (radio, checkbox, terms)
   ───────────────────────────────────────────────────────────────────────── */

/* Radio group */
.vpf-radio-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}
.vpf-radio-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--vfb-text);
	cursor: pointer;
	padding: 4px 0;
}
.vpf-radio-label input[type="radio"] {
	width: 16px;
	height: 16px;
	cursor: pointer;
	accent-color: var(--vfb-brand);
	flex-shrink: 0;
}
.vpf-radio-label:hover { color: var(--vfb-brand); }

/* Checkbox / terms */
.vpf-checkbox-label,
.vpf-terms-label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--vfb-text);
	cursor: pointer;
	line-height: 1.5;
}
.vpf-checkbox-label input[type="checkbox"],
.vpf-terms-label input[type="checkbox"] {
	width: 16px;
	height: 16px;
	margin-top: 2px;
	cursor: pointer;
	accent-color: var(--vfb-brand);
	flex-shrink: 0;
}
.vpf-checkbox-label.vpf-input--error,
.vpf-terms-label.vpf-input--error {
	color: var(--vfb-error);
}

/* Number field – tighten width */
.vpf-field input[type="number"].vpf-input {
	max-width: 220px;
}

/* Variable pricing hint text */
.vpf-vp-hint {
	margin-top: 8px !important;
	font-style: italic;
}

/* Autosave status colours */
.vpf-autosave.saving { color: var(--vfb-text-muted); }
.vpf-autosave.saved  { color: var(--vfb-success); }

/* ─────────────────────────────────────────────────────────────────────────
   14. Form Style Toggle Bar
   ───────────────────────────────────────────────────────────────────────── */
.vfb-style-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	background: var(--vfb-surface);
	border-bottom: 2px solid var(--vfb-border);
	padding: 10px 20px;
	flex-wrap: wrap;
}

.vfb-style-bar__label {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--vfb-text-muted);
	white-space: nowrap;
}

.vfb-style-tabs {
	display: flex;
	gap: 4px;
	background: var(--vfb-bg);
	border-radius: var(--vfb-radius);
	padding: 3px;
}

.vfb-style-tab {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border: none;
	background: transparent;
	border-radius: 7px;
	font-size: 13px;
	font-weight: 500;
	color: var(--vfb-text-muted);
	cursor: pointer;
	transition: background var(--vfb-transition), color var(--vfb-transition), box-shadow var(--vfb-transition);
	white-space: nowrap;
}

.vfb-style-tab:hover {
	background: rgba(108, 71, 255, .07);
	color: var(--vfb-brand);
}

.vfb-style-tab.is-active {
	background: var(--vfb-surface);
	color: var(--vfb-brand);
	box-shadow: 0 1px 4px rgba(0,0,0,.10);
}

.vfb-style-bar__hint {
	font-size: 12px;
	color: var(--vfb-text-muted);
	margin-left: auto;
	font-style: italic;
}

/* ─────────────────────────────────────────────────────────────────────────
   15. Responsive
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
	.vfb-layout {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
	}
	.vfb-palette {
		border-right: none;
		border-bottom: 1px solid var(--vfb-border);
		max-height: 220px;
	}
	.vfb-palette__group { display: inline-block; }
	.vfb-config-panel--open { position: fixed; right: 0; top: 32px; bottom: 0; max-width: 320px; z-index: 999; box-shadow: var(--vfb-shadow-lg); }
	.vpf-steps { flex-direction: column; }
	.vpf-step  { width: 100%; border-right: none; border-bottom: 1px solid var(--vfb-border); }
}
