/* ── Essential Configs – Admin Stylesheet ───────────────────────────────── */

:root {
	--ec-primary:   #2271b1;
	--ec-success:   #00a32a;
	--ec-error:     #d63638;
	--ec-track-off: #c3c4c7;
	--ec-track-on:  #2271b1;
	--ec-radius:    8px;
	--ec-shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
	--ec-font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Page wrapper ─────────────────────────────────────────────────────────── */
.ec-wrap {
	max-width: 1280px;
	margin-top: 24px;
	font-family: var(--ec-font);
}

.ec-page-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1.5rem;
	font-weight: 700;
	color: #1d2327;
	margin-bottom: 20px;
}

.ec-logo {
	font-size: 1.4rem;
	color: var(--ec-primary);
}

/* ── Tab navigation ───────────────────────────────────────────────────────── */
.ec-tab-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 20px;
	border-bottom: 2px solid #dcdcde;
	padding-bottom: 0;
}

.ec-tab-btn {
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	padding: 10px 16px;
	font-size: 13.5px;
	font-weight: 500;
	color: #50575e;
	cursor: pointer;
	border-radius: 4px 4px 0 0;
	transition: color .15s, border-color .15s, background .15s;
}

.ec-tab-btn:hover {
	color: var(--ec-primary);
	background: #f0f6fc;
}

.ec-tab-btn.active {
	color: var(--ec-primary);
	border-bottom-color: var(--ec-primary);
	font-weight: 600;
}

/* ── Tab panels ───────────────────────────────────────────────────────────── */
.ec-tab-panel { display: none; }
.ec-tab-panel.active { display: block; }

.ec-tab-intro {
	color: #50575e;
	font-size: 13px;
	margin: 0 0 16px;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.ec-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: var(--ec-radius);
	box-shadow: var(--ec-shadow);
	margin-bottom: 20px;
	overflow: hidden;
}

/* ── Section header ───────────────────────────────────────────────────────── */
.ec-section-head {
	padding: 16px 22px 14px;
	border-bottom: 1px solid #f0f0f1;
	background: #fafafa;
}

.ec-section-head h2 {
	font-size: 14px;
	font-weight: 700;
	margin: 0 0 4px;
	color: #1d2327;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.ec-section-head p {
	margin: 0;
	font-size: 12.5px;
	color: #646970;
}

/* ── Option rows ──────────────────────────────────────────────────────────── */
.ec-row {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 14px 22px;
	border-bottom: 1px solid #f0f0f1;
	transition: background .1s;
}

.ec-row:last-child { border-bottom: none; }

.ec-row:hover { background: #f8f9fa; }

.ec-row-info {
	flex: 1;
	min-width: 0;
}

.ec-row-info strong {
	display: block;
	font-size: 13.5px;
	color: #1d2327;
	margin-bottom: 3px;
}

.ec-row-info p {
	margin: 0;
	font-size: 12.5px;
	color: #646970;
	line-height: 1.5;
}

.ec-row-info p code {
	background: #f0f0f1;
	padding: 1px 4px;
	border-radius: 3px;
	font-size: 11.5px;
}

/* ── Radio row ────────────────────────────────────────────────────────────── */
.ec-row-radio { align-items: center; }

.ec-radio-group {
	display: flex;
	gap: 0;
	flex-shrink: 0;
}

.ec-radio-btn {
	background: #fff;
	border: 1px solid #c3c4c7;
	padding: 6px 13px;
	font-size: 12.5px;
	cursor: pointer;
	color: #50575e;
	transition: all .15s;
	line-height: 1.4;
	white-space: nowrap;
}

.ec-radio-btn:first-child { border-radius: 4px 0 0 4px; }
.ec-radio-btn:last-child  { border-radius: 0 4px 4px 0; }
.ec-radio-btn:not(:first-child) { margin-left: -1px; }

.ec-radio-btn:hover {
	background: #f0f6fc;
	border-color: var(--ec-primary);
	color: var(--ec-primary);
	z-index: 1;
}

.ec-radio-btn.active {
	background: var(--ec-primary);
	border-color: var(--ec-primary);
	color: #fff;
	z-index: 2;
	font-weight: 600;
}

/* ── Toggle switch ────────────────────────────────────────────────────────── */
.ec-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	cursor: pointer;
	margin-top: 2px;
}

.ec-toggle-input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.ec-array-toggle {
	flex-shrink: 0;
	width: 15px;
	height: 15px;
	margin: 0;
	cursor: pointer;
	accent-color: var(--ec-primary);
}

.ec-toggle-track {
	position: relative;
	width: 44px;
	height: 24px;
	background: var(--ec-track-off);
	border-radius: 12px;
	transition: background .25s;
	display: block;
}

.ec-toggle-input:checked ~ .ec-toggle-track { background: var(--ec-track-on); }

.ec-toggle-thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0,0,0,.2);
	transition: left .25s;
}

.ec-toggle-input:checked ~ .ec-toggle-track .ec-toggle-thumb { left: 23px; }

