/* 5thAXIS — Suggested Products widget */

.axis5th-sp {
	--axis5th-sp-accent:      var(--e-global-color-primary); /* Primary #DD2828 */
	--axis5th-sp-border:      #e0e0e0;
	--axis5th-sp-border-w:    2px;
	--axis5th-sp-check-size:  26px;
	--axis5th-sp-label-color: #A1A1AA; /* grey */
	--axis5th-sp-title-color: #18181B; /* b-black */
	--axis5th-sp-sep-color:   #A1A1AA; /* grey */
}

/* ── Row ─────────────────────────────────────────────────────────────── */

.axis5th-sp__row {
	display: flex;
	align-items: stretch;
	gap: 0;
}

/* ── "+" separator ───────────────────────────────────────────────────── */

.axis5th-sp__sep {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 2.5rem;
	font-size: 1.25rem;
	font-weight: 400;
	color: var(--axis5th-sp-sep-color);
	user-select: none;
}

/* ── Card ────────────────────────────────────────────────────────────── */

.axis5th-sp__card {
	flex: 1 1 0;
	min-width: 0;
	position: relative;
	display: flex;
	flex-direction: column;
	background: #FAFAFA; /* white */
	border: var(--axis5th-sp-border-w) solid var(--axis5th-sp-border);
	transition: border-color 0.15s ease;
	cursor: pointer;
}

.axis5th-sp__card.is-selected {
	border-color: var(--axis5th-sp-accent);
}

/* ── Checkbox toggle ─────────────────────────────────────────────────── */

.axis5th-sp__toggle {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--axis5th-sp-check-size);
	height: var(--axis5th-sp-check-size);
	background: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
}

/* The visual checkbox box */
.axis5th-sp__check-icon {
	display: block;
	width: var(--axis5th-sp-check-size);
	height: var(--axis5th-sp-check-size);
	border: 2px solid #A1A1AA; /* grey */
	background: #FAFAFA; /* white */
	position: relative;
	transition: background 0.15s ease, border-color 0.15s ease;
}

/* Checkmark via ::after */
.axis5th-sp__check-icon::after {
	content: '';
	display: block;
	position: absolute;
	top: 47%;
	left: 50%;
	width: 10px;
	height: 6px;
	border-left: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: translate(-50%, -60%) rotate(-45deg);
	opacity: 0;
	transition: opacity 0.1s ease;
}

/* Selected state */
.axis5th-sp__card.is-selected .axis5th-sp__check-icon {
	background: var(--axis5th-sp-accent);
	border-color: var(--axis5th-sp-accent);
}

.axis5th-sp__card.is-selected .axis5th-sp__check-icon::after {
	opacity: 1;
}

/* Lock the main card's toggle when already in cart */
.axis5th-sp__card.is-in-cart.is-main .axis5th-sp__toggle {
	cursor: default;
	pointer-events: none;
}

.axis5th-sp__card.is-in-cart.is-main .axis5th-sp__check-icon {
	opacity: 0.65;
}

/* ── Image ───────────────────────────────────────────────────────────── */

.axis5th-sp__img-wrap {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f7f7f7;
}

.axis5th-sp__img-wrap img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	padding: 0.5rem;
	box-sizing: border-box;
}

/* ── Body ────────────────────────────────────────────────────────────── */

.axis5th-sp__body {
	padding: 0.75rem 1rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	flex: 1;
}

.axis5th-sp__label {
	display: block;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--axis5th-sp-label-color);
}

.axis5th-sp__title {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--axis5th-sp-title-color);
	margin: 0;
	line-height: 1.35;
}

.axis5th-sp__title a {
	color: inherit;
	text-decoration: none;
}

.axis5th-sp__title a:hover {
	color: var(--axis5th-sp-accent);
}

.axis5th-sp__price {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--axis5th-sp-title-color);
	margin-top: 0.1rem;
}

.axis5th-sp__price .woocommerce-Price-amount {
	color: inherit;
}

.axis5th-sp__price del {
	opacity: 0.45;
	font-weight: 400;
}

.axis5th-sp__price ins {
	text-decoration: none;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.axis5th-sp__footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 1.5rem;
	margin-top: 1.25rem;
	flex-wrap: wrap;
}

.axis5th-sp__total-wrap {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	font-size: 0.9rem;
}

.axis5th-sp__total-label {
	color: #4B5563; /* Secondary */
}

.axis5th-sp__total-amount {
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--axis5th-sp-title-color);
}

/* ── Add-to-Cart button ──────────────────────────────────────────────── */

.axis5th-sp__add-btn {
	display: inline-flex;
	align-items: center;
	gap: 60px;
	padding: 12px 16px;
	background: var(--e-global-color-primary);
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	border: 1px solid var(--e-global-color-primary);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}

.axis5th-sp__add-btn:hover:not(:disabled) {
	background: transparent;
	color: var(--e-global-color-primary);
}

.axis5th-sp__add-btn:disabled,
.axis5th-sp__add-btn.is-loading {
	opacity: 0.6;
	cursor: default;
	pointer-events: none;
}

.axis5th-sp__add-btn.is-added {
	background: #2a9d58;
	border-color: #2a9d58;
}

.axis5th-sp__cart-icon {
	flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
	.axis5th-sp__row {
		gap: 20px;
		overflow-x: auto;
	}

	.axis5th-sp__card {
		min-width: 200px;
	}

	.axis5th-sp__sep {
		display: none;
	}
}

@media (max-width: 500px) {
	.axis5th-sp__card {
		flex: 1 1 100%;
	}

	.axis5th-sp__footer {
		flex-direction: column;
		align-items: stretch;
	}

	.axis5th-sp__add-btn {
		justify-content: center;
	}
}
