/* Estimated Delivery Date — admin UI (faithful port of the Figma design) */

#edfw-admin-app {
	--edfw-accent: #7f54b3;
	--edfw-accent-dark: #6a4595;
	--edfw-tint: #f3eefb;
	--edfw-tint-border: #e2d6f5;
	--edfw-ink: #1d2327;
	--edfw-muted: #787c82;
	--edfw-sub: #50575e;
	--edfw-border: #dcdcde;
	--edfw-border-2: #c3c4c7;
	--edfw-line: #f0f0f1;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--edfw-ink);
	-webkit-font-smoothing: antialiased;
}
#edfw-admin-app * { box-sizing: border-box; }

/* Pull the app to the wp-admin content edge */
.edfw-app { margin: 20px 20px 60px 0; }

/* ---- Header ---- */
.edfw-header { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.edfw-logo {
	width: 46px; height: 46px; border-radius: 11px; flex: none;
	background: linear-gradient(140deg, #8a5fc0, var(--edfw-accent-dark));
	display: flex; align-items: center; justify-content: center; color: #fff;
	box-shadow: 0 4px 12px rgba(106, 69, 149, .35);
}
.edfw-htext { min-width: 0; }
.edfw-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.edfw-title-row h1 { margin: 0; padding: 0; font-size: 23px; font-weight: 700; letter-spacing: -.4px; }
.edfw-badge-ver { font-size: 11px; font-weight: 600; color: var(--edfw-sub); background: #e9e9ea; border-radius: 5px; padding: 3px 7px; }
.edfw-subtitle { font-size: 13px; color: var(--edfw-muted); margin-top: 3px; }
.edfw-header-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.edfw-doc-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--edfw-sub); text-decoration: none; font-weight: 500; }
.edfw-save-btn {
	display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px;
	border: none; border-radius: 7px; color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer;
	background: var(--edfw-accent); box-shadow: 0 2px 6px rgba(106, 69, 149, .3);
}
.edfw-save-btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
.edfw-save-btn.is-saved { background: #00854a; }
.edfw-save-status { font-size: 12.5px; color: var(--edfw-muted); margin-right: 2px; }

/* ---- Tabs ---- */
.edfw-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--edfw-border); margin-bottom: 24px; overflow-x: auto; }
.edfw-tab {
	display: flex; align-items: center; gap: 7px; padding: 11px 15px 13px; border: none; background: transparent;
	font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--edfw-muted);
	border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.edfw-tab.is-active { color: var(--edfw-accent-dark); border-bottom-color: var(--edfw-accent); }

/* ---- Layout ---- */
.edfw-grid { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 30px; align-items: start; }
.edfw-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.edfw-side { position: sticky; top: 40px; }
@media (max-width: 960px) {
	.edfw-grid { grid-template-columns: 1fr; }
	.edfw-side { position: static; }
}

/* ---- Cards ---- */
.edfw-card { background: #fff; border: 1px solid var(--edfw-border); border-radius: 10px; padding: 22px 24px; }
.edfw-card--row { display: flex; align-items: center; gap: 18px; padding: 20px 24px; }
.edfw-card__title { font-size: 15px; font-weight: 600; }
.edfw-card__desc { font-size: 13px; color: var(--edfw-muted); margin-top: 3px; line-height: 1.5; }
.edfw-field-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }

/* ---- Custom form controls ---- */
.edfw-select, .edfw-input, .edfw-textarea {
	height: 40px; border: 1px solid var(--edfw-border-2); border-radius: 7px; padding: 0 12px;
	font-size: 14px; background: #fff; color: var(--edfw-ink);
}
.edfw-select { cursor: pointer; min-width: 150px; }
.edfw-textarea { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.5; width: 100%; }

/* Toggle */
.edfw-toggle { width: 44px; height: 24px; border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; flex: none; border: none; padding: 0; }
.edfw-toggle__knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }

