/* =============================================================
   Nikmehr — Wishlist / Favorites
   A slim side drawer (the "favorites view") with a checkbox per
   row and an «add selected to cart» button. Mirrors the compare
   drawer (compare.css); reuses the .nik-cart-locked scroll-lock
   class and the design tokens from main.css. RTL via logical props.
   ============================================================= */

/* ---------- Overlay ---------- */
.nik-fav-overlay {
	position: fixed; inset: 0; z-index: 140;
	background: rgba(11,28,69,.5);
	opacity: 0; transition: opacity .3s ease;
}
.nik-fav-overlay.is-open { opacity: 1; }

/* =============================================================
   Drawer ("علاقه‌مندی‌ها")
   ============================================================= */
.nik-fav-drawer {
	position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 150;
	width: min(92vw, 380px);
	display: flex; flex-direction: column;
	background: #fff; color: var(--nik-text);
	box-shadow: 0 0 60px -10px rgba(11,28,69,.4);
	/* Parked off-screen toward the inline-start edge until opened (see compare.css
	   for the translateX rationale). Default is the RTL value; LTR overrides. */
	transform: translateX(100%);
	visibility: hidden;
	transition: transform .32s cubic-bezier(.22,1,.36,1), visibility .32s;
}
[dir="ltr"] .nik-fav-drawer { transform: translateX(-100%); }
.nik-fav-drawer.is-open { transform: translateX(0); visibility: visible; }

.nik-fav-drawer__head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 18px; border-bottom: 1px solid var(--nik-border); flex-shrink: 0;
}
.nik-fav-drawer__title {
	margin: 0; display: inline-flex; align-items: center; gap: 8px;
	font-size: 16px; font-weight: 800; color: var(--nik-primary);
}
.nik-fav-drawer__count {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 22px; height: 22px; padding: 0 6px;
	font-size: 12px; font-weight: 800; line-height: 1;
	color: #1a1a1a; background: var(--nik-accent); border-radius: 999px;
}
.nik-fav-drawer__close {
	display: inline-flex; padding: 4px; background: none; border: 0; cursor: pointer;
	color: var(--nik-text-soft); transition: color .15s ease;
}
.nik-fav-drawer__close:hover { color: var(--nik-accent-600); }

/* "Added" confirmation toast inside the drawer. */
.nik-fav-drawer__toast {
	display: flex; align-items: center; gap: 8px;
	margin: 0; padding: 11px 18px;
	font-size: 13px; font-weight: 700;
	color: var(--nik-success); background: var(--nik-success-bg);
}
.nik-fav-drawer__toast svg { flex-shrink: 0; }

/* "Select all" row. */
.nik-fav-drawer__selectall {
	display: flex; align-items: center; gap: 8px; flex-shrink: 0;
	padding: 11px 16px; border-bottom: 1px solid var(--nik-border);
	font-size: 12.5px; font-weight: 700; color: var(--nik-text-soft); cursor: pointer;
}
.nik-fav-drawer__selectall input { width: 16px; height: 16px; accent-color: var(--nik-accent); cursor: pointer; }

/* The list of favorite products. */
.nik-fav-drawer__list {
	flex: 1 1 auto; min-height: 0;
	overflow-y: auto; overscroll-behavior: contain;
	padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
}
.nik-fav-drawer__empty {
	margin: 0; padding: 28px 18px; text-align: center;
	font-size: 13.5px; font-weight: 600; color: var(--nik-text-faint);
}

