/**
 * editd School Lists — public front end (finder, list page, cart grouping).
 * Uses tokens from edsl-tokens.css. Every rule is prefixed with the root
 * class to beat Elementor Kit styles; buttons declare backgrounds
 * explicitly in every state so Astra/Elementor don't fight us.
 */

/**
 * The browser only hides a [hidden] element automatically when nothing
 * else sets its display property. Several elements below (rows, panels,
 * pills) get an explicit `display: grid`/`flex`/etc. from this same
 * stylesheet, which — being an author rule — beats the browser's default
 * "[hidden] { display: none }" outright. Without this override, JS
 * correctly setting the hidden attribute (on remove, on a collapsed alt
 * panel, on the swapped pill) has no visual effect at all. This rule
 * always wins regardless of what other display value a class sets.
 */
.edsl-finder [hidden],
.edsl-list [hidden],
.edsl-cart-groups [hidden] {
	display: none !important;
}

.edsl-finder,
.edsl-list,
.edsl-cart-groups {
	min-width: 0;
	overflow-x: clip;
	box-sizing: border-box;
}
.edsl-finder *,
.edsl-list *,
.edsl-cart-groups * {
	box-sizing: border-box;
}

/* ==================== Finder ==================== */

.edsl-finder__row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--edsl-space-4);
	align-items: flex-end;
}

.edsl-finder__field {
	flex: 1 1 220px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--edsl-space-1);
}

/* Astra/Elementor Kit both commonly ship a default margin-bottom on bare
   <label>/<select>/<input> tags (the same class of theme bleed-through the
   button hover-reset section further down exists for). That stacks on top
   of .edsl-finder__row's own `gap`, making the three fields look far more
   spaced out than the gap alone accounts for — zero it out explicitly so
   the gap is the only spacing in play. */
.edsl-finder__field label,
.edsl-finder__select,
.edsl-combobox__input {
	margin: 0;
}

.edsl-finder__field label {
	font-family: var(--edsl-font-body);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--edsl-text-muted);
}

.edsl-finder__select,
.edsl-combobox__input {
	width: 100%;
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid var(--edsl-border-2);
	border-radius: var(--edsl-radius-sm);
	background: var(--edsl-surface);
	color: var(--edsl-text);
	font-family: var(--edsl-font-body);
	font-size: 14px;
}
.edsl-finder__select:disabled,
.edsl-combobox__input:disabled {
	background: var(--edsl-surface-2);
	color: var(--edsl-text-soft);
	cursor: not-allowed;
}

.edsl-combobox {
	position: relative;
}
.edsl-combobox__list {
	position: absolute;
	z-index: 20;
	top: 100%;
	left: 0;
	right: 0;
	margin: 4px 0 0;
	padding: 4px 0;
	list-style: none;
	max-height: 260px;
	overflow-y: auto;
	background: var(--edsl-surface);
	border: 1px solid var(--edsl-border-2);
	border-radius: var(--edsl-radius-sm);
	box-shadow: var(--edsl-shadow-card);
}
.edsl-combobox__option {
	padding: 10px 14px;
	cursor: pointer;
	font-size: 14px;
	color: var(--edsl-text-body);
}
.edsl-combobox__option.is-active,
.edsl-combobox__option:hover {
	background: var(--edsl-surface-2);
}

.edsl-finder__submit {
	flex: 0 0 auto;
	white-space: nowrap;
}
.edsl-finder__submit.is-disabled,
.edsl-finder__submit[aria-disabled="true"] {
	background: var(--edsl-surface-3);
	border-color: var(--edsl-border-2);
	color: var(--edsl-text-soft);
	pointer-events: none;
}

.edsl-finder__upload-line {
	margin-top: var(--edsl-space-4);
	font-size: 13px;
	color: var(--edsl-text-muted);
}
.edsl-finder__upload-line a {
	color: var(--edsl-green);
}

.edsl-upload-hint {
	font-family: var(--edsl-font-body);
	font-size: 14px;
	margin-top: 8px;
	color: var(--edsl-text-muted);
}
.edsl-upload-hint__link {
	color: var(--edsl-gold);
	text-decoration: underline;
}
.edsl-upload-hint__link:hover,
.edsl-upload-hint__link:focus {
	color: var(--edsl-green);
}

@media (max-width: 767px) {
	.edsl-finder__row {
		flex-direction: column;
		align-items: stretch;
	}
}

/* ==================== List page ==================== */

.edsl-list__header {
	margin-bottom: var(--edsl-space-8);
}
.edsl-list__title {
	font-size: 34px;
	margin: 0;
}
.edsl-list__rule {
	width: 56px;
	height: 2px;
	background: var(--edsl-gold);
	margin: 12px 0;
}
.edsl-list__helper {
	color: var(--edsl-text-muted);
	font-size: 14px;
	max-width: 640px;
	margin: 0;
}

.edsl-list__body {
	display: flex;
	gap: 32px;
	align-items: flex-start;
}
.edsl-list__items {
	flex: 1 1 68%;
	min-width: 0;
}
.edsl-list__summary {
	flex: 0 0 32%;
	min-width: 0;
	position: sticky;
	top: 24px;
}

@media (max-width: 1024px) {
	.edsl-list__body {
		flex-direction: column;
	}
	.edsl-list__summary {
		position: static;
		width: 100%;
		order: 2;
	}
	.edsl-list__items {
		order: 1;
		width: 100%;
	}
}

.edsl-item-rows {
	list-style: none;
	margin: 0 0 var(--edsl-space-6);
	padding: 0;
}

