/* ==========================================================================
   LionCosmetic – سبد خرید کشویی و مینی‌کارت
   ========================================================================== */

/* ---------------------------------------------------------------- Drawer */
.bl-drawer { position: fixed; inset: 0; z-index: 150; overflow: hidden; visibility: hidden; pointer-events: none; transition: visibility 0s .5s; }
.bl-drawer.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }

.bl-drawer__overlay { position: absolute; inset: 0; background: rgba(23, 17, 29, .5); opacity: 0; transition: opacity .4s var(--bl-ease); }
.bl-drawer--glass .bl-drawer__overlay { -webkit-backdrop-filter: blur(7px) saturate(1.2); backdrop-filter: blur(7px) saturate(1.2); }
.bl-drawer.is-open .bl-drawer__overlay { opacity: 1; }

.bl-drawer__panel {
	position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column;
	width: min(var(--bl-drawer-w, 420px), 100%); max-width: 100%; height: 100%; height: 100dvh; overflow: hidden; touch-action: pan-y;
	background: #fff; box-shadow: 0 0 80px rgba(46, 14, 72, .28);
	transition: transform .55s cubic-bezier(.2, .9, .25, 1.04);
}
.bl-drawer--left .bl-drawer__panel { left: 0; border-radius: 0 28px 28px 0; transform: translateX(-104%); }
.bl-drawer--right .bl-drawer__panel { right: 0; border-radius: 28px 0 0 28px; transform: translateX(104%); }
.bl-drawer.is-open .bl-drawer__panel { transform: none; }
.bl-drawer__panel.is-dragging { transition: none; }
.bl-drawer--glass .bl-drawer__panel {
	background: linear-gradient(160deg, rgba(255, 255, 255, .94), rgba(250, 243, 255, .9));
	-webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5);
}
.bl-drawer__panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 160px; pointer-events: none; background: radial-gradient(120% 100% at 50% -20%, rgba(var(--bl-accent-rgb), 0.22), transparent 70%); }