/* Stepper */
.edfw-stepper { display: inline-flex; align-items: center; border: 1px solid var(--edfw-border-2); border-radius: 7px; overflow: hidden; height: 40px; }
.edfw-stepper__btn { width: 38px; height: 100%; border: none; background: #fff; cursor: pointer; font-size: 19px; color: var(--edfw-sub); }
.edfw-stepper__btn:first-child { border-right: 1px solid #e1e1e3; }
.edfw-stepper__btn:last-child { border-left: 1px solid #e1e1e3; }
.edfw-stepper__val { width: 50px; text-align: center; font-size: 15px; font-weight: 700; }

/* Day pills */
.edfw-daypills { display: flex; gap: 8px; flex-wrap: wrap; }
.edfw-pill { width: 42px; height: 42px; border-radius: 9px; font-size: 14px; font-weight: 700; cursor: pointer; border: 1.5px solid #e1e1e3; background: #fff; color: #b0b0b3; }
.edfw-pill.is-active { border-color: var(--edfw-accent); background: var(--edfw-tint); color: var(--edfw-accent-dark); }
.edfw-pill:focus-visible { outline: 2px solid var(--edfw-accent); outline-offset: 2px; }

/* Info banner */
.edfw-info { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding: 11px 14px; background: #f6f1fc; border: 1px solid #e7ddf7; border-radius: 8px; font-size: 12.5px; color: #5b4a78; }

/* Rows for min/max/cutoff */
.edfw-fieldrow { display: flex; gap: 32px; flex-wrap: wrap; }

/* Display: location rows */
.edfw-locrow { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--edfw-line); }
.edfw-locrow:first-of-type { border-top: none; }
.edfw-locrow__title { font-size: 14px; font-weight: 600; }
.edfw-locrow__desc { font-size: 12.5px; color: var(--edfw-muted); margin-top: 2px; }

/* Tag chips */
.edfw-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.edfw-chip { font-size: 12px; font-weight: 600; font-family: ui-monospace, Menlo, monospace; color: var(--edfw-accent-dark); background: var(--edfw-tint); border: 1px solid var(--edfw-tint-border); border-radius: 6px; padding: 5px 9px; cursor: pointer; }

/* Icon picker */
.edfw-iconrow { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.edfw-iconbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 72px; height: 66px; border-radius: 9px; cursor: pointer; border: 1.5px solid #e1e1e3; background: #fff; color: var(--edfw-muted); font-size: 11px; }
.edfw-iconbtn.is-active { border-color: var(--edfw-accent); background: var(--edfw-tint); color: var(--edfw-accent-dark); }

/* Accent swatches */
.edfw-swatches { display: flex; gap: 14px; align-items: center; }
.edfw-swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: none; }

/* Add button (purple secondary) */
.edfw-addbtn { margin-top: 16px; display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--edfw-accent-dark); background: var(--edfw-tint); border: 1px solid var(--edfw-tint-border); border-radius: 7px; padding: 9px 14px; cursor: pointer; }

/* Rule cards */
.edfw-rulecard {
	display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: flex-end;
	padding: 16px; border: 1px solid var(--edfw-border); border-radius: 10px;
	margin-bottom: 12px; background: #fafafa;
}
.edfw-rulefield { display: flex; flex-direction: column; gap: 6px; }
.edfw-rulefield .edfw-field-label { margin-bottom: 0; }
.edfw-rulefield .edfw-select { min-width: 160px; height: 38px; font-size: 13.5px; border-color: var(--edfw-border); }
.edfw-rulefield .edfw-input { height: 38px; font-size: 13.5px; border-color: var(--edfw-border); width: 120px; }
.edfw-rulefield--sm .edfw-input { width: 92px; }
.edfw-rulecard.is-default { background: var(--edfw-tint); border-color: var(--edfw-tint-border); }
.edfw-select--muted { display: flex; align-items: center; color: var(--edfw-muted); background: #f3f3f4; cursor: default; font-style: italic; }
.edfw-select--op { min-width: 74px; width: 74px; flex: none; }
.edfw-empty { color: var(--edfw-muted); font-style: italic; margin: 0 0 12px; }
.edfw-linkbtn { background: none; border: none; padding: 0; margin-top: 12px; color: var(--edfw-accent-dark); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: underline; }
.edfw-linkbtn:hover { color: var(--edfw-accent); }
.edfw-icon-btn { width: 38px; height: 38px; border: 1px solid var(--edfw-border); border-radius: 7px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.edfw-icon-btn--danger { color: #b32d2e; }

/* Holidays */
.edfw-holiday { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--edfw-line); }
.edfw-holiday:first-of-type { border-top: none; }
.edfw-holiday__date { width: 46px; height: 46px; border-radius: 9px; background: #f6f1fc; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; color: var(--edfw-accent-dark); }
.edfw-holiday__mon { font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.edfw-holiday__day { font-size: 17px; font-weight: 700; line-height: 1; }
.edfw-holiday__label { font-size: 14px; font-weight: 600; }
.edfw-holiday__full { font-size: 12.5px; color: var(--edfw-muted); margin-top: 2px; }
.edfw-x { width: 36px; height: 36px; border: none; background: transparent; color: #b0b0b3; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Radios (uninstall) */
.edfw-radio-opt { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-top: 1px solid var(--edfw-line); cursor: pointer; }
.edfw-radio-opt:first-of-type { border-top: none; }
.edfw-radio { width: 19px; height: 19px; border-radius: 50%; flex: none; margin-top: 1px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--edfw-border-2); }
.edfw-radio__dot { width: 9px; height: 9px; border-radius: 50%; }
.edfw-radio-opt__label { font-size: 14px; font-weight: 600; }
.edfw-radio-opt__desc { font-size: 12.5px; color: var(--edfw-muted); margin-top: 2px; }

/* ---- Rule builder internals ---- */
.edfw-rule-reorder { display: flex; flex-direction: column; gap: 4px; align-self: flex-start; }
.edfw-mini { width: 28px; height: 28px; border: 1px solid var(--edfw-border); border-radius: 6px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--edfw-sub); padding: 0; }
.edfw-mini:disabled { opacity: .4; cursor: default; }
.edfw-rule-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.edfw-condrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.edfw-and { font-size: 11px; font-weight: 700; letter-spacing: .5px; color: var(--edfw-accent-dark); background: var(--edfw-tint); border-radius: 5px; padding: 3px 8px; flex: none; }
.edfw-cond-type { min-width: 170px; }
.edfw-cond-op { min-width: 84px; width: 84px; flex: none; }
.edfw-andbtn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--edfw-accent-dark); background: transparent; border: 1px dashed var(--edfw-tint-border); border-radius: 7px; padding: 7px 12px; cursor: pointer; }
.edfw-rule-foot { display: flex; align-items: flex-end; gap: 16px; width: 100%; padding-top: 12px; border-top: 1px solid var(--edfw-line); }

/* ---- Async multi-select (condition value picker) ---- */
.edfw-ams { position: relative; flex: 1; min-width: 220px; }
.edfw-ams__control { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 38px; padding: 4px 10px; border: 1px solid var(--edfw-border-2); border-radius: 7px; background: #fff; cursor: text; }
.edfw-ams__chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--edfw-accent-dark); background: var(--edfw-tint); border: 1px solid var(--edfw-tint-border); border-radius: 6px; padding: 3px 8px; }
.edfw-ams__chip button { border: none; background: none; padding: 0; cursor: pointer; color: inherit; display: flex; }
.edfw-ams__ph { color: var(--edfw-muted); font-size: 13.5px; }
.edfw-ams__search { border: none; outline: none; flex: 1; min-width: 90px; font-size: 13.5px; height: 28px; }
.edfw-ams__menu { position: absolute; z-index: 30; top: calc(100% + 5px); left: 0; right: 0; background: #fff; border: 1px solid var(--edfw-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(31, 41, 55, .12); overflow: hidden; }
.edfw-ams__list { max-height: 220px; overflow-y: auto; }
.edfw-ams__opt { display: block; width: 100%; text-align: left; padding: 9px 13px; border: none; background: #fff; font-size: 13.5px; cursor: pointer; }
.edfw-ams__opt:hover { background: var(--edfw-tint); }
.edfw-ams__more { display: block; width: 100%; padding: 9px 13px; border: none; border-top: 1px solid var(--edfw-line); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--edfw-accent-dark); cursor: pointer; }
.edfw-ams__hint { padding: 9px 13px; font-size: 12.5px; color: var(--edfw-muted); }

/* ---- Holiday inputs ---- */
.edfw-holiday__label-input { flex: 1; min-width: 140px; height: 38px; border: 1px solid var(--edfw-border-2); border-radius: 7px; padding: 0 12px; font-size: 13.5px; }
.edfw-holiday__date-input { height: 38px; border: 1px solid var(--edfw-border-2); border-radius: 7px; padding: 0 10px; font-size: 13.5px; }

/* ---- Live preview ---- */
.edfw-preview { background: #fff; border: 1px solid var(--edfw-border); border-radius: 12px; overflow: hidden; box-shadow: 0 8px 28px rgba(31, 41, 55, .07); }
.edfw-preview__head { padding: 14px 18px; border-bottom: 1px solid var(--edfw-line); display: flex; align-items: center; gap: 9px; }
.edfw-preview__head-title { font-size: 13.5px; font-weight: 700; }
.edfw-preview__chip { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--edfw-sub); background: var(--edfw-line); border-radius: 5px; padding: 3px 8px; }
.edfw-preview__body { padding: 18px; }
.edfw-preview__shot { height: 170px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient( -45deg, #f0f0f1, #f0f0f1 10px, #f6f7f7 10px, #f6f7f7 20px ); }
.edfw-preview__shot span { font-family: ui-monospace, Menlo, monospace; font-size: 12px; letter-spacing: 1px; color: #a7aaad; }
.edfw-preview__stock { margin-top: 14px; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #00854a; }
.edfw-preview__name { font-size: 17px; font-weight: 700; margin-top: 4px; }
.edfw-preview__price { font-size: 16px; font-weight: 700; margin-top: 2px; }
.edfw-preview__cart { margin-top: 14px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; height: 44px; border: none; border-radius: 8px; background: #1d2327; color: #fff; font-size: 14px; font-weight: 600; cursor: default; }
.edfw-preview__widget { margin-top: 16px; display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; border: 1px solid #e7ddf7; background: #faf8fd; border-radius: 10px; }
.edfw-preview__msg { font-size: 13.5px; color: var(--edfw-ink); line-height: 1.45; }
.edfw-preview__count { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; margin-top: 6px; }
.edfw-preview__disabled { margin-top: 16px; padding: 13px 15px; border: 1px dashed var(--edfw-border-2); border-radius: 10px; color: var(--edfw-muted); font-size: 13px; font-style: italic; }
.edfw-preview__foot { margin-top: 12px; font-size: 12px; color: var(--edfw-muted); text-align: center; line-height: 1.6; }

/* ── Add-on settings sections ──────────────────────────────────────────────
   Rendered from the PHP schema (EDFW_Helper::settings_schema). A section is one
   card holding a list of rows, so related add-on options stay grouped instead of
   scattering one card per field.

   These rows deliberately do NOT reuse .edfw-card--row: that is a modifier for a
   card element and carries its own 24px padding, so nesting it inside a card
   indents the row past the card's own title. */
.edfw-srows { margin-top: 16px; }
.edfw-srow {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 14px 0;
	border-top: 1px solid var(--edfw-line);
}
.edfw-srow:first-child { border-top: 0; padding-top: 4px; }
.edfw-srow:last-child { padding-bottom: 2px; }
.edfw-srow__text { flex: 1; min-width: 0; }
.edfw-srow__label { font-size: 13.5px; font-weight: 600; }
.edfw-srow__desc { font-size: 13px; color: var(--edfw-muted); margin-top: 3px; line-height: 1.5; }
.edfw-srow__control { flex: none; display: flex; align-items: center; }
.edfw-srow__control .edfw-input { height: 38px; width: 92px; font-size: 13.5px; border-color: var(--edfw-border); }
.edfw-srow__control .edfw-select { height: 38px; min-width: 170px; font-size: 13.5px; border-color: var(--edfw-border); }
.edfw-srow__control .edfw-input[type="text"] { width: 220px; }

/* A "Pro" (or other add-on) chip next to the section title. */
.edfw-card__title .edfw-chip {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
	color: var(--edfw-accent-dark, #6a4595);
	background: #f3eefb;
	border: 1px solid #e3d8f5;
	vertical-align: middle;
}

@media (max-width: 782px) {
	.edfw-srow { align-items: flex-start; flex-wrap: wrap; }
	.edfw-srow__control { width: 100%; }
}

/* Free-text chip input, for conditions with no enumerable value set (postcodes). */
.edfw-taginput .edfw-ams__control { cursor: text; flex-wrap: wrap; }
.edfw-taginput__field {
	flex: 1;
	min-width: 90px;
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	font-size: 13.5px;
	padding: 2px 0;
	color: inherit;
}
.edfw-taginput__hint { font-size: 12px; color: var(--edfw-muted); margin-top: 5px; }