.edsl-item-row {
	display: grid;
	grid-template-columns: auto 64px 1fr auto auto auto auto;
	align-items: center;
	gap: var(--edsl-space-4);
	padding: var(--edsl-space-4) 0;
	border-bottom: 1px solid var(--edsl-border);
	transition: opacity 0.15s ease;
}
.edsl-item-row--unchecked {
	opacity: 0.55;
}

.edsl-row-thumb img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: var(--edsl-radius-sm);
	display: block;
}

.edsl-row-check input {
	width: 20px;
	height: 20px;
	accent-color: var(--edsl-green);
}

.edsl-row-main {
	min-width: 0;
}
.edsl-row-name {
	color: var(--edsl-text);
	font-weight: 600;
	text-decoration: none;
	display: inline-block;
}
.edsl-row-name:hover {
	color: var(--edsl-gold);
}
.edsl-row-note {
	color: var(--edsl-text-muted);
	font-size: 12px;
	font-style: italic;
	margin-top: 2px;
}
.edsl-row-actions {
	margin-top: 4px;
	display: flex;
	align-items: center;
	gap: var(--edsl-space-3);
	flex-wrap: wrap;
}
/* "View alternatives" and "Select variant" are a matched pair: same link
   look here, and both carry .edsl-alt-trigger so they share its hover/focus
   overrides further down (and in the inline copy in editd-school-lists.php)
   — no separate colour rules needed for the variant button. */
.edsl-view-alts,
.edsl-select-variant {
	background: none;
	border: none;
	padding: 0;
	color: var(--edsl-green-deep);
	text-decoration: underline;
	font-size: 12px;
	cursor: pointer;
}
.edsl-view-alts:hover,
.edsl-select-variant:hover {
	color: var(--edsl-gold);
}

/* Variant + SKU line under a variable-parent row's name. The spans are
   rendered empty (not whitespace) when there is nothing to show, so :empty
   hides them. */
.edsl-row-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 2px var(--edsl-space-3);
	margin-top: 2px;
	font-size: 12px;
	color: var(--edsl-text-muted);
}
.edsl-row-meta[hidden] {
	display: none;
}
.edsl-row-meta span:empty {
	display: none;
}
.edsl-row-variant {
	font-weight: 600;
	color: var(--edsl-text-body);
}

/* Per-row add-to-cart error (a variation that went out of stock after the
   page loaded, etc.) and the banner above the list for a partial add. */
.edsl-row-error {
	margin-top: 4px;
	font-size: 12px;
	font-weight: 600;
	color: var(--edsl-error);
}
.edsl-row-error[hidden] {
	display: none;
}
.edsl-item-row--error {
	background: rgba(140, 47, 47, 0.05);
}
.edsl-list__notice {
	margin: 0 0 var(--edsl-space-4);
	padding: var(--edsl-space-3) var(--edsl-space-4);
	font-size: 14px;
	color: var(--edsl-text);
	background: var(--edsl-surface-3);
	border-left: 3px solid var(--edsl-gold);
	border-radius: var(--edsl-radius-sm);
}
.edsl-list__notice[hidden] {
	display: none;
}
.edsl-list__notice a {
	font-weight: 700;
	color: var(--edsl-green);
}

.edsl-pill {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}
.edsl-pill--error {
	background: rgba(140, 47, 47, 0.1);
	color: var(--edsl-error);
}
.edsl-pill--ok {
	background: rgba(28, 54, 48, 0.08);
	color: var(--edsl-green);
}
.edsl-swapped-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--edsl-surface-2);
	color: var(--edsl-green-deep);
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}
.edsl-swapped-pill .edsl-undo-swap {
	background: none;
	border: none;
	padding: 0;
	text-decoration: underline;
	text-transform: none;
	font-weight: 400;
	font-size: 11px;
	cursor: pointer;
	color: var(--edsl-green-deep);
}

.edsl-alts-modal__body {
	margin-top: var(--edsl-space-2);
}
.edsl-alts-empty {
	color: var(--edsl-text-muted);
	font-size: 14px;
}
.edsl-alts-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.edsl-alts-list__item {
	display: grid;
	grid-template-columns: 40px 1fr auto auto auto;
	grid-template-areas: "thumb name price qty select";
	align-items: center;
	gap: var(--edsl-space-3);
	padding: var(--edsl-space-2) 0;
	min-width: 0;
}
.edsl-alts-list__item + .edsl-alts-list__item {
	border-top: 1px solid var(--edsl-border);
}
.edsl-alts-list__thumb {
	grid-area: thumb;
}
.edsl-alts-list__thumb img {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: var(--edsl-radius-sm);
}
.edsl-alts-list__name {
	grid-area: name;
	min-width: 0;
}
.edsl-alts-list__price {
	grid-area: price;
}
.edsl-row-qty--disabled {
	grid-area: qty;
	opacity: 0.5;
	pointer-events: none;
}
.edsl-alts-list .edsl-alt-select {
	grid-area: select;
}

/* Part 3.6: image + name/price + qty/Select must hold this layout at
   phone width — name/price stack above qty + Select, no horizontal
   scroll — instead of squeezing 5 grid columns into a 328px-wide dialog. */
@media (max-width: 600px) {
	.edsl-alts-list__item {
		grid-template-columns: 40px 1fr;
		grid-template-areas:
			"thumb name"
			"thumb price"
			"qty   select";
		row-gap: 6px;
	}
	.edsl-alts-list .edsl-alt-select {
		justify-self: start;
	}
}

