/* Sidovarukorg, se ../side-cart.php. Allt gäller bara när panelen är på (klassen wan-cart-on på
   <html>, satt av side-cart.js) eller i kassan/varukorgen i testläget (wan-cart-notices på body). */

.wan-sc-locked,
.wan-sc-locked body {
	overflow: hidden;
}

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

.wan-sc {
	--wan-sc-text: #111;
	--wan-sc-muted: #6b6b6b;
	--wan-sc-line: #e6e6e6;
	--wan-sc-sale: #ba2b00;
	--wan-sc-accent: #111;
	position: fixed;
	inset: 0;
	z-index: 99999;
	font-family: inherit;
	color: var(--wan-sc-text);
}

.wan-sc__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.wan-sc__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(560px, 100vw);
	background: #fff;
	box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
	transform: translateX(100%);
	transition: transform 0.25s ease;
	outline: none;
}

/* Temat stylar aside-element: bredden måste vinna */
.wan-sc aside.wan-sc__panel {
	width: min(560px, 100vw);
	max-width: 100vw;
	margin: 0;
	float: none;
}

.wan-sc.is-open .wan-sc__overlay {
	opacity: 1;
}

.wan-sc.is-open .wan-sc__panel {
	transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
	.wan-sc__overlay,
	.wan-sc__panel {
		transition: none;
	}
}

.wan-sc__panel.is-busy .wan-sc__body,
.wan-sc__panel.is-busy .wan-sc__footer {
	opacity: 0.55;
	pointer-events: none;
}

.wan-sc__header {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 14px 16px;
	border-bottom: 1px solid var(--wan-sc-line);
}

/* Temats rubrikstilar ska inte slå igenom: stark selektor */
.wan-sc .wan-sc__header .wan-sc__title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	text-align: center;
	text-transform: none;
	color: inherit;
}

.wan-sc .wan-sc__header .wan-sc__count {
	font-size: 0.85em;
	font-weight: 400;
}

.wan-sc__close {
	display: inline-flex;
	align-items: center;
	justify-self: start;
	gap: 6px;
	height: 36px;
	padding: 0 4px 0 0;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 500;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}

.wan-sc__toast {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 20px;
	background: #f4f4f4;
	font-size: 0.9rem;
}

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

.wan-sc__toast.is-error {
	background: #fdecea;
	color: #8a1c0f;
}

.wan-sc__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 0 20px;
	-webkit-overflow-scrolling: touch;
}

.wan-sc__loading {
	padding: 40px 0;
	text-align: center;
	color: var(--wan-sc-muted);
}

.wan-sc__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	min-height: 60vh;
	padding: 40px 0;
	text-align: center;
}

.wan-sc__empty-icon {
	color: var(--wan-sc-text);
}

.wan-sc .wan-sc__empty .wan-sc__empty-title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
}

.wan-sc .wan-sc__empty .wan-sc__empty-button {
	width: auto;
	gap: 10px;
	padding: 0 28px;
}

.wan-sc__items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wan-sc__item {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: 18px;
	padding: 22px 0;
	border-bottom: 1px solid var(--wan-sc-line);
}

.wan-sc__item:last-child {
	border-bottom: 0;
}

.wan-sc__media {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.wan-sc__image {
	display: block;
	height: 128px;
	border-radius: 6px;
	background: #f4f4f4;
	overflow: hidden;
}

.wan-sc__image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.wan-sc__info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	font-size: 0.9rem;
}

.wan-sc__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 4px;
}

.wan-sc__name {
	color: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
}

.wan-sc__name:hover {
	text-decoration: underline;
}

.wan-sc__remove {
	flex: 0 0 auto;
	display: inline-flex;
	padding: 4px;
	margin: -4px -4px 0 0;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}

.wan-sc__remove:hover {
	color: var(--wan-sc-muted);
}

.wan-sc__variant {
	color: var(--wan-sc-muted);
}

.wan-sc__variant strong {
	color: var(--wan-sc-text);
	font-weight: 600;
}

.wan-sc__added {
	margin-top: 2px;
	font-size: 0.8rem;
	font-weight: 600;
	color: #1a7f37;
}

.wan-sc__qty {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	align-self: flex-start;
	width: 112px;
	height: 42px;
	padding: 0 4px;
	border: 1px solid #8a8a8a;
	border-radius: 0;
}

