/* Storleksguide, se includes/size-guide/size-guide.php */

/* Rubrikraden "Storlek ... Storleksguide" (th.label är display: block i temat) */
.wan-sg-labelrow {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
}

.wan-sg-link {
	padding: 0;
	border: 0;
	background: none;
	color: #000;
	font: inherit;
	font-size: 14px;
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.wan-sg-link:hover {
	text-decoration-thickness: 2px;
}

.wan-sg-link:focus-visible,
.wan-sg__close:focus-visible,
.wan-sg__tab:focus-visible,
.wan-sg__scroll:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
}

html.wan-sg-open,
html.wan-sg-open body {
	overflow: hidden;
}

/* Popup */
/* Under cookie-bannern (WebToffee, z-index 9999999) men över temat och menyn */
.wan-sg {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.wan-sg[hidden] {
	display: none;
}

.wan-sg__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.wan-sg__dialog {
	position: relative;
	width: 100%;
	max-width: 760px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 28px 28px;
	background: #fff;
	color: #000;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.wan-sg__dialog:focus {
	outline: none;
}

/* Rubriken med stängknappen följer med vid scroll, så krysset alltid syns */
.wan-sg__header {
	position: sticky;
	top: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0 -28px 8px;
	padding: 18px 28px 10px;
	background: #fff;
}

.wan-sg__title {
	margin: 0;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.2;
}

.wan-sg__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-right: -8px;
	padding: 0;
	border: 0;
	background: none;
	color: #000;
	cursor: pointer;
}

.wan-sg__intro {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.5;
	color: #444;
}

/* Flikar */
.wan-sg__tabs {
	display: flex;
	gap: 0;
	margin-bottom: 18px;
	border-bottom: 1px solid #d0d0d0;
}

.wan-sg__tab {
	margin: 0 0 -1px;
	padding: 10px 18px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: none;
	color: #575757;
	font: inherit;
	font-size: 15px;
	cursor: pointer;
}

.wan-sg__tab[aria-selected="true"] {
	border-bottom-color: #000;
	color: #000;
	font-weight: 500;
}

.wan-sg__table-title {
	margin: 18px 0 8px;
	font-size: 16px;
	font-weight: 500;
}

.wan-sg__panel > .wan-sg__table-title:first-child {
	margin-top: 0;
}

/* Tabeller med horisontell scroll på smala skärmar */
.wan-sg__scroll {
	position: relative;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 8px;
}

.wan-sg__table {
	width: 100%;
	min-width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 14px;
	white-space: nowrap;
}

.wan-sg__table th,
.wan-sg__table td {
	padding: 9px 12px;
	border: 1px solid #e0e0e0;
	text-align: center;
	vertical-align: middle;
}

.wan-sg__table thead th {
	background: #f3f3f3;
	font-weight: 500;
}

.wan-sg__table tbody th {
	font-weight: 400;
	text-align: left;
}

/* Första kolumnen ligger kvar vid scroll */
.wan-sg__table tr > :first-child {
	position: sticky;
	left: 0;
	z-index: 1;
	background: #fff;
	text-align: left;
}

.wan-sg__table thead tr > :first-child {
	background: #f3f3f3;
}

.wan-sg__age {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: #666;
}

.wan-sg__swipe {
	display: none;
	margin: 0 0 8px;
	font-size: 12px;
	color: #666;
}

.wan-sg__panel.is-scrollable .wan-sg__swipe {
	display: block;
}

.wan-sg__swipe::after {
	content: " \2192";
}

/* Så mäter du */
.wan-sg__howto {
	display: flex;
	align-items: flex-start;
	gap: 24px;
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid #e0e0e0;
}

.wan-sg__figure {
	flex: 0 0 130px;
	width: 130px;
	height: auto;
}

.wan-sg__steps {
	margin: 0;
	font-size: 14px;
	line-height: 1.45;
}

.wan-sg__steps dt {
	margin-top: 8px;
	font-weight: 500;
}

.wan-sg__steps dt:first-child {
	margin-top: 0;
}

.wan-sg__steps dd {
	margin: 0;
	color: #444;
}

/* Mobil: helskärm. Ingen vh - 100vh är större än den synliga ytan när
   adressfältet visas, vilket sköt upp rubriken och krysset utanför skärmen.
   position: fixed + inset: 0 följer den synliga ytan. */
@media (max-width: 640px) {
	.wan-sg {
		align-items: stretch;
		padding: 0;
	}

	.wan-sg__dialog {
		max-width: none;
		height: 100%;
		max-height: none;
		padding: 0 16px 24px;
		padding-bottom: calc(24px + env(safe-area-inset-bottom));
		box-shadow: none;
	}

	.wan-sg__header {
		margin: 0 -16px 8px;
		padding: 12px 16px 8px;
		padding-top: calc(12px + env(safe-area-inset-top));
		border-bottom: 1px solid #e0e0e0;
	}

	.wan-sg__title {
		font-size: 19px;
	}

	.wan-sg__tab {
		flex: 1 1 0;
		padding: 10px 8px;
	}

	.wan-sg__table th,
	.wan-sg__table td {
		padding: 8px 10px;
	}

	.wan-sg__figure {
		flex-basis: 96px;
		width: 96px;
	}

	.wan-sg__howto {
		gap: 16px;
	}
}
