/* =====================================================================
   لافين فاشن — تحسين بطاقات المنتجات (عصري + متوافق مع الهوية)
   يُطبَّق على الصفحة الرئيسية والمتجر والتصنيفات والمنتجات ذات الصلة.
   لون الهوية: #90543c (عنّابي غامق)
   ===================================================================== */

/* ---- البطاقة: زوايا دائرية + حد ناعم + ظل خفيف + رفع عند المرور ----
   (البطاقات في الصفحة الرئيسية div.product-small، وفي المتجر li.product) */
.product-small.product,
ul.products li.product {
	position: relative;
	isolation: isolate;              /* حاوية تكديس مستقلة: تُبقي الشارة/الزر ضمن البطاقة */
	border: 1px solid #efe5d8 !important;
	border-radius: 16px !important;
	overflow: hidden;
	background: #ffffff !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .04) !important;
	transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease;
}

.product-small.product:hover,
ul.products li.product:hover {
	transform: translateY(-5px);
	box-shadow: 0 14px 32px rgba(144, 84, 60, .14) !important;
	border-color: #e3d5c4 !important;
}

/* ---- حاوية الصورة: قص التكبير + زاوية علوية دائرية ----
   (.box-image موضعها relative أصلاً من الثيم — نبقيها مرجع التموضع للشارة والزر) */
.product-small .box-image,
.product-small .box-image-wrap,
.product-small .box-image-inner {
	overflow: hidden !important;
	border-radius: 15px 15px 0 0;
}

.product-small .box-image img {
	transition: transform .55s cubic-bezier(.2, .6, .2, 1);
	width: 100%;
}

.product-small:hover .box-image img {
	transform: scale(1.07);
}

/* ---- زر "عرض المنتج" يظهر بنعومة عند المرور (CSS فقط، لا يعيق النقر) ---- */
.product-small .box-image::after {
	content: "عرض المنتج";
	position: absolute;
	inset-inline: 0;
	bottom: 14px;
	margin: 0 auto;
	width: -moz-max-content;
	width: max-content;
	max-width: 80%;
	background: rgba(144, 84, 60, .96);
	color: #fff;
	font-family: "El Messiri", "Tajawal", sans-serif;
	font-size: 13px;
	font-weight: 700;
	padding: 9px 22px;
	border-radius: 999px;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity .3s ease, transform .3s ease;
	pointer-events: none;
	box-shadow: 0 6px 18px rgba(144, 84, 60, .35);
	z-index: 110;                     /* أعلى من رابط الصورة (100) ليظهر فوق الصورة */
}

.product-small:hover .box-image::after {
	opacity: 1;
	transform: translateY(0);
}

/* ---- شارة الخصم: حبة دائرية بلون الهوية ---- */
.product-small .onsale,
.products .onsale {
	border-radius: 999px !important;
	background: #90543c !important;
	color: #fff !important;
	font-weight: 700 !important;
	padding: 5px 12px !important;
	font-size: 12px !important;
	line-height: 1 !important;
	min-height: 0 !important;
	min-width: 0 !important;
	box-shadow: 0 2px 8px rgba(144, 84, 60, .28);
	top: 12px !important;
	inset-inline-start: 12px !important;
	inset-inline-end: auto !important;
	z-index: 120 !important;          /* أعلى من رابط الصورة (z-index:100 من الثيم) */
}

.product-small .onsale span,
.product-small .onsale strong {
	background: transparent !important;
	color: #fff !important;
	padding: 0 !important;
}

/* ---- زر المفضلة فوق الصورة: أيقونة قلب فقط ----
   YITH 4.16 يُخرج <a> فيه أيقونة SVG + <span class="__label">أضيفي إلى المفضلة</span>.
   الثيم يضع الزر في .image-tools المطلقة فوق الصورة (مصمّمة لأيقونة فقط)،
   فكان النص يتمدد أفقياً ويطفو فوق صورة المنتج.
   نُخفي النص بصرياً فقط (clip) لا بـ display:none — لأن الرابط بلا aria-label
   ولا title، فحذف النص كلياً يفقده اسمه المتاح لقارئات الشاشة. */
.product-small .image-tools,
ul.products li.product .image-tools {
	top: 12px !important;
	right: 12px !important;
	left: auto !important;
	bottom: auto !important;
	width: auto !important;
	height: auto !important;
	padding: 0 !important;
	margin: 0 !important;
	z-index: 115 !important;          /* فوق رابط الصورة (100)، تحت الشارة (120) */
}

.product-small .image-tools .yith-wcwl-add-to-wishlist-button__label,
ul.products li.product .image-tools .yith-wcwl-add-to-wishlist-button__label {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.product-small .image-tools .yith-wcwl-add-to-wishlist-button,
ul.products li.product .image-tools .yith-wcwl-add-to-wishlist-button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 36px !important;
	height: 36px !important;
	min-width: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: rgba(255, 255, 255, .92) !important;
	color: #90543c !important;
	box-shadow: 0 2px 8px rgba(31, 27, 24, .16);
	transition: background-color .25s ease, color .25s ease, transform .25s ease;
}

