/* WooCommerce Cart Suggestions — popup */

body.wcs-modal-open {
	overflow: hidden;
}

.wcs-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.wcs-modal.is-open {
	display: flex;
}

.wcs-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.55);
	backdrop-filter: blur(2px);
}

.wcs-modal__dialog {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	max-width: 720px;
	width: 100%;
	max-height: 90vh;
	max-height: 90dvh;
	overflow: auto;
	padding: 14px 14px 12px;
	padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
}

.wcs-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	border: none;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #444;
	padding: 4px 8px;
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	-webkit-tap-highlight-color: transparent;
}

.wcs-modal__close:hover {
	color: #000;
}

.wcs-modal__title {
	margin: 0 36px 10px 0;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.25;
}

.wcs-modal__loading {
	padding: 24px 0;
	text-align: center;
	color: #666;
}

.wcs-modal.is-loaded .wcs-modal__loading {
	display: none;
}

.wcs-modal__empty {
	grid-column: 1 / -1;
	text-align: center;
	color: #666;
	margin: 0;
	padding: 8px 0;
}

/* Desktop / tablet: мрежа според брой продукти (до 3), без празни колони */
.wcs-modal__products {
	display: grid;
	gap: 10px;
	margin-bottom: 10px;
	width: 100%;
	box-sizing: border-box;
}

.wcs-modal__products--n1 {
	grid-template-columns: minmax(0, 1fr);
	max-width: 200px;
	margin-left: auto;
	margin-right: auto;
}

