/**
 * Product comparison: the switch on a card, the bar that collects the
 * selection and the drawer that lays the products out side by side.
 * Tokens come from gueta-header.css, which is always loaded first.
 */

.gueta-compare-switch,
.gueta-compare-switch *,
.gueta-compare-bar,
.gueta-compare-bar *,
.gueta-compare-drawer,
.gueta-compare-drawer * {
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------
 * Switch
 * ---------------------------------------------------------------------- */

.gueta-compare-switch {
	align-items: center;
	cursor: pointer;
	display: inline-flex;
	gap: 8px;
	margin-top: 10px;
	-webkit-user-select: none;
	user-select: none;
}

.gueta-compare-switch__input {
	height: 1px;
	opacity: 0;
	position: absolute;
	width: 1px;
}

.gueta-compare-switch__text {
	color: var(--gueta-muted);
	font-size: 13px;
	white-space: nowrap;
}

.gueta-compare-switch__track {
	background: var(--gueta-rule);
	border-radius: 999px;
	display: block;
	flex: none;
	height: 18px;
	position: relative;
	transition: background-color .25s ease;
	width: 32px;
}

.gueta-compare-switch__thumb {
	background: var(--gueta-paper);
	border-radius: 50%;
	box-shadow: 0 1px 3px rgb(0 0 0 / 25%);
	display: block;
	height: 14px;
	inset-block-start: 2px;
	inset-inline-start: 2px;
	position: absolute;
	transition: transform .25s ease;
	width: 14px;
}

.gueta-compare-switch__input:checked + .gueta-compare-switch__text {
	color: var(--gueta-ink);
	font-weight: 600;
}

.gueta-compare-switch__input:checked ~ .gueta-compare-switch__track {
	background: var(--gueta-ink);
}

/* The thumb travels toward the inline end: 32 - 14 - 2 - 2 = 14px. */
.gueta-compare-switch__input:checked ~ .gueta-compare-switch__track .gueta-compare-switch__thumb {
	transform: translateX(calc(var(--gueta-slide) * 14px));
}

.gueta-compare-switch__input:focus-visible ~ .gueta-compare-switch__track {
	outline: 2px solid var(--gueta-ink);
	outline-offset: 2px;
}

/* The shop's cards wrap everything in one big link; keep the switch out of it. */
.smart-product-card {
	position: relative;
}

.smart-product-card .gueta-compare-switch {
	margin: 0 0 12px;
	padding-inline: 14px;
}

/* -------------------------------------------------------------------------
 * Bar
 * ---------------------------------------------------------------------- */

.gueta-compare-bar {
	background: var(--gueta-paper);
	border-top: 1px solid var(--gueta-rule);
	box-shadow: 0 -6px 20px rgb(0 0 0 / 8%);
	inset: auto 0 0;
	position: fixed;
	transform: translateY(100%);
	transition: transform .3s ease;
	z-index: 85;
}

.gueta-compare-bar[hidden] {
	display: none;
}

.gueta-compare-bar.is-visible {
	transform: translateY(0);
}

.gueta-compare-bar__inner {
	align-items: center;
	display: flex;
	gap: 20px;
	margin: 0 auto;
	max-width: var(--gueta-max);
	padding: 12px var(--gueta-gutter) calc(12px + env(safe-area-inset-bottom));
}

.gueta-compare-bar__count {
	flex: none;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

.gueta-compare-bar__list {
	display: flex;
	flex: 1;
	gap: 10px;
	list-style: none;
	margin: 0;
	min-width: 0;
	overflow-x: auto;
	padding: 0;
	scrollbar-width: none;
}

.gueta-compare-bar__list::-webkit-scrollbar {
	display: none;
}

.gueta-compare-bar__item {
	background: var(--gueta-sand);
	border-radius: 8px;
	flex: none;
	height: 64px;
	overflow: hidden;
	position: relative;
	width: 64px;
}

.gueta-compare-bar__item img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.gueta-compare-bar__item--empty {
	background: none;
	border: 1px dashed var(--gueta-rule);
}

.gueta-compare-bar__remove {
	align-items: center;
	background: var(--gueta-paper);
	border: 0;
	border-radius: 50%;
	box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
	color: var(--gueta-ink);
	cursor: pointer;
	display: flex;
	height: 20px;
	inset-block-start: 3px;
	inset-inline-end: 3px;
	justify-content: center;
	padding: 0;
	position: absolute;
	width: 20px;
}

.gueta-compare-bar__remove svg,
.gueta-compare-table__remove svg {
	fill: none;
	height: 11px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 2;
	width: 11px;
}

.gueta-compare-bar__actions {
	align-items: center;
	display: flex;
	flex: none;
	gap: 12px;
}

.gueta-compare-bar__open {
	background: var(--gueta-ink);
	border: 0;
	border-radius: 8px;
	/* Forced: something on this site repaints it against the dark fill. */
	color: var(--gueta-paper) !important;
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	min-height: 44px;
	padding: 0 28px;
	transition: background-color .2s ease;
}

.gueta-compare-bar__open:hover {
	background: #000;
}

.gueta-compare-bar__open[disabled] {
	cursor: default;
	opacity: .45;
}

.gueta-compare-bar__clear {
	background: none;
	border: 0;
	color: var(--gueta-muted);
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	padding: 6px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gueta-compare-bar__clear:hover {
	color: var(--gueta-ink);
}

/* -------------------------------------------------------------------------
 * Drawer
 * ---------------------------------------------------------------------- */

.gueta-compare-drawer {
	inset: 0;
	position: fixed;
	transition: visibility 0s linear .35s;
	visibility: hidden;
	z-index: 110;
}

.gueta-compare-drawer[hidden] {
	display: none;
}

.gueta-compare-drawer.is-open {
	transition-delay: 0s;
	visibility: visible;
}

.gueta-compare-drawer__backdrop {
	background: rgb(15 15 15 / 45%);
	inset: 0;
	opacity: 0;
	position: absolute;
	transition: opacity .35s ease;
}

.gueta-compare-drawer.is-open .gueta-compare-drawer__backdrop {
	opacity: 1;
}

.gueta-compare-drawer__panel {
	background: var(--gueta-paper);
	display: flex;
	flex-direction: column;
	inset: auto 0 0;
	max-height: 88vh;
	position: absolute;
	transform: translateY(100%);
	transition: transform .38s cubic-bezier(.32, .72, 0, 1);
}

.gueta-compare-drawer.is-open .gueta-compare-drawer__panel {
	transform: translateY(0);
}

.gueta-compare-drawer__head {
	align-items: center;
	border-bottom: 1px solid var(--gueta-rule);
	display: flex;
	flex: none;
	justify-content: space-between;
	margin: 0 auto;
	max-width: var(--gueta-max);
	padding: 16px var(--gueta-gutter);
	width: 100%;
}

.gueta-compare-drawer__title {
	font-size: 19px;
	font-weight: 600;
	margin: 0;
}

.gueta-compare-drawer__body {
	margin: 0 auto;
	max-width: var(--gueta-max);
	overflow: auto;
	padding: 20px var(--gueta-gutter) 32px;
	width: 100%;
}

/* -------------------------------------------------------------------------
 * Table
 * ---------------------------------------------------------------------- */

.gueta-compare-table {
	border-collapse: collapse;
	width: 100%;
}

.gueta-compare-table th,
.gueta-compare-table td {
	border-bottom: 1px solid var(--gueta-rule);
	font-size: 14px;
	padding: 12px 14px;
	text-align: start;
	vertical-align: top;
}

.gueta-compare-table__label {
	color: var(--gueta-soft);
	font-weight: 600;
	white-space: nowrap;
	width: 150px;
}

.gueta-compare-table__product {
	min-width: 180px;
	position: relative;
}

.gueta-compare-table__media {
	background: var(--gueta-sand);
	border-radius: 8px;
	display: block;
	margin-bottom: 10px;
	max-width: 130px;
	overflow: hidden;
}

.gueta-compare-table__media img {
	aspect-ratio: 1;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

.gueta-compare-table__name {
	color: var(--gueta-ink);
	display: block;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
}

.gueta-compare-table__name:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gueta-compare-table__remove {
	align-items: center;
	background: var(--gueta-paper);
	border: 1px solid var(--gueta-rule);
	border-radius: 50%;
	color: var(--gueta-ink);
	cursor: pointer;
	display: flex;
	height: 24px;
	inset-block-start: 8px;
	inset-inline-end: 8px;
	justify-content: center;
	padding: 0;
	position: absolute;
	width: 24px;
	z-index: 2;
}

.gueta-compare-table__price {
	font-size: 16px;
	font-weight: 700;
}

.gueta-compare-table__price del {
	color: var(--gueta-soft);
	font-weight: 400;
	margin-inline-end: 6px;
}

.gueta-compare-table__price ins {
	text-decoration: none;
}

.gueta-compare-table__cta {
	background: var(--gueta-ink);
	border-radius: 8px;
	color: var(--gueta-paper);
	display: inline-block;
	font-size: 14px;
	font-weight: 600;
	padding: 11px 20px;
	text-decoration: none;
}

.gueta-compare-table__cta:hover {
	background: #000;
	color: var(--gueta-paper);
}

@media (max-width: 767px) {
	.gueta-compare-bar__inner {
		flex-wrap: wrap;
		gap: 12px;
	}

	.gueta-compare-bar__list {
		order: 3;
		width: 100%;
	}

	.gueta-compare-bar__actions {
		margin-inline-start: auto;
	}

	.gueta-compare-table__label {
		width: 96px;
	}

	.gueta-compare-table th,
	.gueta-compare-table td {
		padding: 10px 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gueta-compare-bar,
	.gueta-compare-drawer__panel,
	.gueta-compare-drawer__backdrop,
	.gueta-compare-switch__thumb {
		transition-duration: .01ms;
	}
}