/* Header */
.bl-drawer__head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; }
.bl-drawer__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bl-drawer__title h2 { margin: 0; font-size: 19px; line-height: 1.4; }
.bl-drawer__badge { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 15px; color: #fff; background: linear-gradient(145deg, var(--bl-accent), var(--bl-primary)); box-shadow: 0 10px 22px rgba(var(--bl-primary-rgb), 0.35); }
.bl-drawer__count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--bl-primary-100); color: var(--bl-primary-700); font-size: 12.5px; font-weight: 700; transition: transform .3s var(--bl-ease); }
.bl-drawer__count.is-empty { display: none; }
.bl-drawer__count.is-bump { animation: bl-bump .45s var(--bl-ease); }
.bl-drawer__close { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .7); color: var(--bl-ink); cursor: pointer; transition: transform .35s var(--bl-ease), background .2s, color .2s; }
.bl-drawer__close:hover { background: var(--bl-primary); color: #fff; transform: rotate(90deg); }

/* Body (the WooCommerce fragment lives here) */
.bl-drawer__body { position: relative; display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 0; }
.bl-drawer__body.is-busy .bl-mc__foot { opacity: .6; transition: opacity .2s; }

/* ------------------------------------------------------------- Mini cart */
.bl-mc__ship { margin: 4px 18px 10px; padding: 14px 16px; border-radius: 18px; background: #fff; border: 1px solid var(--bl-line); box-shadow: var(--bl-shadow-sm); }
.bl-mc__ship p { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 13px; line-height: 1.7; }
.bl-mc__ship p .bl-icon { flex: none; color: var(--bl-primary); }
.bl-mc__ship p b { color: var(--bl-primary); }
.bl-mc__bar { position: relative; height: 9px; border-radius: 999px; background: var(--bl-primary-100); overflow: hidden; }
.bl-mc__bar i {
	display: block; width: var(--p, 0); height: 100%; border-radius: inherit;
	background: linear-gradient(90deg, var(--bl-primary), var(--bl-accent), var(--bl-primary)); background-size: 200% 100%;
	animation: bl-mc-fill 1s var(--bl-ease) both, bl-mc-shine 2.4s linear infinite; transition: width .8s var(--bl-ease);
}
.bl-mc__ship.is-done { border-color: #a7e1c7; background: linear-gradient(135deg, #f0fff8, #fff); }
.bl-mc__ship.is-done p .bl-icon, .bl-mc__ship.is-done p b { color: #159a60; }
.bl-mc__ship.is-done .bl-mc__bar { background: #d6f5e7; }
.bl-mc__ship.is-done .bl-mc__bar i { background: linear-gradient(90deg, #22b573, #5fe0a4, #22b573); background-size: 200% 100%; }

.bl-mc__list { flex: 1; min-height: 0; margin: 0; padding: 4px 18px 10px; overflow-y: auto; overscroll-behavior: contain; list-style: none; max-height: none; scrollbar-width: thin; scrollbar-color: var(--bl-primary-100) transparent; }
.bl-mc__item { position: relative; display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 14px; margin-bottom: 12px; padding: 12px; border: 1px solid var(--bl-line); border-radius: 20px; background: #fff; box-shadow: 0 4px 14px rgba(81, 29, 104, .05); transition: box-shadow .25s, transform .25s var(--bl-ease); }
.bl-mc__item:hover { box-shadow: var(--bl-shadow-sm); }
.bl-mc__thumb { display: block; width: 78px; height: 78px; border-radius: 16px; overflow: hidden; background: var(--bl-primary-50); }
.bl-mc__img, .bl-mc__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bl-mc__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-inline-end: 22px; }
.bl-mc__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; font-weight: 700; line-height: 1.7; color: var(--bl-ink); }
a.bl-mc__name:hover { color: var(--bl-primary); }
.bl-mc__info .variation { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: var(--bl-muted); }
.bl-mc__info .variation dt, .bl-mc__info .variation dd, .bl-mc__info .variation p { display: inline; margin: 0; }
.bl-mc__unit { font-size: 12px; color: var(--bl-muted); }
.bl-mc__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.bl-mc__line { font-size: 14px; font-weight: 700; color: var(--bl-primary); }
.bl-mc__qty { color: var(--bl-muted); font-size: 12.5px; }

.bl-mc__remove { position: absolute; top: 10px; inset-inline-end: 10px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bl-primary-50); color: var(--bl-muted); transition: .25s var(--bl-ease); }
.bl-mc__remove:hover { background: #ffe3e8; color: #d6264f; transform: rotate(90deg) scale(1.08); }

/* Quantity stepper */
.bl-qty { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bl-primary-50); border: 1px solid var(--bl-line); }
.bl-qty__btn { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--bl-primary); box-shadow: 0 2px 6px rgba(81, 29, 104, .1); cursor: pointer; transition: transform .2s var(--bl-ease), background .2s, color .2s; }
.bl-qty__btn:hover:not(:disabled) { background: var(--bl-primary); color: #fff; transform: scale(1.08); }
.bl-qty__btn:active:not(:disabled) { transform: scale(.9); }
.bl-qty__btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.bl-qty__trash { display: none; }
.bl-qty[data-qty="1"] .bl-qty__minus { display: none; }
.bl-qty[data-qty="1"] .bl-qty__trash { display: block; }
.bl-qty[data-qty="1"] [data-qty-step="-1"]:hover:not(:disabled) { background: #d6264f; }
.bl-qty__val { min-width: 28px; text-align: center; font-size: 13.5px; font-weight: 700; }
.bl-qty__val.is-tick { animation: bl-bump .3s var(--bl-ease); }

/* Footer */
.bl-mc__foot { position: relative; flex: none; padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--bl-line); background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 -14px 34px rgba(81, 29, 104, .07); }
.woocommerce-mini-cart__total { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; font-size: 14px; color: var(--bl-muted); }
.woocommerce-mini-cart__total strong { font-size: 19px; color: var(--bl-ink); }
.bl-mc__buttons { display: grid; gap: 10px; margin: 0; }
.bl-mc__buttons .bl-btn { width: 100%; min-height: 50px; border-radius: 16px; font-size: 14.5px; }
.bl-mc__checkout { position: relative; overflow: hidden; }
.bl-mc__checkout::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(120%); animation: bl-mc-sweep 3.4s ease-in-out infinite; }
.bl-mc__checkout .bl-icon { transition: transform .3s var(--bl-ease); }
.bl-mc__checkout:hover .bl-icon { transform: translateX(-5px); }

/* Empty state */
.bl-mc__empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 30px 30px 60px; text-align: center; }
.bl-mc__empty h3 { margin: 10px 0 0; font-size: 18px; }
.bl-mc__empty p { margin: 0 0 14px; color: var(--bl-muted); font-size: 13.5px; line-height: 1.9; }
.bl-mc__empty-art { position: relative; display: grid; place-items: center; width: 118px; height: 118px; border-radius: 50%; color: var(--bl-primary); background: radial-gradient(circle at 30% 25%, #fff, var(--bl-primary-100)); box-shadow: 0 18px 40px rgba(var(--bl-primary-rgb), 0.22); animation: bl-float 4.5s ease-in-out infinite; }
.bl-mc__empty-art i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--bl-accent); animation: bl-mc-twinkle 2.4s ease-in-out infinite; }
.bl-mc__empty-art i:nth-of-type(1) { top: 6px; inset-inline-end: 10px; }
.bl-mc__empty-art i:nth-of-type(2) { bottom: 14px; inset-inline-start: 0; width: 7px; height: 7px; background: var(--bl-primary); animation-delay: -.8s; }
.bl-mc__empty-art i:nth-of-type(3) { top: 30px; inset-inline-start: -8px; width: 6px; height: 6px; animation-delay: -1.5s; }

/* Old hover panel (when the drawer is turned off) */
.bl-minicart__panel .bl-mc__list { max-height: 300px; padding-inline: 0; }
.bl-minicart__panel .bl-mc__ship { margin-inline: 0; }
.bl-minicart__panel .bl-mc__foot { padding-inline: 0; box-shadow: none; background: transparent; }
.bl-minicart__panel .bl-mc__empty { padding: 10px 0 0; }
.bl-minicart__panel .bl-mc__empty-art { width: 84px; height: 84px; }

/* ----------------------------------------------------------- Animations */
.bl-drawer__body.is-entering .bl-mc__ship, .bl-drawer__body.is-entering .bl-mc__foot { animation: bl-mc-in .6s var(--bl-ease) both; }
.bl-drawer__body.is-entering .bl-mc__item { animation: bl-mc-in .6s var(--bl-ease) both; animation-delay: calc(var(--i, 1) * 70ms + 120ms); }
.bl-drawer__body.is-entering .bl-mc__empty > * { animation: bl-mc-in .6s var(--bl-ease) both; }
.bl-mc__item.is-new { animation: bl-mc-new .75s var(--bl-ease) both, bl-mc-glow 1.6s ease-out .2s both; }

@keyframes bl-mc-in { from { opacity: 0; transform: translateX(24px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes bl-mc-new { 0% { opacity: 0; transform: translateY(-14px) scale(.92); } 60% { transform: translateY(2px) scale(1.02); } 100% { opacity: 1; transform: none; } }
@keyframes bl-mc-glow { 0% { box-shadow: 0 0 0 0 rgba(var(--bl-accent-rgb), 0.55); border-color: var(--bl-accent); } 100% { box-shadow: 0 0 0 16px transparent; border-color: var(--bl-line); } }
@keyframes bl-mc-fill { from { width: 0; } }
@keyframes bl-mc-shine { to { background-position: -200% 0; } }
@keyframes bl-mc-sweep { 0%, 55% { transform: translateX(120%); } 100% { transform: translateX(-120%); } }
@keyframes bl-mc-twinkle { 0%, 100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1.25); opacity: 1; } }
@keyframes bl-mc-ring { from { transform: scale(.4); opacity: .8; } to { transform: scale(2.6); opacity: 0; } }
@keyframes bl-mc-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------- Add-to-cart effects */
.bl-fly { position: fixed; z-index: 400; margin: 0; padding: 0; border-radius: 22px; overflow: hidden; pointer-events: none; border: 3px solid #fff; background: #fff; box-shadow: 0 16px 40px rgba(81, 29, 104, .35); will-change: transform, opacity; }
.bl-fly img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bl-ring { position: fixed; z-index: 399; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 3px solid var(--bl-accent); pointer-events: none; animation: bl-mc-ring .7s ease-out forwards; }
.bl-spark { position: fixed; z-index: 401; left: 0; top: 0; width: 9px; height: 9px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none; will-change: transform, opacity; }
.bl-spark--rect { width: 7px; height: 12px; border-radius: 2px; }

/* Button states */
.bl-btn--cart { position: relative; }
.bl-btn--cart.is-loading { color: transparent !important; pointer-events: none; }
.bl-btn--cart.is-loading::after { content: ""; position: absolute; inset: 0; width: 20px; height: 20px; margin: auto; border: 2.5px solid rgba(var(--bl-primary-rgb), 0.25); border-top-color: var(--bl-primary); border-radius: 50%; animation: bl-mc-spin .7s linear infinite; }
.bl-btn--cart.is-added { background: var(--bl-primary) !important; color: #fff !important; }
.bl-btn--cart .bl-btn__check { display: inline-block; vertical-align: -4px; margin-inline-end: 6px; animation: bl-pop .4s var(--bl-ease) both; }
.single_add_to_cart_button.is-loading::after { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.bl-cart-count.is-bump, .bl-drawer__count.is-bump { animation: bl-bump .5s var(--bl-ease); }
.bl-action--cart.is-ping .bl-action__icon, .bl-bottombar__cart.is-ping .bl-bottombar__icon { animation: bl-bump .5s var(--bl-ease); }

/* -------------------------------------------------------------- Responsive */
@media (max-width: 575px) {
	.bl-drawer__panel { width: min(var(--bl-drawer-w, 420px), 94vw); }
	.bl-drawer__head { padding: 16px 16px 10px; }
	.bl-mc__list { padding-inline: 12px; }
	.bl-mc__ship { margin-inline: 12px; }
	.bl-mc__item { grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 10px; }
	.bl-mc__thumb { width: 70px; height: 70px; }
}
@media (prefers-reduced-motion: reduce) {
	.bl-drawer__panel { transition-duration: .01ms; }
}


/* ==========================================================================
   2.3.3 – Mini-cart item layout isolation
   Fix: third-party WooCommerce/widget styles can override the grid layout of
   cart_list items (float/flex/width rules), making later cart rows collapse.
   Keep every cart row in a predictable two-column RTL grid.
   ========================================================================== */
.bl-drawer .bl-mc__list > li.bl-mc__item {
	display: grid !important;
	grid-template-columns: 78px minmax(0, 1fr) !important;
	grid-template-rows: auto !important;
	align-items: start;
	position: relative;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
	float: none !important;
	clear: both;
	direction: rtl;
}
.bl-drawer .bl-mc__list > li.bl-mc__item::before,
.bl-drawer .bl-mc__list > li.bl-mc__item::after {
	content: none !important;
	display: none !important;
}
.bl-drawer .bl-mc__list > li.bl-mc__item > .bl-mc__thumb {
	grid-column: 1;
	grid-row: 1;
	display: block;
	float: none !important;
	width: 78px;
	min-width: 78px;
	max-width: 78px;
	height: 78px;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
.bl-drawer .bl-mc__list > li.bl-mc__item > .bl-mc__thumb img {
	display: block;
	float: none !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0 !important;
	object-fit: cover;
}
.bl-drawer .bl-mc__list > li.bl-mc__item > .bl-mc__info {
	grid-column: 2;
	grid-row: 1;
	display: flex !important;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	margin: 0;
	box-sizing: border-box;
	overflow-wrap: anywhere;
}
.bl-drawer .bl-mc__list > li.bl-mc__item .bl-mc__name,
.bl-drawer .bl-mc__list > li.bl-mc__item .bl-mc__unit,
.bl-drawer .bl-mc__list > li.bl-mc__item .bl-mc__row {
	min-width: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
}
.bl-drawer .bl-mc__list > li.bl-mc__item .variation {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	overflow-wrap: anywhere;
}
.bl-drawer .bl-mc__list > li.bl-mc__item .variation dt,
.bl-drawer .bl-mc__list > li.bl-mc__item .variation dd {
	display: inline;
	float: none;
	margin: 0;
}
.bl-drawer .bl-mc__list > li.bl-mc__item > .bl-mc__remove {
	grid-column: 1 / -1;
	grid-row: 1;
	justify-self: start;
	z-index: 2;
}
@media (max-width: 575px) {
	.bl-drawer .bl-mc__list > li.bl-mc__item {
		grid-template-columns: 70px minmax(0, 1fr) !important;
	}
	.bl-drawer .bl-mc__list > li.bl-mc__item > .bl-mc__thumb {
		width: 70px;
		min-width: 70px;
		max-width: 70px;
		height: 70px;
	}
}