/* ==================== Variant modal ====================
 * "Select variant": same dialog structure as the alternatives modal (the
 * heading picks up Cormorant Garamond from .edsl-modal__header rules
 * above). One line per purchasable variation: thumb, summary + SKU +
 * stock, price, Select. Out-of-stock lines are dimmed and their button
 * disabled; the variation the row already has is marked. */
.edsl-variants-modal__body {
	margin-top: var(--edsl-space-2);
}
.edsl-variants-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.edsl-variants-list__item {
	display: grid;
	grid-template-columns: 48px 1fr auto auto;
	grid-template-areas: "thumb info price select";
	align-items: center;
	gap: var(--edsl-space-3);
	padding: var(--edsl-space-3) 0;
	min-width: 0;
}
.edsl-variants-list__item + .edsl-variants-list__item {
	border-top: 1px solid var(--edsl-border);
}
.edsl-variants-list__item.is-current {
	box-shadow: inset 3px 0 0 var(--edsl-gold);
	padding-left: var(--edsl-space-3);
}
.edsl-variants-list__item.is-unavailable .edsl-variants-list__thumb,
.edsl-variants-list__item.is-unavailable .edsl-variants-list__name,
.edsl-variants-list__item.is-unavailable .edsl-variants-list__price {
	opacity: 0.55;
}
.edsl-variants-list__thumb {
	grid-area: thumb;
}
.edsl-variants-list__thumb img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: var(--edsl-radius-sm);
	display: block;
}
.edsl-variants-list__info {
	grid-area: info;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.edsl-variants-list__name {
	font-weight: 600;
	color: var(--edsl-text);
}
.edsl-variants-list__sku {
	font-size: 12px;
	color: var(--edsl-text-muted);
}
.edsl-variants-list__stock {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--edsl-error);
}
.edsl-variants-list__price {
	grid-area: price;
	white-space: nowrap;
}
.edsl-variants-list .edsl-variant-select {
	grid-area: select;
}
.edsl-variants-list .edsl-variant-select[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Same phone-width treatment as the alternatives list: info stacks above
   price + Select, no horizontal scroll. */
@media (max-width: 600px) {
	.edsl-variants-list__item {
		grid-template-columns: 48px 1fr;
		grid-template-areas:
			"thumb info"
			"thumb price"
			"select select";
		row-gap: 6px;
	}
	.edsl-variants-list .edsl-variant-select {
		justify-self: start;
	}
}

.edsl-row-price,
.edsl-row-total {
	white-space: nowrap;
	text-align: right;
}
.edsl-row-total {
	color: var(--edsl-green);
	font-weight: 600;
}

.edsl-row-qty {
	display: flex;
	align-items: center;
	gap: 4px;
}
.edsl-row-qty button {
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid var(--edsl-border-2);
	background: var(--edsl-surface);
	color: var(--edsl-text);
	border-radius: var(--edsl-radius-sm);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.edsl-row-qty button svg {
	width: 14px;
	height: 14px;
}
.edsl-row-qty input {
	width: 40px;
	text-align: center;
	border: 1px solid var(--edsl-border-2);
	border-radius: var(--edsl-radius-sm);
	padding: 4px;
	font-size: 14px;
}

.edsl-row-remove {
	background: none;
	border: none;
	color: var(--edsl-text-soft);
	cursor: pointer;
	padding: 6px;
	border-radius: var(--edsl-radius-sm);
}
.edsl-row-remove svg {
	width: 18px;
	height: 18px;
}

@media (max-width: 767px) {
	.edsl-item-row {
		grid-template-columns: auto 48px 1fr;
		grid-template-areas:
			"check thumb main"
			". qty qty"
			". price total"
			". remove remove";
		row-gap: var(--edsl-space-2);
	}
	/*
	 * grid-template-areas alone does nothing to a row's actual children —
	 * without an explicit grid-area on each one, they're auto-placed in
	 * DOM order (check, thumb, main, price, qty, total, remove) into the
	 * 3-column grid the areas above imply, landing THREE PER ROW
	 * regardless of the "." placeholders (price/qty/total end up sharing a
	 * row, qty squeezed into the 48px thumb column and spilling into the
	 * next one) — this is what was causing the reported overlap. Each row
	 * child must be pinned to its named area explicitly.
	 */
	.edsl-row-check-wrap {
		grid-area: check;
	}
	.edsl-row-thumb {
		grid-area: thumb;
	}
	.edsl-row-main {
		grid-area: main;
	}
	.edsl-row-qty {
		grid-area: qty;
		justify-self: start;
	}
	.edsl-row-price {
		grid-area: price;
	}
	.edsl-row-total {
		grid-area: total;
	}
	.edsl-row-remove {
		grid-area: remove;
		justify-self: start;
	}

	/* Module B's unmatched-line placeholder row only has thumb + main (no
	   check/qty/price/total/remove) — pin thumb to its usual cell and let
	   main fill the rest of that first row instead of just its one column. */
	.edsl-item-row--unmatched .edsl-row-thumb {
		grid-area: thumb;
	}
	.edsl-item-row--unmatched .edsl-row-main {
		grid-column: 2 / 4;
		grid-row: 1;
	}
}

/* ==================== Summary card ==================== */

.edsl-summary-card {
	display: flex;
	flex-direction: column;
	gap: var(--edsl-space-2);
}
.edsl-summary-card .edsl-eyebrow {
	margin-bottom: var(--edsl-space-2);
}
.edsl-summary__total-label {
	margin: var(--edsl-space-3) 0 0;
	font-size: 13px;
	color: var(--edsl-text-muted);
}
.edsl-summary__total {
	font-family: var(--edsl-font-display);
	font-size: 32px;
	color: var(--edsl-green);
	margin: 0 0 var(--edsl-space-2);
}
.edsl-summary__excluded {
	font-size: 12px;
	color: var(--edsl-text-muted);
	margin: 0 0 var(--edsl-space-3);
}
.edsl-summary-card .edsl-btn-primary,
.edsl-summary-card .edsl-btn-secondary {
	width: 100%;
	text-align: center;
	margin-top: auto;
}
.edsl-copy-confirm {
	text-align: center;
	font-size: 12px;
	color: var(--edsl-green);
	font-weight: 700;
}

.edsl-add-more {
	width: 100%;
	text-align: center;
}

/* ==================== Mobile sticky bar ==================== */

.edsl-list__mobile-bar {
	display: none;
}
@media (max-width: 1024px) {
	.edsl-list__mobile-bar {
		display: flex;
		flex-direction: column;
		gap: var(--edsl-space-2);
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 30;
		background: var(--edsl-surface);
		border-top: 1px solid var(--edsl-border);
		padding: var(--edsl-space-3) var(--edsl-space-4);
		box-shadow: 0 -2px 10px rgba(28, 54, 48, 0.08);
	}
	.edsl-mobile-bar__expand {
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: none;
		border: none;
		width: 100%;
		padding: 0;
		font-family: var(--edsl-font-body);
		color: var(--edsl-text);
	}
	.edsl-mobile-bar__chevron {
		width: 16px;
		height: 16px;
		transition: transform 0.15s ease;
	}
	.edsl-mobile-summary-open .edsl-mobile-bar__chevron {
		transform: rotate(180deg);
	}
	.edsl-mobile-bar__add-all {
		width: 100%;
		text-align: center;
	}
}

/* ==================== Modal (shared component, Part 4) ====================
 *
 * .edsl-modal is both the overlay AND the positioning context — there's no
 * separate backdrop element. It's a fixed, full-viewport flex container
 * that centres .edsl-modal__dialog; a click anywhere in it that isn't
 * inside the dialog is an "overlay click" (see assets/js/edsl-modal.js).
 *
 * z-index 2147483000 is (deliberately, not a typo) about as high as a
 * z-index can practically go — Astra's sticky header and Elementor's
 * sticky/header sections are both fixed-position elements that sites
 * routinely push to very high, sometimes inline, z-index values of their
 * own (this plugin previously used 999999, which some of those setups
 * still beat outright). isolation: isolate pins this value as the ONE
 * number this element and everything inside it is compared against in
 * <body>'s stacking context, so nothing inside the modal can accidentally
 * leak a competing z-index back out. As a second line of defence in case
 * any single site's header still somehow wins, body.edsl-modal-open below
 * also forces that header's z-index to `auto` while a modal is open.
 */

.edsl-modal[hidden] {
	display: none;
}
.edsl-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	isolation: isolate;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow-y: auto;
	padding: var(--edsl-space-4);
	box-sizing: border-box;
	/* The overlay dimming IS this element's own background — see the
	   docblock at the top of edsl-modal.js for why there's no separate
	   backdrop div. !important because a theme/global reset that zeroes
	   out background on bare <div>s would otherwise leave the page behind
	   the modal at full, undimmed brightness. */
	background: rgba(28, 54, 48, 0.6) !important;
}

/*
 * The dialog is a flex column so the header (heading + close button)
 * never scrolls and only .edsl-modal__body does — the close button stays
 * reachable at any scroll position (Part 3). `85dvh`/calc(100dvh - 32px)
 * tracks the *actual* visible viewport on mobile browsers whose UI chrome
 * shrinks/grows the viewport as the page scrolls; the vh version is the
 * fallback for browsers without dvh support and is overridden by the dvh
 * rule wherever it's understood (a browser that doesn't recognise a dvh
 * value ignores that whole declaration and keeps the vh one).
 *
 * position: relative + z-index: 1 keeps the dialog above this element's
 * own overlay background — belt-and-suspenders, since normal paint order
 * already puts a later, in-flow child above its own parent's background,
 * but an explicit stacking position here means that stays true even if
 * something else about the modal's internals changes later.
 */
.edsl-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--edsl-surface-warm);
	border-radius: var(--edsl-radius-lg);
	box-shadow: var(--edsl-shadow-card);
}