/* saving state */
.ec-toggle.is-saving .ec-toggle-track { opacity: .6; }
.ec-toggle.is-saving { cursor: wait; }

/* ── Array grid (multi-toggle) ────────────────────────────────────────────── */
.ec-array-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 4px;
	padding: 14px 22px;
}

.ec-array-grid-wide {
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.ec-array-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 6px;
	background: #f8f9fa;
	border: 1px solid #f0f0f1;
	transition: background .15s;
	cursor: pointer;
}

.ec-array-item.is-saving {
	opacity: .6;
	cursor: wait;
}

.ec-array-item:hover { background: #f0f6fc; border-color: #d0d5dd; }

.ec-array-label {
	font-size: 12.5px;
	color: #1d2327;
	cursor: default;
	user-select: none;
}

/* ── Collapsible (WC feature grid) ───────────────────────────────────────── */
.ec-collapsible {
	display: none;
	border-top: 1px dashed #dcdcde;
	background: #fafbfc;
}

.ec-collapsible.is-open { display: block; }

.ec-sub-section-title {
	padding: 10px 22px 0;
	font-size: 12px;
	font-weight: 600;
	color: #646970;
	text-transform: uppercase;
	letter-spacing: .04em;
}

/* ── Save feedback ────────────────────────────────────────────────────────── */
.ec-save-feedback {
	position: fixed;
	bottom: 28px;
	right: 28px;
	background: #1d2327;
	color: #fff;
	padding: 10px 18px;
	border-radius: 6px;
	font-size: 13px;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .2s, transform .2s;
	pointer-events: none;
	z-index: 9999;
}

.ec-save-feedback.show {
	opacity: 1;
	transform: translateY(0);
}

.ec-save-feedback.is-error { background: var(--ec-error); }
.ec-save-feedback.is-success { background: var(--ec-success); }

/* ── Notice bar ───────────────────────────────────────────────────────────── */
.ec-notice {
	padding: 12px 16px;
	border-radius: var(--ec-radius);
	margin-bottom: 16px;
	font-size: 13px;
}

.ec-notice-warning {
	background: #fcf9e8;
	border: 1px solid #dba617;
	color: #614200;
}

/* ── Import / Export bar ─────────────────────────────────────────────────── */
.ec-io-card { margin-top: 8px; }

.ec-io-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 18px;
}

.ec-io-title {
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.ec-io-actions { display: flex; gap: 8px; }

.ec-btn {
	padding: 6px 14px;
	border-radius: 4px;
	border: 1px solid var(--ec-primary);
	background: var(--ec-primary);
	color: #fff;
	font-size: 12.5px;
	cursor: pointer;
	font-weight: 500;
	transition: opacity .15s;
}

.ec-btn:hover { opacity: .85; }

.ec-btn-secondary {
	background: #fff;
	color: var(--ec-primary);
}

.ec-btn-secondary:hover { background: #f0f6fc; opacity: 1; }

/* ── Number input ─────────────────────────────────────────────────────────── */
.ec-number-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.ec-number-input {
	width: 80px;
	padding: 5px 8px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 13px;
	color: #1d2327;
	text-align: right;
	transition: border-color .15s;
}

.ec-number-input:focus {
	border-color: var(--ec-primary);
	outline: none;
	box-shadow: 0 0 0 1px var(--ec-primary);
}

.ec-number-unit {
	font-size: 12.5px;
	color: #646970;
	white-space: nowrap;
}

/* ── Third-party widget loading state ────────────────────────────────────── */
.ec-thirdparty-loading,
.ec-thirdparty-empty {
	padding: 14px 22px;
	font-size: 12.5px;
	color: #646970;
	margin: 0;
}

/* ── Logo picker ──────────────────────────────────────────────────────────── */
.ec-row-logo { align-items: center; }

.ec-logo-picker {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
	flex-shrink: 0;
}

#ec-logo-preview {
	display: block;
	max-width: 160px;
	max-height: 80px;
	width: auto;
	height: auto;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	background: #f6f7f7;
	object-fit: contain;
	padding: 4px;
}

.ec-logo-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ec-btn-link {
	background: none;
	border: none;
	padding: 0;
	font-size: 12.5px;
	color: var(--ec-error);
	cursor: pointer;
	text-decoration: underline;
}

.ec-btn-link:hover { opacity: .8; }

/* ── Textarea row ─────────────────────────────────────────────────────────── */
.ec-row-textarea {
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
}

.ec-textarea-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", monospace;
	font-size: 12.5px;
	line-height: 1.6;
	color: #1d2327;
	background: #fafbfc;
	resize: vertical;
	transition: border-color .15s;
	box-sizing: border-box;
}

.ec-textarea-input:focus {
	border-color: var(--ec-primary);
	outline: none;
	box-shadow: 0 0 0 1px var(--ec-primary);
	background: #fff;
}

.ec-textarea-input:disabled {
	opacity: .6;
	cursor: wait;
}
