/*
 * WiredWorkers Shop - cart and quote list buttons in the site header (every page).
 * Same tokens as shop.css; scoped under .wws-lists. Astra mobile header: body.ast-header-break-point.
 */

.wws-lists {
	--wws-green: #78c44b;
	--wws-green-text: #4a7a1f;
	--wws-on-green: #333333;
	--wws-ink: #343a40;
	--wws-muted: #5f6b7a;
	--wws-line: #e5e5e5;
	--wws-surface: #ffffff;
	--wws-surface-alt: #f5f7fa;
	--wws-focus: #78c44b;
	--wws-shadow: 0 0 4px 0 #00000057;

	display: flex;
	align-items: center;
	gap: 4px;
	margin-left: 16px;
	font-family: Montserrat, "Segoe UI", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

.wws-lists[hidden],
.wws-lists [hidden] { display: none !important; }

.wws-lists *,
.wws-lists *::before,
.wws-lists *::after { box-sizing: border-box; }

.wws-lists__item { position: relative; }

/* ------------------------------------------------------------- buttons */
.wws-lists .wws-lists__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	box-shadow: none;
}

.wws-lists .wws-lists__btn:hover,
.wws-lists .is-open .wws-lists__btn { background: rgba( 128, 128, 128, 0.18 ); color: inherit; }

.wws-lists .wws-lists__btn:focus-visible { outline: 2px solid var(--wws-focus); outline-offset: 2px; }

.wws-lists .wws-lists__btn .wws-icon { width: 22px; height: 22px; display: block; }

.wws-lists__count {
	position: absolute;
	top: 2px;
	right: 0;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--wws-green);
	color: var(--wws-on-green);
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

/* --------------------------------------------------------------- panel */
.wws-lists__panel {
	position: absolute;
	top: calc( 100% + 8px );
	right: 0;
	z-index: 1000;
	width: 360px;
	max-width: calc( 100vw - 32px );
	padding: 16px;
	border-radius: 5px;
	background: var(--wws-surface);
	color: var(--wws-ink);
	box-shadow: var(--wws-shadow);
	text-align: left;
}

.wws-lists__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
	font-size: 16px;
	color: var(--wws-ink);
}

.wws-lists .wws-lists__close {
	display: inline-flex;
	width: 32px;
	height: 32px;
	padding: 6px;
	margin: -6px -6px -6px 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var(--wws-muted);
	cursor: pointer;
}

.wws-lists .wws-lists__close:hover { background: var(--wws-surface-alt); color: var(--wws-ink); }
.wws-lists .wws-lists__close .wws-icon { width: 20px; height: 20px; }

.wws-lists .wws-lists__rows {
	max-height: min( 50vh, 360px );
	overflow-y: auto;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wws-lists__row {
	display: grid;
	grid-template-columns: 48px 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 8px 0;
	border-top: 1px solid var(--wws-line);
}

.wws-lists__row:first-child { border-top: 0; }

.wws-lists__thumb {
	width: 48px;
	height: 48px;
	border-radius: 4px;
	background: var(--wws-surface-alt);
	overflow: hidden;
}

.wws-lists__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.wws-lists__body { min-width: 0; display: flex; flex-direction: column; }

.wws-lists .wws-lists__body a {
	color: var(--wws-ink);
	font-weight: 600;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wws-lists .wws-lists__body a:hover { color: var(--wws-green-text); text-decoration: underline; }

.wws-lists__meta { color: var(--wws-muted); font-size: 13px; }

.wws-lists__price { font-weight: 600; white-space: nowrap; font-size: 13px; }

.wws-lists__empty,
.wws-lists__more { padding: 8px 0; color: var(--wws-muted); }

.wws-lists__total {
	display: flex;
	justify-content: flex-end;
	padding-top: 8px;
	margin-top: 4px;
	border-top: 1px solid var(--wws-line);
	font-weight: 700;
	font-size: 15px;
}

.wws-lists__note { margin: 8px 0 12px; color: var(--wws-muted); font-size: 12px; }

.wws-lists__actions { display: flex; gap: 8px; }

.wws-lists .wws-lists__link {
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 12px;
	border: 2px solid var(--wws-green);
	border-radius: 4px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
}

.wws-lists .wws-lists__link--primary { background: var(--wws-green); color: var(--wws-on-green); }
.wws-lists .wws-lists__link--primary:hover { background: #6e9f31; border-color: #6e9f31; color: #ffffff; }
.wws-lists .wws-lists__link--secondary { background: transparent; color: var(--wws-green-text); }
.wws-lists .wws-lists__link--secondary:hover { background: var(--wws-surface-alt); }

/* ------------------------------------------------- no header found: float */
.wws-lists--floating {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 1000;
	margin: 0;
	padding: 2px;
	border-radius: 5px;
	background: #182329;
	color: #ffffff;
}

/* --------------------------------------------- Astra mobile header (<= 921px) */
.ast-header-break-point .wws-lists {
	order: 2;
	margin-left: auto;
	margin-right: 4px;
}

.ast-header-break-point .main-header-bar .ast-mobile-menu-buttons { order: 3; }

.ast-header-break-point .wws-lists__item { position: static; }

.ast-header-break-point .wws-lists__panel {
	position: fixed;
	top: 72px;
	left: 16px;
	right: 16px;
	width: auto;
	max-width: none;
}
