/**
 * Bleevn — Custom Special Deals Section (Dynamic)
 * ضعه في: /wp-content/themes/{child-theme}/assets/bleevn-deal.css
 */

/* ===== SECTION WRAPPER + HEADING ===== */
.bleevn-deals-section {
	--navy: #2f435f;
	--navy-dark: #24344b;
	--sand: #f4eee3;
	--rust: #a45132;
	--rust-bg: #f4e7df;
	--ink: #2d2d2d;
	--muted: #777;
	--line: #eaeaea;

	max-width: 1180px;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: inherit;
	color: var(--ink);
}
.bleevn-deals-section *,
.bleevn-deals-section *::before,
.bleevn-deals-section *::after { box-sizing: border-box; }

.bleevn-deals-head {
	text-align: center;
	padding: 0 16px;
	margin-bottom: 22px;
}
.bleevn-deals-head__title {
	margin: 0 0 7px !important;
	font-size: 30px !important;
	line-height: 1.25 !important;
	font-weight: 700 !important;
	color: var(--ink) !important;
	letter-spacing: -.01em;
}
.bleevn-deals-head__sub {
	margin: 0 !important;
	font-size: 14px !important;
	line-height: 1.5 !important;
	color: #7a7a7a !important;
	font-weight: 500 !important;
}

.bleevn-deals {
	--navy: #2f435f;
	--navy-dark: #24344b;
	--sand: #f4eee3;
	--rust: #a45132;
	--rust-bg: #f4e7df;
	--ink: #2d2d2d;
	--muted: #777;
	--line: #eaeaea;

	display: flex;
	gap: 20px;
	align-items: flex-start;
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 16px;
	box-sizing: border-box;
	font-family: inherit;
	color: var(--ink);
}
.bleevn-deals *, .bleevn-deals *::before, .bleevn-deals *::after { box-sizing: border-box; }
.bleevn-deals button { font-family: inherit; -webkit-appearance: none; appearance: none; }

/* العمود البارز */
.bleevn-deals__main { flex: 1 1 auto; min-width: 0; width: 100%; transition: opacity .15s ease; }

