/**
 * Cart recommendations — mini cart & cart page.
 */

.shofy-cart-rec {
	--shofy-cart-rec-gap: 12px;
}

.shofy-cart-rec__heading {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 12px;
	color: var(--tp-common-black);
}

/* ── Mini cart ── */
.shofy-cart-rec--mini {
	padding: 16px 0 8px;
	margin-top: 4px;
	border-top: 1px solid var(--tp-border-primary);
}

.shofy-cart-rec--mini .shofy-cart-rec__list {
	display: flex;
	gap: var(--shofy-cart-rec-gap);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	padding-bottom: 4px;
}

.shofy-cart-rec--mini .shofy-cart-rec__list::-webkit-scrollbar {
	height: 4px;
}

.shofy-cart-rec--mini .shofy-cart-rec__list::-webkit-scrollbar-thumb {
	background: var(--tp-border-primary);
	border-radius: 4px;
}

.shofy-cart-rec--mini .shofy-cart-rec__item {
	flex: 0 0 130px;
	min-width: 130px;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	background: var(--tp-common-white);
	border: 1px solid rgba(129, 129, 129, 0.2);
	border-radius: 4px;
	overflow: hidden;
}

.shofy-cart-rec--mini .shofy-cart-rec__thumb {
	flex: 0 0 auto;
	background: #f8f8f8;
}

.shofy-cart-rec--mini .shofy-cart-rec__thumb a {
	display: block;
	line-height: 0;
}

.shofy-cart-rec--mini .shofy-cart-rec__thumb img {
	width: 100%;
	height: 90px;
	object-fit: cover;
	border: 0;
}

.shofy-cart-rec--mini .shofy-cart-rec__body {
	padding: 8px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 4px;
}

.shofy-cart-rec--mini .shofy-cart-rec__title {
	font-size: 12px;
	font-weight: 500;
	line-height: 1.35;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.shofy-cart-rec--mini .shofy-cart-rec__title a {
	color: var(--tp-common-black);
	text-decoration: none;
}

.shofy-cart-rec--mini .shofy-cart-rec__title a:hover {
	color: var(--tp-theme-primary);
}

.shofy-cart-rec--mini .shofy-cart-rec__price {
	font-size: 12px;
	font-weight: 600;
	color: var(--tp-theme-primary);
	line-height: 1.3;
}

.shofy-cart-rec--mini .shofy-cart-rec__price del {
	font-weight: 400;
	color: #999;
	font-size: 11px;
}

.shofy-cart-rec--mini .shofy-cart-rec__price ins {
	text-decoration: none;
}

.shofy-cart-rec--mini .shofy-cart-rec__action {
	margin-top: auto;
	padding-top: 4px;
}

.shofy-cart-rec--mini .shofy-cart-rec__add-btn {
	display: block;
	width: 100%;
	padding: 5px 6px;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	color: var(--tp-common-white);
	background-color: var(--tp-theme-primary);
	border: 1px solid var(--tp-theme-primary);
	border-radius: 3px;
	transition: opacity 0.2s ease;
}

.shofy-cart-rec--mini .shofy-cart-rec__add-btn:hover {
	opacity: 0.88;
	color: var(--tp-common-white);
}

.shofy-cart-rec--mini .shofy-cart-rec__add-btn.loading {
	opacity: 0.65;
	pointer-events: none;
}

/* ── Cart page ── */
.shofy-cart-rec-page-wrap {
	margin-top: 10px;
}

.shofy-cart-rec--page {
	padding: 24px;
	background: var(--tp-common-white);
	border: 1px solid var(--tp-border-primary);
	border-radius: 4px;
}

.shofy-cart-rec--page .shofy-cart-rec__heading {
	font-size: 18px;
	margin-bottom: 20px;
}

.shofy-cart-rec--page .shofy-cart-rec__list {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

.shofy-cart-rec--page .shofy-cart-rec__item {
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(129, 129, 129, 0.2);
	border-radius: 4px;
	overflow: hidden;
	transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.shofy-cart-rec--page .shofy-cart-rec__item:hover {
	border-color: var(--tp-theme-primary);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.shofy-cart-rec--page .shofy-cart-rec__thumb {
	background: #f8f8f8;
}

.shofy-cart-rec--page .shofy-cart-rec__thumb a {
	display: block;
	line-height: 0;
	overflow: hidden;
}

.shofy-cart-rec--page .shofy-cart-rec__thumb img {
	width: 100%;
	height: 180px;
	object-fit: cover;
	border: 0;
	transition: transform 0.35s ease;
}

.shofy-cart-rec--page .shofy-cart-rec__item:hover .shofy-cart-rec__thumb img {
	transform: scale(1.04);
}

.shofy-cart-rec--page .shofy-cart-rec__body {
	padding: 14px 14px 16px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 8px;
}

.shofy-cart-rec--page .shofy-cart-rec__title {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.shofy-cart-rec--page .shofy-cart-rec__title a {
	color: var(--tp-common-black);
	text-decoration: none;
}

.shofy-cart-rec--page .shofy-cart-rec__title a:hover {
	color: var(--tp-theme-primary);
}

.shofy-cart-rec--page .shofy-cart-rec__price {
	font-size: 15px;
	font-weight: 600;
	color: var(--tp-theme-primary);
}

.shofy-cart-rec--page .shofy-cart-rec__price del {
	font-weight: 400;
	color: #999;
	font-size: 13px;
	margin-left: 4px;
}

.shofy-cart-rec--page .shofy-cart-rec__price ins {
	text-decoration: none;
}

.shofy-cart-rec--page .shofy-cart-rec__action {
	margin-top: auto;
}

.shofy-cart-rec--page .shofy-cart-rec__add-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 40px;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	color: var(--tp-common-white);
	background-color: var(--tp-theme-primary);
	border: 1px solid var(--tp-theme-primary);
	border-radius: 4px;
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.shofy-cart-rec--page .shofy-cart-rec__add-btn:hover {
	opacity: 0.9;
	color: var(--tp-common-white);
}

.shofy-cart-rec--page .shofy-cart-rec__add-btn.loading {
	opacity: 0.65;
	pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 1199px) {
	.shofy-cart-rec--page .shofy-cart-rec__list {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 575px) {
	.shofy-cart-rec--page {
		padding: 16px;
	}

	.shofy-cart-rec--page .shofy-cart-rec__list {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.shofy-cart-rec--page .shofy-cart-rec__thumb img {
		height: 130px;
	}

	.shofy-cart-rec--page .shofy-cart-rec__title {
		font-size: 13px;
	}

	.shofy-cart-rec--page .shofy-cart-rec__add-btn {
		min-height: 34px;
		font-size: 12px;
		padding: 6px 10px;
	}
}

/* ── RTL ── */
[dir="rtl"] .shofy-cart-rec--page .shofy-cart-rec__price del {
	margin-left: 0;
	margin-right: 4px;
}