/* The dialog's top must clear the wp-admin-bar (fixed, 32px tall — 46px
 * on the mobile layout it switches to below 783px wide) when logged in.
 * Logged-out visitors never get the admin-bar body class, so this never
 * applies to them. */
body.admin-bar .edsl-modal__dialog {
	margin-top: 32px;
}
@media (max-width: 782px) {
	body.admin-bar .edsl-modal__dialog {
		margin-top: 46px;
	}
}

/* Part 3.5: at phone width the dialog gets its own explicit gutter (on
 * top of .edsl-modal's own padding) so heading/close/buttons all sit
 * comfortably inside the screen with no horizontal scroll. */
@media (max-width: 600px) {
	.edsl-modal__dialog {
		width: calc(100% - 32px);
	}
}
.edsl-modal__header {
	flex: 0 0 auto;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--edsl-space-3);
	padding: var(--edsl-space-6) var(--edsl-space-6) 0;
}
.edsl-modal__header .edsl-section-heading,
.edsl-modal__header h2 {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-family: var(--edsl-font-display);
}
.edsl-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: var(--edsl-space-4) var(--edsl-space-6) var(--edsl-space-6);
	/* Reserve the scrollbar's track so content doesn't shift width when a
	   list long enough to scroll appears vs. one that isn't. */
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: rgba(182, 134, 62, 0.5) transparent;
}
.edsl-modal__body::-webkit-scrollbar {
	width: 8px;
}
.edsl-modal__body::-webkit-scrollbar-track {
	background: transparent;
}
.edsl-modal__body::-webkit-scrollbar-thumb {
	background-color: rgba(182, 134, 62, 0.5);
	border-radius: 999px;
}
/*
 * .edsl-btn is a minimal shared base for the small set of buttons this
 * plugin builds as generic "look" + BEM modifier rather than a dedicated
 * class (currently just the modal close X's .edsl-btn--icon) — kept
 * deliberately tiny since .edsl-btn-primary/.edsl-btn-secondary already
 * cover the plugin's other buttons and don't need migrating.
 */