.nik-fav-item {
	display: flex; align-items: center; gap: 10px;
	padding: 9px; border: 1px solid var(--nik-border); border-radius: var(--nik-radius);
	background: #fff;
}
.nik-fav-item__pick { flex-shrink: 0; display: inline-flex; align-items: center; min-width: 16px; }
.nik-fav-item__check { width: 17px; height: 17px; accent-color: var(--nik-accent); cursor: pointer; }
.nik-fav-item__thumb {
	flex-shrink: 0; width: 52px; height: 52px;
	display: flex; align-items: center; justify-content: center;
	background: var(--nik-bg-soft); border-radius: var(--nik-radius-sm); overflow: hidden;
}
.nik-fav-item__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.nik-fav-item__info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nik-fav-item__name {
	font-size: 12.5px; font-weight: 700; line-height: 1.6; color: var(--nik-text);
	text-decoration: none;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nik-fav-item__name:hover { color: var(--nik-accent-600); }
.nik-fav-item__price { font-size: 12px; font-weight: 700; color: var(--nik-primary); }
.nik-fav-item__price del { color: var(--nik-text-faint); font-weight: 500; margin-inline-start: 4px; }
.nik-fav-item__view {
	align-self: flex-start; margin-top: 2px;
	font-size: 11.5px; font-weight: 800; text-decoration: none;
	color: var(--nik-accent-600);
}
.nik-fav-item__view:hover { text-decoration: underline; }
.nik-fav-item__remove {
	flex-shrink: 0; display: inline-flex; padding: 5px;
	background: none; border: 0; cursor: pointer;
	color: var(--nik-text-faint); transition: color .15s ease;
}
.nik-fav-item__remove:hover { color: #c0392b; }

/* ---------- «افزودن انتخاب‌شده‌ها به سبد» CTA ---------- */
.nik-fav-drawer__go {
	flex-shrink: 0; margin: 14px; padding: 13px 16px; cursor: pointer;
	font-family: var(--nik-font); font-size: 15px; font-weight: 800;
	color: #1a1a1a; background: var(--nik-accent);
	border: 0; border-radius: var(--nik-radius-sm);
	transition: background .15s ease, opacity .15s ease;
}
.nik-fav-drawer__go:hover:not(:disabled) { background: var(--nik-accent-600); }
.nik-fav-drawer__go:disabled { opacity: .45; cursor: default; }

/* =============================================================
   Heart controls (PDP tool + product card)
   ============================================================= */

/* PDP «علاقه‌مندی» tool active state — filled heart in accent. */
.nik-pdp-tool[data-wishlist].is-active {
	color: #e0245e; border-color: #e0245e; background: rgba(224,36,94,.06);
}
.nik-pdp-tool[data-wishlist].is-active svg { fill: currentColor; }

/* Product-card heart. Top of a vertical stack in the inline-start corner
   (heart above, compare below at top:50px) so both stay clear of the sale-%
   badge, which sits inline-end. Quiet until favorited. */
.nik-product { position: relative; }
.nik-product__fav {
	position: absolute; inset-block-start: 10px; inset-inline-start: 10px; z-index: 3;
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; cursor: pointer;
	color: var(--nik-text-soft); background: rgba(255,255,255,.92);
	border: 1px solid var(--nik-border); border-radius: 50%;
	box-shadow: 0 2px 8px -2px rgba(11,28,69,.18);
	transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.nik-product__fav:hover { color: #e0245e; border-color: #e0245e; }
.nik-product__fav.is-active {
	color: #fff; background: #e0245e; border-color: #e0245e;
}
.nik-product__fav.is-active svg { fill: currentColor; }

/* =============================================================
   Header heart badge
   ============================================================= */
.nik-header__fav-count {
	position: absolute; top: -7px; inset-inline-start: -9px;
	background: #e0245e; color: #fff;
	font-size: 10px; font-weight: 800; min-width: 18px; height: 18px;
	border-radius: 9px; display: grid; place-items: center; padding-inline: 4px;
	border: 2px solid #fff;
	box-shadow: 0 2px 6px rgba(224,36,94,.5);
}
.nik-header__fav-count[hidden] { display: none; }

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 600px) {
	.nik-fav-drawer { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
	.nik-fav-drawer,
	.nik-fav-overlay { transition: opacity .2s ease, visibility .2s; }
	.nik-fav-drawer { transform: none; }
}