/* قائمة الكروت الجانبية */
.bleevn-deals__list {
	flex: 0 0 280px;
	width: 280px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-self: flex-start;
	padding-right: 4px;
}
.bleevn-deals__card {
	position: relative;
	display: flex !important;
	flex: 0 0 auto;
	gap: 0;
	align-items: stretch;
	width: 100%;
	min-width: 0;
	height: 130px;
	margin: 0;
	padding: 0;
	background: #fff !important;
	border: 1.5px solid var(--line);
	border-radius: 14px;
	overflow: hidden;
	cursor: pointer;
	text-align: left;
	box-sizing: border-box;
	box-shadow: none;
	transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.bleevn-deals__card::before {
	content: "";
	position: absolute;
	left: 0; top: 0; bottom: 0;
	width: 4px;
	background: var(--navy);
	opacity: 0;
	transition: opacity .2s ease;
	z-index: 2;
}
.bleevn-deals__card:hover {
	background: #fff !important;
	color: var(--ink) !important;
	border-color: #cfd6df;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.bleevn-deals__card:focus,
.bleevn-deals__card:active,
.bleevn-deals__card:focus-visible {
	background: #fff !important;
	color: var(--ink) !important;
}
.bleevn-deals__card.is-active {
	background: #fff !important;
	border-color: var(--navy);
	box-shadow: 0 6px 18px rgba(47, 67, 95, .14);
}
.bleevn-deals__card.is-active::before { opacity: 1; }

/* ضمان قراءة النص في كل الحالات */
.bleevn-deals__card:hover .bleevn-deals__card-name,
.bleevn-deals__card.is-active .bleevn-deals__card-name { color: var(--ink) !important; }
.bleevn-deals__card:hover .bleevn-deals__card-price b,
.bleevn-deals__card.is-active .bleevn-deals__card-price b { color: var(--navy) !important; }
.bleevn-deals__card:hover .bleevn-deals__card-left,
.bleevn-deals__card.is-active .bleevn-deals__card-left { color: var(--rust) !important; }

.bleevn-deals__card-img {
	position: relative;
	display: block;
	flex: 0 0 96px;
	width: 96px;
	align-self: stretch;
	overflow: hidden;
	background: #eceae4;
}
.bleevn-deals__card-img img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	display: block;
	margin: 0;
	border-radius: 0;
}
.bleevn-deals__card-off {
	position: absolute;
	top: 7px;
	left: 7px;
	display: inline-block;
	background: var(--rust);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	padding: 3px 6px;
	border-radius: 5px;
	letter-spacing: .02em;
	z-index: 3;
}
.bleevn-deals__card-info {
	display: flex !important;
	flex: 1 1 auto;
	min-width: 0;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	padding: 14px 14px 14px 16px;
}
.bleevn-deals__card-name {
	display: -webkit-box;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink);
	line-height: 1.4;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.bleevn-deals__card-price {
	display: flex !important;
	align-items: baseline;
	gap: 7px;
}
.bleevn-deals__card-price b { font-size: 16px; font-weight: 700; color: var(--navy); }
.bleevn-deals__card-price del { font-size: 11px; color: #b8b8b8; }
.bleevn-deals__card-left {
	display: flex !important;
	align-items: center;
	gap: 4px;
	font-size: 10.5px;
	font-weight: 600;
	color: var(--rust);
	letter-spacing: .02em;
}
.bleevn-deals__card-left svg { flex-shrink: 0; }

/* ============ المنتج البارز ============ */
.bleevn-deal {
	display: flex;
	gap: 40px;
	align-items: center;
	height: 100%;
	padding: 24px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 16px;
	box-sizing: border-box;
}

.bleevn-deal__media { flex: 0 0 42%; max-width: 42%; }
.bleevn-deal__stage {
	position: relative;
	background: #eceae4;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}
.bleevn-deal__img {
	display: block; width: 100%; height: auto; max-height: 600px;
	object-fit: contain; transition: transform .5s ease;
}
.bleevn-deal__stage:hover .bleevn-deal__img { transform: scale(1.03); }
.bleevn-deal__save {
	position: absolute; top: 14px; left: 14px; z-index: 2;
	background: var(--rust); color: #fff; font-size: 12px; font-weight: 600;
	padding: 6px 11px; border-radius: 7px;
}
.bleevn-deal__thumbs { display: flex; gap: 8px; margin-top: 10px; }
.bleevn-deal__thumb {
	flex: 1; aspect-ratio: 3 / 4; padding: 0;
	border: 2px solid transparent; border-radius: 9px; overflow: hidden;
	background: #eceae4; cursor: pointer; transition: border-color .2s ease;
}
.bleevn-deal__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bleevn-deal__thumb.is-active { border-color: var(--navy); }

.bleevn-deal__info { flex: 1 1 auto; max-width: 500px; }

.bleevn-deal__badge {
	display: inline-flex; align-items: center; gap: 6px;
	margin-bottom: 18px; padding: 8px 14px;
	background: var(--sand); color: var(--navy);
	border-radius: 999px; font-size: 12px; font-weight: 700;
	letter-spacing: .07em; text-transform: uppercase;
}
.bleevn-deal__title { margin: 0 0 12px; font-size: 28px; line-height: 1.25; font-weight: 600; color: var(--ink); }
.bleevn-deal__title a {
	color: inherit;
	text-decoration: none;
	transition: color .2s ease;
}
.bleevn-deal__title a:hover { color: var(--navy); }

/* ===== RATING (نجوم + رقم) ===== */
.bleevn-deal__rating {
	display: flex; align-items: center; margin-bottom: 14px;
}
.bleevn-deal__rating-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	line-height: 0;
	text-decoration: none;
	transition: opacity .2s ease;
}
.bleevn-deal__rating-link:hover { opacity: .75; }
.bleevn-deal__rating-score {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--ink);
	line-height: 1;
	letter-spacing: .01em;
}

.bleevn-deal__stars {
	position: relative;
	display: inline-block;
	flex-shrink: 0;
	line-height: 0;
	white-space: nowrap;
}
.bleevn-deal__stars-base,
.bleevn-deal__stars-fill {
	display: flex;
	gap: 3px;
	line-height: 0;
}
.bleevn-deal__stars-base svg { color: #dcd8d0; }
.bleevn-deal__stars-fill {
	position: absolute;
	top: 0; left: 0;
	overflow: hidden;
	width: calc(var(--rating, 0) / 5 * 100%);
}
.bleevn-deal__stars-fill svg { color: #d9a53c; }
.bleevn-deal__stars svg { flex-shrink: 0; }

.bleevn-deal__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.bleevn-deal__now { font-size: 34px; font-weight: 700; color: var(--navy); text-decoration: none; line-height: 1; }
.bleevn-deal__now span { font-size: 16px; font-weight: 600; }
.bleevn-deal__was { font-size: 16px; color: #aaa; }
.bleevn-deal__off {
	background: var(--rust-bg); color: var(--rust); font-size: 11px; font-weight: 700;
	padding: 4px 8px; border-radius: 5px; text-transform: uppercase; letter-spacing: .03em;
}

.bleevn-deal__opt { margin-bottom: 16px; }
.bleevn-deal__opt-label {
	display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600;
	color: #555; text-transform: uppercase; letter-spacing: .03em;
}
.bleevn-deal__swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.bleevn-deal__swatch {
	min-width: 46px; height: 42px; padding: 0 14px;
	background: #fff; border: 1px solid #ddd; border-radius: 9px;
	font-size: 14px; color: #333; cursor: pointer; transition: all .18s ease;
}
.bleevn-deal__swatch:hover { border-color: var(--navy); }
.bleevn-deal__swatch[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.bleevn-deal__swatch.is-unavailable { color: #c4c4c4; border-color: #eee; background: #f7f7f7; text-decoration: line-through; cursor: not-allowed; }

.bleevn-deal__countdown { margin: 4px 0 20px; }
.bleevn-deal__count-label {
	display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
	font-size: 12px; font-weight: 600; color: var(--rust);
	text-transform: uppercase; letter-spacing: .05em;
	transition: color .3s ease;
}
.bleevn-deal__count-row { display: flex; gap: 12px; }
.bleevn-deal__count-box {
	flex: 1; max-width: 78px; display: flex; flex-direction: column; align-items: center; gap: 4px;
	padding: 12px 6px;
	background: #fdf6f2;
	border: 1.5px solid #eedbd0;
	border-radius: 9px;
	transition: background .3s ease, border-color .3s ease;
}
.bleevn-deal__count-box b {
	font-size: 24px; font-weight: 700; color: var(--rust);
	font-variant-numeric: tabular-nums; line-height: 1;
	transition: color .3s ease;
}
.bleevn-deal__count-box small { font-size: 11px; color: #a68a7d; text-transform: uppercase; letter-spacing: .03em; }

/* أقل من 3 ساعات — إلحاح أعلى (أغمق + نبضة على الثواني) */
.bleevn-deal__countdown.is-urgent .bleevn-deal__count-box {
	background: #fbeee7;
	border-color: #e5c3b2;
}
.bleevn-deal__countdown.is-urgent .bleevn-deal__count-box b { color: #8f3f24; }
.bleevn-deal__countdown.is-urgent .bleevn-deal__count-label { color: #8f3f24; }
.bleevn-deal__countdown.is-urgent .bleevn-deal__count-box:last-child {
	animation: bleevnPulse 1.6s ease-in-out infinite;
}
@keyframes bleevnPulse {
	0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(164, 81, 50, 0); }
	50% { transform: scale(1.035); box-shadow: 0 0 0 4px rgba(164, 81, 50, .12); }
}
@media (prefers-reduced-motion: reduce) {
	.bleevn-deal__countdown.is-urgent .bleevn-deal__count-box:last-child { animation: none; }
}

.bleevn-deal__stock { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--rust); }

.bleevn-deal__cta {
	width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 9px;
	background: var(--navy); color: #fff; border: none; border-radius: 10px;
	font-size: 14px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
	cursor: pointer; transition: background .25s ease, transform .15s ease, box-shadow .25s ease;
}
.bleevn-deal__cta:hover:not(:disabled) { background: var(--navy-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(47, 67, 95, .25); }
.bleevn-deal__cta:active:not(:disabled) { transform: translateY(0); }
.bleevn-deal__cta:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.bleevn-deal__cta:disabled { background: #b7bfca; cursor: not-allowed; }

.bleevn-deal__trust {
	display: flex; justify-content: space-between; gap: 10px;
	margin: 16px 0 0; padding: 16px 0 0; list-style: none; border-top: 1px solid var(--line);
}
.bleevn-deal__trust li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: #555; }
.bleevn-deal__trust svg { color: var(--navy); flex-shrink: 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
	.bleevn-deals { flex-direction: column; }
	.bleevn-deals__list {
		flex: none; width: 100%; flex-direction: row; max-height: none;
		overflow-x: auto; overflow-y: hidden;
		padding-bottom: 6px;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
	}
	.bleevn-deals__card {
		flex: 0 0 78%;
		width: 78%;
		max-width: 300px;
		scroll-snap-align: start;
	}
}
@media (max-width: 768px) {
	.bleevn-deals-head { margin-bottom: 16px; }
	.bleevn-deals-head__title { font-size: 22px; }
	.bleevn-deals-head__sub { font-size: 12.5px; }

	.bleevn-deals { padding: 0 12px; gap: 14px; }

	.bleevn-deal {
		flex-direction: column;
		gap: 14px;
		padding: 14px;
	}
	.bleevn-deal__media, .bleevn-deal__info { max-width: 100%; width: 100%; flex: none; }

	/* الصورة أصغر (بدون قص) */
	.bleevn-deal__stage { max-height: none; height: auto; }
	.bleevn-deal__img { max-height: 300px; height: auto; object-fit: contain; width: auto; max-width: 100%; margin: 0 auto; }
	.bleevn-deal__save { top: 10px; left: 10px; font-size: 11px; padding: 5px 9px; }

	/* thumbnails أصغر */
	.bleevn-deal__thumbs { gap: 6px; margin-top: 7px; }
	.bleevn-deal__thumb { max-width: 52px; border-radius: 7px; }

	/* ضغط المسافات */
	.bleevn-deal__badge {
		margin-bottom: 10px;
		padding: 6px 11px;
		font-size: 11px;
	}
	.bleevn-deal__title { font-size: 20px; margin-bottom: 8px; line-height: 1.2; }
	.bleevn-deal__rating { margin-bottom: 9px; }
	.bleevn-deal__price { margin-bottom: 13px; gap: 8px; }
	.bleevn-deal__now { font-size: 27px; }
	.bleevn-deal__was { font-size: 14px; }

	.bleevn-deal__opt { margin-bottom: 11px; }
	.bleevn-deal__opt-label { margin-bottom: 6px; font-size: 11px; }
	.bleevn-deal__swatch { min-width: 42px; height: 38px; padding: 0 12px; font-size: 13px; }

	.bleevn-deal__countdown { margin: 0 0 13px; }
	.bleevn-deal__count-label { margin-bottom: 8px; font-size: 11px; }
	.bleevn-deal__count-row { gap: 8px; }
	.bleevn-deal__count-box { max-width: none; padding: 8px 4px; gap: 3px; border-radius: 8px; }
	.bleevn-deal__count-box b { font-size: 20px; }
	.bleevn-deal__count-box small { font-size: 10px; }

	.bleevn-deal__stock { margin-bottom: 10px; font-size: 12px; }

	.bleevn-deal__cta { min-height: 50px; font-size: 13px; border-radius: 9px; }

	/* صف الثقة: صف أفقي مضغوط بدل عمودي */
	.bleevn-deal__trust {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: space-between;
		gap: 8px;
		margin-top: 11px;
		padding-top: 11px;
	}
	.bleevn-deal__trust li { font-size: 10.5px; gap: 4px; }
	.bleevn-deal__trust svg { width: 13px; height: 13px; }
}