.edsl-btn {
	cursor: pointer;
}
.edsl-btn--icon {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	border-radius: var(--edsl-radius-sm);
	color: var(--edsl-green);
}
.edsl-btn--icon:hover,
.edsl-btn--icon:focus,
.edsl-btn--icon:active {
	color: var(--edsl-gold);
}
.edsl-btn--icon:focus-visible {
	outline: 2px solid var(--edsl-gold);
	outline-offset: 2px;
}

.edsl-modal__close svg {
	width: 20px;
	height: 20px;
	stroke: currentColor; /* belt-and-suspenders alongside edsl_icon()'s own stroke="currentColor"/fill="none" HTML attributes — the X is two <line>s, never a background-color-drawn bar, so it can't be erased by the transparent-background override */
	fill: none;
}

/*
 * Scroll lock while any modal is open — both html and body, since some
 * mobile browsers scroll the outer <html> rather than <body>.
 * --edsl-scrollbar-width is set by edsl-modal.js right before this class
 * is added, measured from the *actual* scrollbar the page just lost, so
 * the page doesn't visibly shift/reflow sideways by that amount the
 * instant the scrollbar disappears.
 */
html.edsl-modal-open,
body.edsl-modal-open {
	overflow: hidden;
}
body.edsl-modal-open {
	padding-right: var(--edsl-scrollbar-width, 0px);
}

/*
 * Safety net for sites whose header/sticky elements still somehow beat
 * .edsl-modal's z-index: 2147483000 (e.g. an inline style set by
 * Elementor/Astra's own JS at a value this stylesheet can't predict).
 * Astra's #masthead and Elementor's header/sticky sections routinely ship
 * their own very high z-index specifically so they always stay above
 * page content; forcing it back to `auto` ONLY while a modal is open (and
 * never otherwise) means the modal's stacking context is compared
 * against nothing higher, without permanently touching the theme's own
 * header behaviour.
 */
body.edsl-modal-open #masthead,
body.edsl-modal-open .elementor-location-header,
body.edsl-modal-open .elementor-sticky--active {
	z-index: auto !important;
}
.edsl-search-input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--edsl-border-2);
	border-radius: var(--edsl-radius-sm);
	font-size: 14px;
	margin-bottom: var(--edsl-space-4);
}
.edsl-search-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.edsl-search-list__item {
	display: grid;
	grid-template-columns: 40px 1fr auto auto;
	align-items: center;
	gap: var(--edsl-space-3);
	padding: var(--edsl-space-2) 0;
	border-bottom: 1px solid var(--edsl-border);
}
.edsl-search-list__thumb img {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: var(--edsl-radius-sm);
}
.edsl-search-noresults {
	color: var(--edsl-text-muted);
	font-size: 14px;
}

/* ==================== Email options modal ====================
 * "Can't find your school list? Email us your list." fallback — mailto:
 * doesn't reliably open anything on a device/browser with no registered
 * mail handler (Gmail/Outlook-in-browser included), so this offers three
 * more ways in plus a copy-to-clipboard reference block. Buttons reuse
 * .edsl-btn-secondary (the plugin's outline button, already covered by
 * the hover-reset above) plus .edsl-btn, stacked full width instead of
 * wrapping inline.
 */
.edsl-email-options__intro {
	color: var(--edsl-text-muted);
	font-size: 14px;
	margin: 0 0 var(--edsl-space-4);
}
.edsl-email-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	margin-bottom: var(--edsl-space-4);
}
/* html body .edsl-email-options .edsl-btn: Astra/Elementor Kit both ship
 * base button rules that set display:inline-block plus their own margin
 * (so buttons sit side by side, wrapping at the container's width) —
 * exactly what turned these four into an uneven two-per-row wrap instead
 * of a stack. The flex column above already fixes the *container*; this
 * beats the theme's per-button inline-block/margin with a selector built
 * from plain tag + class steps rather than !important, since matching
 * (or slightly exceeding) that specificity is enough once Layer 0/1/2
 * above have already dealt with colour/background. */
html body .edsl-email-options .edsl-btn {
	display: block;
	width: 100%;
	margin: 0;
	box-sizing: border-box;
	text-align: center;
}
.edsl-email-template {
	margin: 0;
	padding: var(--edsl-space-4);
	background: var(--edsl-surface-warm);
	border-radius: var(--edsl-radius-lg);
	font-family: var(--edsl-font-body);
	font-size: 14px;
	line-height: 1.6;
	color: var(--edsl-text);
	white-space: pre-line;
}