.wan-sc__qty-btn {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 0;
	background: none;
	color: inherit;
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
}

.wan-sc__qty-btn:disabled {
	color: #c4c4c4;
	cursor: default;
}

.wan-sc__qty-value {
	min-width: 24px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.wan-sc__price {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	margin-top: auto;
	padding-top: 10px;
	white-space: nowrap;
}

.wan-sc__price-now {
	font-size: 1.1rem;
	font-weight: 600;
}

.wan-sc__price-now.is-sale {
	color: var(--wan-sc-sale);
}

.wan-sc__price-was {
	font-size: 0.85rem;
	color: var(--wan-sc-muted);
}

.wan-sc__link {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.85rem;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.wan-sc__footer {
	padding: 16px 20px calc(15px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--wan-sc-line);
	background: #fff;
}

.wan-sc__footer:empty {
	display: none;
}

.wan-sc__shipping p {
	margin: 0 0 6px;
	font-size: 0.9rem;
}

.wan-sc__bar {
	height: 4px;
	margin-bottom: 14px;
	background: #ececec;
}

.wan-sc__bar-fill {
	height: 100%;
	background: var(--wan-sc-accent);
	transition: width 0.3s ease;
}

.wan-sc__sums {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 12px;
	margin: 0;
	font-size: 0.95rem;
}

.wan-sc__sums dt,
.wan-sc__sums dd {
	margin: 0;
}

.wan-sc__sums dd {
	text-align: right;
}

.wan-sc__total-label,
.wan-sc__total {
	font-weight: 600;
	font-size: 1.05rem;
}

.wan-sc__note {
	margin: 4px 0 14px;
	font-size: 0.8rem;
	color: var(--wan-sc-muted);
}

.wan-sc__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0 18px;
	border: 1px solid var(--wan-sc-accent);
	background: #fff;
	color: var(--wan-sc-accent);
	font: inherit;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
}

.wan-sc__button--primary {
	width: 100%;
	min-height: 50px;
	background: var(--wan-sc-accent);
	color: #fff;
	font-size: 1rem;
}

.wan-sc__button--primary:hover,
.wan-sc__button--primary:focus {
	color: #fff;
	opacity: 0.9;
}


.wan-sc button:focus-visible,
.wan-sc a:focus-visible,
.wan-sc input:focus-visible {
	outline: 2px solid var(--wan-sc-accent);
	outline-offset: 2px;
}

/* Fel från köpknappen på produktsidan */
.wan-sc-form-error {
	flex-basis: 100%;
	margin: 10px 0 0;
	font-size: 0.9rem;
	color: #8a1c0f;
}

.wan-sc-form-error[hidden] {
	display: none;
}

/* ---------------------------------------------------------------- WooCommerce notiser */

.wan-cart-on .woocommerce-message,
.wan-cart-on .woocommerce-info,
.wan-cart-on .woocommerce-error,
.wan-cart-notices .woocommerce-message,
.wan-cart-notices .woocommerce-info,
.wan-cart-notices .woocommerce-error {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin: 0 0 20px;
	padding: 14px 18px;
	border: 1px solid #e3e3e3;
	border-left: 4px solid #111;
	border-radius: 0;
	background: #fff;
	color: #111;
	font-size: 0.95rem;
	line-height: 1.4;
	list-style: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wan-cart-on .woocommerce-error,
.wan-cart-notices .woocommerce-error {
	border-left-color: #ba2b00;
}

.wan-cart-on .woocommerce-message::before,
.wan-cart-on .woocommerce-info::before,
.wan-cart-on .woocommerce-error::before,
.wan-cart-notices .woocommerce-message::before,
.wan-cart-notices .woocommerce-info::before,
.wan-cart-notices .woocommerce-error::before {
	display: none;
}

.wan-cart-on .woocommerce-error li,
.wan-cart-notices .woocommerce-error li {
	margin: 0;
}

.wan-cart-on .woocommerce-message .button,
.wan-cart-on .woocommerce-message a,
.wan-cart-on .woocommerce-info a,
.wan-cart-notices .woocommerce-message .button,
.wan-cart-notices .woocommerce-message a,
.wan-cart-notices .woocommerce-info a {
	order: 2;
	float: none;
	margin: 0 0 0 auto;
	padding: 0;
	border: 0;
	background: none;
	color: #111;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
}
