/* ══════════════════════════════════════════
   LALMEK Specifikationer — Frontend
   ══════════════════════════════════════════ */

.lsp {
	margin-bottom: 2.5rem;
}

.lsp__title {
	font-size: 1.3rem;
	font-weight: 700;
	margin-bottom: 0.25rem;
	color: #002242;
	text-transform: none;
}

.lsp__caption {
	font-size: 0.875rem;
	color: #5a6275;
	line-height: 1.5;
	margin-bottom: 1rem;
}

/* ── Verktygsfält ──────────────────── */
.lsp__toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 0.75rem;
	flex-wrap: wrap;
}

/* Sök */
.lsp__search-wrap {
	position: relative;
	flex: 1;
	min-width: 200px;
	max-width: 360px;
}

.lsp__search {
	width: 100%;
	padding: 8px 12px;
	padding-right: 60px;
	border: 1px solid #d5dce6;
	border-radius: 6px;
	font-size: 0.875rem;
	font-family: inherit;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.lsp__search:focus-visible {
	outline: none;
	border-color: #0055A4;
	box-shadow: 0 0 0 3px #0055A4;
}

.lsp__search-count {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.75rem;
	color: #6b7280;
	pointer-events: none;
}

/* PDF-knapp */
.lsp__pdf-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: #0055A4;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
	font-family: inherit;
	white-space: nowrap;
}

.lsp__pdf-btn:hover {
	background: #003d7a;
}

.lsp__pdf-btn:active {
	background: #002242;
}

.lsp__pdf-btn svg {
	flex-shrink: 0;
}

/* ── Tabellwrap ────────────────────── */
.lsp__table-wrap {
	overflow-x: auto;
	border: 1px solid #d5dce6;
	border-radius: 10px;
	background: #fff;
}

/* ── Tabell ────────────────────────── */
.lsp__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.8125rem;
	line-height: 1.4;
	table-layout: auto;
}

/* Header */
.lsp__table thead th {
	background: #002242;
	color: #fff;
	font-weight: 600;
	font-size: 0.6875rem;
	text-transform: none;
	letter-spacing: 0;
	padding: 8px 24px 8px 12px;
	text-align: left;
	border-bottom: none;
	white-space: nowrap;
	position: relative;
	cursor: pointer;
	user-select: none;
	position: sticky;
	top: 0;
	z-index: 2;
	transition: background 0.15s;
}

.lsp__table thead th:hover {
	background: #0a3360;
}

.lsp__table thead th[aria-sort="ascending"],
.lsp__table thead th[aria-sort="descending"] {
	background: #0a3360;
	color: #93c5fd;
}

/* Sorterings-ikon */
.lsp__sort-icon {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.5rem;
	opacity: 0.4;
}

th[aria-sort="ascending"] .lsp__sort-icon::after {
	content: "▲";
	opacity: 1;
}

th[aria-sort="descending"] .lsp__sort-icon::after {
	content: "▼";
	opacity: 1;
}

th[aria-sort="none"] .lsp__sort-icon::after {
	content: "▲▼";
	font-size: 0.5rem;
}

/* Body */
.lsp__table tbody td {
	padding: 7px 12px;
	border-bottom: 1px solid #edf0f4;
	color: #3a3f4b;
	white-space: nowrap;
}

.lsp__table tbody tr:last-child td {
	border-bottom: none;
}

.lsp__table tbody tr:hover td {
	background: #e8f0fa;
}

/* Randiga rader */
.lsp--striped .lsp__table tbody tr:nth-child(even) td {
	background: #f8f9fb;
}

.lsp--striped .lsp__table tbody tr:nth-child(even):hover td {
	background: #e8f0fa;
}

/* Numeriska celler */
.lsp__table td.is-numeric {
	font-variant-numeric: tabular-nums;
}

/* Favoritkolumn */
.lsp__th-fav {
	width: 28px;
	min-width: 28px;
	padding: 8px 4px !important;
	cursor: default !important;
}

.lsp__td-fav {
	width: 28px;
	text-align: center;
	padding: 7px 4px !important;
}

.lsp__fav-dot {
	color: #0055A4;
	font-size: 0.5rem;
	line-height: 1;
}

.lsp__badge {
	display: none;
}

/* Populär rad — ljusblå bakgrund */
.lsp__table tbody tr.is-featured td {
	background: #e8f0fe;
}

.lsp--striped .lsp__table tbody tr.is-featured td {
	background: #e8f0fe;
}

.lsp__table tbody tr.is-featured:hover td {
	background: #dce8fb;
}

/* Offertknapp-kolumn */
.lsp__th-quote {
	width: 140px;
	cursor: default !important;
}

.lsp__td-quote {
	text-align: center;
	white-space: nowrap;
}

.lsp__quote-btn,
.lsp__quote-btn:visited,
.lsp__quote-btn:focus {
	display: inline-block;
	padding: 4px 10px;
	font-size: 0.6875rem;
	font-weight: 600;
	color: #fff !important;
	background: #0055A4;
	border-radius: 5px;
	text-decoration: none !important;
	transition: background 0.15s;
	white-space: nowrap;
}

.lsp__quote-btn:hover {
	background: #003d7a;
	color: #fff !important;
	text-decoration: none !important;
}

/* Fokusindikatorer */
.lsp__table thead th:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

.lsp__pdf-btn:focus-visible,
.lsp__quote-btn:focus-visible {
	outline: 3px solid #0055A4;
	outline-offset: 2px;
}

/* Dolda rader vid sökning */
.lsp__table tbody tr.is-hidden {
	display: none;
}

/* Highlighta matchande text vid sökning */
.lsp__table tbody td mark {
	background: #fef3c7;
	color: inherit;
	padding: 0 1px;
	border-radius: 2px;
}

/* ── Footer ────────────────────────── */
.lsp__footer {
	padding: 8px 14px;
	font-size: 0.75rem;
	color: #6b7280;
	border-top: 1px solid #f0f3f7;
}

/* ── Responsiv ─────────────────────── */
@media (max-width: 640px) {
	.lsp__toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.lsp__search-wrap {
		max-width: none;
	}

	.lsp__pdf-btn {
		align-self: flex-start;
		min-height: 44px;
	}

	.lsp__quote-btn {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}

	.lsp__table thead th,
	.lsp__table tbody td {
		padding: 8px 10px;
	}
}

/* ── Reducerad rörelse ──────────────── */
@media (prefers-reduced-motion: reduce) {
	.lsp__search,
	.lsp__pdf-btn,
	.lsp__quote-btn,
	.lsp__table thead th {
		transition: none;
	}
}

/* ── Dold text (a11y) ──────────────── */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