/* ==================== Button hover reset (Part 4) ====================
 *
 * Astra ships its own global button styles — at rest AND on
 * hover/focus/active — for `button`, `[type="button"]`/`[type="submit"]`
 * and `.ast-custom-button`; Elementor's per-site Kit adds a generated
 * `.elementor-kit-{ID} button`, `[type="button"]`, `.elementor-button`
 * block from the "Global Buttons" setting. Both commonly paint a dark
 * green background (and sometimes a box-shadow/text-shadow) behind button
 * text — not only on hover. Both also tend to use `!important`, which no
 * amount of extra specificity alone can beat.
 *
 * A later attempt replaced this with a blanket `.edsl-root` catch-all
 * (matching every button/link/heading/span/div under any plugin root) —
 * it fixed the three elements Layers 0-2 below don't reach (see the
 * "Targeted hover override" section further down), but its own reach was
 * too broad and it broke other buttons' looks in the process. That
 * catch-all is gone; this section is restored to what it was before it,
 * and is deliberately scoped ONLY to :is(.edsl-app, .edsl-modal) — the
 * finder/list root and modal dialogs — covering every plugin button
 * EXCEPT the three handled by dedicated classes below.
 *
 * Layer 0 (tag-based, rest state) and Layer 1 (tag-based, interactive
 * states) strip the theme/Kit's background/shadow from every bare
 * button/[type=…]/a.button in scope, at rest and on interaction
 * respectively. Layer 2 (class-based, both rest and interactive) then
 * re-applies each plugin button's *own* intended look explicitly. Layer 2
 * always wins over Layers 0/1 on shared properties because a class
 * selector is more specific than a bare tag/attribute one — that
 * ordering is deliberate, not accidental, so don't merge them.
 */

/* Layer 0: neutralise inherited paint at REST. !important is required —
 * see the note above; Astra/Elementor Kit base button styles (not just
 * :hover) can carry their own !important too. */
:is(.edsl-app, .edsl-modal) button,
:is(.edsl-app, .edsl-modal) [type="button"],
:is(.edsl-app, .edsl-modal) [type="submit"],
:is(.edsl-app, .edsl-modal) a.button {
	background-color: transparent !important; /* overrides Astra's base button/.ast-custom-button style and Elementor Kit's .elementor-kit-{ID} button / [type=button] base style */
	background-image: none !important; /* Elementor Kit button styles sometimes add a gradient background-image at rest */
	box-shadow: none !important; /* Elementor Kit button styles sometimes add a box-shadow at rest */
	text-shadow: none !important; /* Astra sometimes adds a text-shadow on its base button style */
}

/* Layer 1: neutralise inherited paint on hover/focus/active. !important is
 * required — see the note above about Astra's button:hover/
 * .ast-custom-button:hover and Elementor Kit's .elementor-kit-{ID}
 * button:hover / [type="button"]:hover / .elementor-button:hover, both of
 * which can themselves carry !important. */