.wcs-modal__products--n2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wcs-modal__products--n3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wcs-card {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.wcs-card:hover {
	border-color: #ccc;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.wcs-card__img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	background: #fff;
}

.wcs-card__body {
	padding: 8px 8px 10px;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-height: 0;
}

.wcs-card__name {
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
	color: #1a1a1a;
}

.wcs-card__name a {
	color: inherit;
	text-decoration: none;
}

.wcs-card__name a:hover {
	text-decoration: underline;
}

.wcs-card__price {
	font-size: 0.72rem;
	line-height: 1.35;
	color: #333;
	font-weight: 500;
}

/* Стара / редовна цена: по-светла и зачеркната */
.wcs-card__price del,
.wcs-card__price del .woocommerce-Price-amount {
	color: #9a9a9a !important;
	font-weight: 400 !important;
	font-size: 0.95em;
	text-decoration: line-through;
	opacity: 0.95;
}

.wcs-card__price del {
	margin-right: 4px;
}

/* Промо / текуща цена */
.wcs-card__price ins,
.wcs-card__price ins .woocommerce-Price-amount {
	text-decoration: none !important;
	background: none !important;
	font-weight: 700 !important;
	color: #111 !important;
	font-size: 1.05em;
}

.wcs-card__price ins {
	border: 0;
}

/* Сума по подразбиране (специфичността на del/ins отгоре я презаписва) */
.wcs-card__price .woocommerce-Price-amount {
	font-weight: 700;
	color: #111;
}

.wcs-card__btn {
	width: 100%;
	margin-top: auto;
	flex-shrink: 0;
	text-align: center;
	min-height: 34px;
	padding: 6px 8px !important;
	font-size: 0.72rem !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	border-radius: 6px !important;
	-webkit-tap-highlight-color: transparent;
}

.wcs-card.is-added .wcs-card__btn {
	background: #2e7d32 !important;
	border-color: #2e7d32 !important;
	color: #fff !important;
	pointer-events: none;
}

.wcs-modal__actions {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 8px;
	justify-content: space-between;
	padding: 8px 14px 0;
	margin: 0 -2px;
	border-top: 1px solid #eee;
	box-sizing: border-box;
}

.wcs-modal__actions .wcs-btn {
	flex: 1 1 0;
	min-width: 0;
	text-align: center;
	justify-content: center;
	white-space: normal;
}

.wcs-btn.button {
	border-radius: 6px;
	padding: 8px 12px !important;
	font-weight: 600;
	min-height: 36px;
	font-size: 0.72rem !important;
	line-height: 1.25 !important;
	-webkit-tap-highlight-color: transparent;
}

.wcs-btn--secondary {
	background: #f3f3f3;
	color: #222;
	border: 1px solid #ddd;
}

.wcs-btn--primary {
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Dots: hidden on desktop */
.wcs-modal__dots {
	display: none;
}

/* ——— Mobile: един продукт + хоризонтален слайдър (scroll-snap, без JS библиотеки) ——— */
@media (max-width: 639px) {
	.wcs-modal {
		padding: 0;
		align-items: flex-end;
		justify-content: center;
	}

	/* По-лек фон: без blur на слаби телефони */
	.wcs-modal__backdrop {
		backdrop-filter: none;
		background: rgba(17, 17, 17, 0.5);
	}

	.wcs-modal__dialog {
		border-radius: 16px 16px 0 0;
		max-height: min(92dvh, 100%);
		max-height: min(92vh, 100%);
		width: 100%;
		margin: 0;
		padding: 14px 0 max(14px, env(safe-area-inset-bottom));
		overflow: hidden;
		display: flex;
		flex-direction: column;
		box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
	}

	.wcs-modal__close {
		top: 8px;
		right: 8px;
		z-index: 2;
	}

	.wcs-modal__title {
		font-size: 1.1rem;
		margin: 0 48px 12px 16px;
		line-height: 1.25;
		flex-shrink: 0;
	}

	.wcs-modal__loading {
		padding: 32px 16px;
	}

	/* Слайдър: един пълен слайд, плавно „закопчаване“ */
	.wcs-modal__products {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: stretch;
		gap: 0;
		margin: 0 0 12px;
		padding: 0 16px;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: 16px;
		overscroll-behavior-x: contain;
		touch-action: pan-x;
		scrollbar-width: none;
		-ms-overflow-style: none;
		flex: 1;
		min-height: 0;
		contain: content;
	}

	.wcs-modal__products::-webkit-scrollbar {
		display: none;
		width: 0;
		height: 0;
	}

	.wcs-modal__products .wcs-card {
		flex: 0 0 100%;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		scroll-snap-align: center;
		scroll-snap-stop: always;
		box-sizing: border-box;
	}

	.wcs-modal__products .wcs-card__img {
		aspect-ratio: 1 / 1;
	}

	.wcs-modal__products .wcs-card__body {
		padding: 8px 10px 10px;
	}

	.wcs-modal__products .wcs-card__name {
		font-size: 0.75rem;
	}

	.wcs-modal__products .wcs-card__price {
		font-size: 0.72rem;
	}

	.wcs-modal__products .wcs-card__btn {
		min-height: 36px;
		font-size: 0.72rem !important;
		padding: 7px 10px !important;
	}

	.wcs-modal__empty {
		flex: 0 0 100%;
		width: 100%;
		scroll-snap-align: center;
		padding: 24px 16px;
	}

	.wcs-modal__dots {
		display: flex;
		justify-content: center;
		align-items: center;
		gap: 8px;
		padding: 0 16px 4px;
		flex-shrink: 0;
	}

	.wcs-modal__dot {
		width: 8px;
		height: 8px;
		padding: 0;
		border: none;
		border-radius: 999px;
		background: #cfcfcf;
		cursor: pointer;
		transition: background 0.15s ease, transform 0.15s ease;
		-webkit-tap-highlight-color: transparent;
	}

	.wcs-modal__dot.is-active {
		background: #333;
		transform: scale(1.15);
	}

	.wcs-modal__actions {
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: stretch;
		gap: 8px;
		padding: 10px 16px 0;
		margin-top: auto;
		margin-left: 0;
		margin-right: 0;
		border-top: 1px solid #eee;
	}

	.wcs-modal__actions .wcs-btn {
		flex: 1 1 0;
		width: auto;
		min-width: 0;
		text-align: center;
		justify-content: center;
	}
}

/* Намалено движение */
@media (prefers-reduced-motion: reduce) {
	.wcs-modal__products {
		scroll-behavior: auto;
	}

	.wcs-modal__dot {
		transition: none;
	}
}