.product-small .image-tools .yith-wcwl-add-to-wishlist-button:hover,
ul.products li.product .image-tools .yith-wcwl-add-to-wishlist-button:hover {
	background: #90543c !important;
	color: #fff !important;
	transform: scale(1.08);
}

.product-small .image-tools .yith-wcwl-add-to-wishlist-button-icon,
ul.products li.product .image-tools .yith-wcwl-add-to-wishlist-button-icon {
	width: 19px !important;
	height: 19px !important;
	margin: 0 !important;
}

/* حالة "مضاف للمفضلة": قلب ممتلئ بلون الهوية */
.product-small .image-tools .yith-wcwl-add-to-wishlist-button--added .yith-wcwl-add-to-wishlist-button-icon,
ul.products li.product .image-tools .yith-wcwl-add-to-wishlist-button--added .yith-wcwl-add-to-wishlist-button-icon {
	fill: #90543c !important;
}

.product-small .image-tools .yith-wcwl-add-to-wishlist-button--added:hover .yith-wcwl-add-to-wishlist-button-icon,
ul.products li.product .image-tools .yith-wcwl-add-to-wishlist-button--added:hover .yith-wcwl-add-to-wishlist-button-icon {
	fill: #fff !important;
}

/* حاوية YITH الداخلية: لا تفرض عرضاً */
.product-small .image-tools .yith-add-to-wishlist-button-block,
ul.products li.product .image-tools .yith-add-to-wishlist-button-block {
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* ---- منطقة النص: تنفّس داخلي ومحاذاة يمين ---- */
.product-small .box-text {
	padding: 14px 15px 18px !important;
	text-align: right;
}

/* ---- العنوان: سطران بارتفاع ثابت (محاذاة البطاقات) + لون الهوية عند المرور ---- */
/* الثيم الأب يفرض `height:4.125em` (= 2.66 سطر) على العنوان، وهو يتغلّب على
   قصّ السطرين فيُرسم سطر ثالث **مقصوص من منتصف الحروف** — ظهر بوضوح في شبكة
   «منتجات ذات صلة» الأضيق (المحتوى 90px داخل صندوق 59.8px على الديسكتوب).
   `height:auto` يعيد القصّ إلى سطرين نظيفين بثلاث نقاط (45px)، و`min-height`
   يحافظ على تساوي ارتفاع البطاقات وهو الغرض الأصلي. */
.product-small .box-text .woocommerce-loop-product__title,
.product-small .box-text .name.product-title,
.product-small .box-text .name a {
	font-size: 14.5px !important;
	line-height: 1.55 !important;
	height: auto !important;
	min-height: 2.9em;
	max-height: 3.1em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0 0 8px !important;
	color: #1f1b18 !important;
	transition: color .25s ease;
}

.product-small:hover .box-text .woocommerce-loop-product__title,
.product-small:hover .box-text .name a {
	color: #90543c !important;
}

/* ---- السعر: الحالي بلون الهوية بارز، القديم رمادي مقروء ومشطوب ---- */
.product-small .box-text .price {
	font-size: 16px !important;
	display: block;
}

.product-small .box-text .price ins,
.product-small .box-text .price ins .amount {
	text-decoration: none !important;
	color: #90543c !important;
	font-weight: 800 !important;
}

.product-small .box-text .price > .amount {
	color: #90543c !important;
	font-weight: 800 !important;
}

/* `del` و`del .amount` كانا يأخذان `.82em` معاً، و`.amount` وريث `del` —
   فيتراكم التصغير (0.82 × 0.82 = 0.672em) ويهبط رمز «ر.س» إلى 9.7px.
   نطبّق التصغير على `del` وحدها ونترك ما بداخلها بحجمه الموروث. */
.product-small .box-text .price del {
	font-size: .82em !important;
}

.product-small .box-text .price del,
.product-small .box-text .price del .amount {
	color: #6e6e6e !important;   /* مقروء (تباين ≥ 4.5:1) */
	font-weight: 500 !important;
	margin-inline-start: 6px;
}

.product-small .box-text .price del .amount {
	font-size: 1em !important;
}

/* ---- الجوال: مسافات أنسب للبطاقة ---- */
@media only screen and (max-width: 549px) {
	.product-small .box-text {
		padding: 10px 10px 14px !important;
	}
	.product-small .box-text .woocommerce-loop-product__title,
	.product-small .box-text .name a {
		font-size: 13px !important;
	}
	.product-small .box-text .price {
		font-size: 14.5px !important;
	}
	.product-small .box-image-wrap::after {
		font-size: 12px;
		padding: 7px 16px;
	}
}