:is(.edsl-app, .edsl-modal) button:hover,
:is(.edsl-app, .edsl-modal) button:focus,
:is(.edsl-app, .edsl-modal) button:focus-visible,
:is(.edsl-app, .edsl-modal) button:active,
:is(.edsl-app, .edsl-modal) [type="button"]:hover,
:is(.edsl-app, .edsl-modal) [type="button"]:focus,
:is(.edsl-app, .edsl-modal) [type="button"]:focus-visible,
:is(.edsl-app, .edsl-modal) [type="button"]:active,
:is(.edsl-app, .edsl-modal) [type="submit"]:hover,
:is(.edsl-app, .edsl-modal) [type="submit"]:focus,
:is(.edsl-app, .edsl-modal) [type="submit"]:focus-visible,
:is(.edsl-app, .edsl-modal) [type="submit"]:active,
:is(.edsl-app, .edsl-modal) a.button:hover,
:is(.edsl-app, .edsl-modal) a.button:focus,
:is(.edsl-app, .edsl-modal) a.button:focus-visible,
:is(.edsl-app, .edsl-modal) a.button:active,
:is(.edsl-app, .edsl-modal) button:hover span,
:is(.edsl-app, .edsl-modal) button:focus span,
:is(.edsl-app, .edsl-modal) button:active span,
:is(.edsl-app, .edsl-modal) [type="button"]:hover span,
:is(.edsl-app, .edsl-modal) [type="button"]:focus span,
:is(.edsl-app, .edsl-modal) [type="button"]:active span {
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

/* Layer 2a: solid buttons ("Add all to cart", "See List", the mobile bar's
 * add-all) — keep their own background at rest, shift to gold on
 * hover/focus/active only, no theme green block behind the text either
 * way. */
:is(.edsl-app, .edsl-modal) .edsl-btn-primary {
	background-color: var(--edsl-green) !important; /* protects the button's own rest-state background from Layer 0 above */
	border-color: var(--edsl-green) !important;
	color: var(--edsl-text-invert) !important;
}
:is(.edsl-app, .edsl-modal) .edsl-btn-primary:hover,
:is(.edsl-app, .edsl-modal) .edsl-btn-primary:focus,
:is(.edsl-app, .edsl-modal) .edsl-btn-primary:focus-visible,
:is(.edsl-app, .edsl-modal) .edsl-btn-primary:active {
	background-color: var(--edsl-gold) !important; /* overrides the same Astra/Elementor Kit button:hover background as Layer 1 — Layer 1 alone would leave it transparent, not gold */
	border-color: var(--edsl-gold) !important;
	color: var(--edsl-text-invert) !important;
}

/* Layer 2b: outline buttons ("Add more products", "Copy share link",
 * "Select", the search results' "Add", the email-options modal's four
 * buttons) — background stays transparent at rest and on hover,
 * border/text green at rest, gold on hover. */
:is(.edsl-app, .edsl-modal) .edsl-btn-secondary {
	background-color: transparent !important;
	border-color: var(--edsl-green) !important;
	color: var(--edsl-green) !important;
}
:is(.edsl-app, .edsl-modal) .edsl-btn-secondary:hover,
:is(.edsl-app, .edsl-modal) .edsl-btn-secondary:focus,
:is(.edsl-app, .edsl-modal) .edsl-btn-secondary:focus-visible,
:is(.edsl-app, .edsl-modal) .edsl-btn-secondary:active {
	background-color: transparent !important;
	border-color: var(--edsl-gold) !important;
	color: var(--edsl-gold) !important;
}

/* Layer 2c: icon buttons — qty +/- and trash/remove ONLY. The modal close
 * X used to share this group via .edsl-btn--icon; it now has its own,
 * stronger, dedicated rule in the "Targeted hover override" section
 * below instead (that's the element the catch-all was papering over a
 * cascade loss for), so it's deliberately not listed here any more. */
:is(.edsl-app, .edsl-modal) .edsl-row-qty button,
:is(.edsl-app, .edsl-modal) .edsl-row-remove {
	background-color: transparent !important;
	border-color: var(--edsl-green) !important; /* no-op on .edsl-row-remove, which has no border, but keeps this one rule shared */
	color: var(--edsl-green) !important;
}
:is(.edsl-app, .edsl-modal) .edsl-row-qty button:hover,
:is(.edsl-app, .edsl-modal) .edsl-row-qty button:focus,
:is(.edsl-app, .edsl-modal) .edsl-row-qty button:focus-visible,
:is(.edsl-app, .edsl-modal) .edsl-row-qty button:active,
:is(.edsl-app, .edsl-modal) .edsl-row-remove:hover,
:is(.edsl-app, .edsl-modal) .edsl-row-remove:focus,
:is(.edsl-app, .edsl-modal) .edsl-row-remove:focus-visible,
:is(.edsl-app, .edsl-modal) .edsl-row-remove:active {
	background-color: transparent !important;
	border-color: var(--edsl-gold) !important;
	color: var(--edsl-gold) !important;
}

/* Layer 2d: the mailto "Email us your list" line ONLY. "View
 * alternatives" used to share this group via .edsl-view-alts; it now has
 * its own dedicated .edsl-alt-trigger rule below instead, for the same
 * reason as the modal close X above. */
:is(.edsl-app, .edsl-modal) .edsl-upload-hint__link,
:is(.edsl-app, .edsl-modal) .edsl-upload-hint__link:hover,
:is(.edsl-app, .edsl-modal) .edsl-upload-hint__link:focus {
	background-color: transparent !important;
}

/* Keyboard focus stays visible on every plugin button/link, regardless of
 * category. Astra's own reset commonly ships `*:focus{outline:none}` (or
 * the same with !important) to remove the browser default outline — the
 * !important here is needed to survive that on sites where it's used. */
:is(.edsl-app, .edsl-modal) button:focus-visible,
:is(.edsl-app, .edsl-modal) [type="button"]:focus-visible,
:is(.edsl-app, .edsl-modal) [type="submit"]:focus-visible,
:is(.edsl-app, .edsl-modal) a.button:focus-visible,
:is(.edsl-app, .edsl-modal) a:focus-visible {
	outline: 2px solid var(--edsl-gold) !important;
	outline-offset: 2px;
}

/* ==================== Targeted hover override (three known elements) ====================
 *
 * Only these three elements ever actually showed the theme's/Elementor
 * Kit's/WooCommerce's dark-green hover background in production, and
 * Layers 0-2 above (scoped to :is(.edsl-app, .edsl-modal)) didn't
 * reliably win the cascade for them specifically:
 *   1. The cart page's list-group accordion header/title
 *      (.edsl-cart-group__toggle — .edsl-cart-groups, unlike .edsl-app/
 *      .edsl-modal, was never in Layers 0-2's scope at all).
 *   2. "View alternatives" under each product on the list page
 *      (.edsl-alt-trigger — added alongside the existing .edsl-view-alts).
 *   3. The modal close X, in all three plugin modals
 *      (.edsl-modal__close — already the button's only class beyond
 *      .edsl-btn/.edsl-btn--icon).
 *
 * Each gets its own selector, doubled on itself (.foo.foo) plus an
 * `html body` prefix, rather than relying on any ancestor scope class —
 * (0,4,1)+ specificity, comfortably past:
 *   - Elementor Kit: `.elementor-kit-{ID} button:hover` — (0,2,1)
 *   - Astra: `button:hover` — (0,1,1)
 *   - WooCommerce: `.woocommerce button.button:hover` — (0,2,1)
 * `!important` covers any of those that also carry it (Elementor's
 * Global Buttons output commonly does).
 *
 * This block is duplicated, verbatim, as an inline <style> printed right
 * after this file via wp_add_inline_style( 'edsl-public', ... ) — see
 * edsl_get_hover_override_inline_css() in editd-school-lists.php — as a
 * safety net against a minify/combine caching plugin reordering enqueued
 * files. Keep both in sync by hand if this section changes.
 */
html body .edsl-cart-group__toggle.edsl-cart-group__toggle,
html body .edsl-cart-group__toggle.edsl-cart-group__toggle:hover,
html body .edsl-cart-group__toggle.edsl-cart-group__toggle:focus,
html body .edsl-cart-group__toggle.edsl-cart-group__toggle:focus-visible,
html body .edsl-cart-group__toggle.edsl-cart-group__toggle:active,
html body .edsl-alt-trigger.edsl-alt-trigger,
html body .edsl-alt-trigger.edsl-alt-trigger:hover,
html body .edsl-alt-trigger.edsl-alt-trigger:focus,
html body .edsl-alt-trigger.edsl-alt-trigger:focus-visible,
html body .edsl-alt-trigger.edsl-alt-trigger:active,
html body .edsl-modal__close.edsl-modal__close,
html body .edsl-modal__close.edsl-modal__close:hover,
html body .edsl-modal__close.edsl-modal__close:focus,
html body .edsl-modal__close.edsl-modal__close:focus-visible,
html body .edsl-modal__close.edsl-modal__close:active {
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

/* Cart accordion toggle: title text keeps its resting colour at rest AND
 * on hover/focus (title + chevron shift to gold together, below); the
 * bar's own light background lives on .edsl-group-header (the parent),
 * never on the toggle itself, so the transparent override above never
 * removes it. Meta text ("3 ITEMS · R3 735,20") is deliberately given no
 * colour rule anywhere in this file — it simply keeps whatever
 * .edsl-group-header__meta already sets, in every state. */
html body .edsl-cart-group__toggle.edsl-cart-group__toggle {
	color: var(--edsl-text) !important;
}
html body .edsl-cart-group__toggle.edsl-cart-group__toggle:hover .edsl-group-header__label,
html body .edsl-cart-group__toggle.edsl-cart-group__toggle:focus .edsl-group-header__label,
html body .edsl-cart-group__toggle.edsl-cart-group__toggle:hover .edsl-group-header__chevron,
html body .edsl-cart-group__toggle.edsl-cart-group__toggle:focus .edsl-group-header__chevron {
	color: var(--edsl-gold) !important;
}

/* "View alternatives": gold + underline at rest, green on hover/focus,
 * no background ever. */
html body .edsl-alt-trigger.edsl-alt-trigger {
	color: var(--edsl-gold) !important;
	text-decoration: underline;
}
html body .edsl-alt-trigger.edsl-alt-trigger:hover,
html body .edsl-alt-trigger.edsl-alt-trigger:focus,
html body .edsl-alt-trigger.edsl-alt-trigger:focus-visible,
html body .edsl-alt-trigger.edsl-alt-trigger:active {
	color: var(--edsl-green) !important;
}

/* Modal close X: dark green icon at rest, gold on hover/focus. The icon
 * itself is an inline SVG (edsl_icon('close'), stroke="currentColor") —
 * never background-color-drawn bars — so it can never be erased by the
 * transparent-background override above; only `color` needs setting
 * here for the icon to change (currentColor picks it up automatically). */
html body .edsl-modal__close.edsl-modal__close {
	color: var(--edsl-green) !important;
}
html body .edsl-modal__close.edsl-modal__close:hover,
html body .edsl-modal__close.edsl-modal__close:focus,
html body .edsl-modal__close.edsl-modal__close:focus-visible,
html body .edsl-modal__close.edsl-modal__close:active {
	color: var(--edsl-gold) !important;
}

html body .edsl-cart-group__toggle.edsl-cart-group__toggle:focus-visible,
html body .edsl-alt-trigger.edsl-alt-trigger:focus-visible,
html body .edsl-modal__close.edsl-modal__close:focus-visible {
	outline: 2px solid var(--edsl-gold) !important;
	outline-offset: 2px;
}

/* ==================== Cart grouping ==================== */

.edsl-cart-groups .edsl-group-header-row td {
	padding: 0;
	border: none;
}
.edsl-group-header {
	display: flex;
	align-items: center;
	gap: var(--edsl-space-3);
	background: var(--edsl-surface-1);
	border: 1px solid var(--edsl-border);
	border-radius: var(--edsl-radius);
	padding: 16px;
	margin: var(--edsl-space-4) 0 var(--edsl-space-2);
}
.edsl-group-toggle {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: var(--edsl-space-3);
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
	font-family: var(--edsl-font-body);
	color: var(--edsl-text);
	padding: 0;
	min-width: 0;
}
.edsl-group-header__chevron {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	transition: transform 0.15s ease;
}
.edsl-group-toggle[aria-expanded="false"] .edsl-group-header__chevron {
	transform: rotate(-90deg);
}
.edsl-group-header__label {
	font-weight: 700;
}
.edsl-group-header__meta {
	color: var(--edsl-text-muted);
	font-size: 13px;
}
.edsl-remove-group {
	flex: 0 0 auto;
	background: transparent;
	border: 1px solid var(--edsl-error);
	color: var(--edsl-error);
	border-radius: var(--edsl-radius-sm);
	padding: 8px 14px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
}
.edsl-remove-group:hover,
.edsl-remove-group:focus,
.edsl-remove-group:focus-visible {
	background: var(--edsl-error);
	color: #fff;
}

/*
 * The group header title (chevron + label + "N items · Rxxx") is itself a
 * flex row inside .edsl-group-toggle, and neither it nor its label/meta
 * spans had a min-width/wrap allowance — on a narrow viewport a longer
 * list label had nowhere to shrink to and just overflowed the toggle,
 * overlapping "Remove this list" beside it. Wrapping the toggle's own
 * contents, and letting both rows stack on very narrow phones, keeps the
 * title and the remove button from ever sharing the same space.
 */
.edsl-group-toggle {
	flex-wrap: wrap;
	row-gap: 2px;
}
.edsl-group-header__label,
.edsl-group-header__meta {
	min-width: 0;
	overflow-wrap: break-word;
}
@media (max-width: 480px) {
	.edsl-group-header {
		flex-wrap: wrap;
		row-gap: var(--edsl-space-2);
	}
	.edsl-group-toggle {
		flex: 1 1 100%;
	}
	.edsl-remove-group {
		flex: 1 1 100%;
	}
}
