/**
 * MyCosmetic — боковая корзина (drawer) + трекер бесплатной доставки.
 * Использует фирменные токены с безопасными фолбэками.
 */

:root {
	--mc-ink: #16161A;
	--mc-gray: #6B7186;
	--mc-blue: #5B86D6;
	--mc-blue-h: #4a72c0;
	--mc-pink: #C76A8A;
	--mc-green: #6FB97F;
	--mc-pink-box: #FCF5F8;
}

/* ==========================================================================
   Трекер бесплатной доставки
   ========================================================================== */
.mc-freeship {
	font-family: 'Jost', system-ui, sans-serif;
	background: var(--mc-pink-box);
	border: 1px solid rgba(199, 106, 138, 0.18);
	border-radius: 16px;
	padding: 14px 16px;
	margin: 0 0 18px;
}
.mc-freeship__msg {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.94rem;
	line-height: 1.4;
	color: var(--mc-ink);
}
.mc-freeship__msg strong { font-weight: 600; white-space: nowrap; }
.mc-freeship__ico { flex: 0 0 auto; }
.mc-freeship__bar {
	height: 8px;
	border-radius: 6px;
	background: rgba(199, 106, 138, 0.16);
	margin-top: 10px;
	overflow: hidden;
}
.mc-freeship__bar > span {
	display: block;
	height: 100%;
	border-radius: 6px;
	background: linear-gradient(90deg, var(--mc-pink), var(--mc-blue));
	transition: width 0.4s ease;
}
.mc-freeship__note {
	margin-top: 8px;
	font-size: 0.8rem;
	color: var(--mc-gray);
}
.mc-freeship.is-done {
	background: rgba(111, 185, 127, 0.10);
	border-color: rgba(111, 185, 127, 0.32);
}
.mc-freeship.is-done .mc-freeship__bar { background: rgba(111, 185, 127, 0.20); }
.mc-freeship.is-done .mc-freeship__bar > span { background: var(--mc-green); }

/* ==========================================================================
   Боковая корзина (drawer)
   ========================================================================== */
.mc-drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(22, 22, 26, 0.42);
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: 100000;
}
.mc-drawer-overlay.is-open { opacity: 1; }

.mc-drawer {
	position: fixed;
	top: 0;
	right: 0;
	height: 100dvh;
	width: 420px;
	max-width: 92vw;
	background: #fff;
	box-shadow: -18px 0 48px rgba(22, 22, 26, 0.14);
	transform: translateX(100%);
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
	z-index: 100001;
	display: flex;
	flex-direction: column;
	font-family: 'Jost', system-ui, sans-serif;
	color: var(--mc-ink);
}
.mc-drawer.is-open { transform: translateX(0); }
body.mc-drawer-open { overflow: hidden; }

.mc-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 22px;
	border-bottom: 1px solid rgba(22, 22, 26, 0.08);
	flex: 0 0 auto;
}
.mc-drawer__title { font-size: 1.15rem; font-weight: 600; }
.mc-drawer__count { color: var(--mc-gray); font-weight: 500; }
.mc-drawer__close {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--mc-ink);
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease;
}
.mc-drawer__close:hover { background: rgba(22, 22, 26, 0.06); }

/* Тост «товар добавлен» */
.mc-drawer__toast {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 14px 22px 0;
	padding: 12px 14px;
	background: rgba(111, 185, 127, 0.12);
	border: 1px solid rgba(111, 185, 127, 0.30);
	border-radius: 14px;
	font-size: 0.9rem;
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}
.mc-drawer__toast.is-show { opacity: 1; transform: translateY(0); }
.mc-drawer__toast svg { flex: 0 0 auto; }

/* Тело — мини-корзина WooCommerce */
.mc-drawer__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 18px 22px 22px;
}
.mc-drawer__body .woocommerce-mini-cart {
	list-style: none;
	margin: 0;
	padding: 0;
}
.mc-drawer__body .woocommerce-mini-cart__empty-message {
	color: var(--mc-gray);
	text-align: center;
	padding: 30px 0;
}
.mc-drawer__body li.woocommerce-mini-cart-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	position: relative;
	padding: 14px 0;
	border-bottom: 1px solid rgba(22, 22, 26, 0.07);
	list-style: none;
}
.mc-drawer__body li.woocommerce-mini-cart-item img {
	width: 60px;
	height: 60px;
	object-fit: contain;
	border-radius: 12px;
	background: var(--mc-pink-box);
	margin: 0;
	flex: 0 0 auto;
	order: 0;
}
.mc-drawer__body li.woocommerce-mini-cart-item a:not(.remove) {
	font-size: 0.9rem;
	line-height: 1.35;
	color: var(--mc-ink);
	text-decoration: none;
	font-weight: 500;
}
.mc-drawer__body .woocommerce-mini-cart-item .quantity {
	display: block;
	margin-top: 4px;
	font-size: 0.85rem;
	color: var(--mc-gray);
}
.mc-drawer__body a.remove {
	position: absolute;
	top: 14px;
	right: 0;
	width: 22px;
	height: 22px;
	line-height: 22px;
	text-align: center;
	border-radius: 50%;
	color: var(--mc-gray) !important;
	font-size: 18px;
}
.mc-drawer__body a.remove:hover {
	background: var(--mc-pink) !important;
	color: #fff !important;
}
.mc-drawer__body .woocommerce-mini-cart__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin: 18px 0 4px;
	padding-top: 16px;
	border-top: 2px solid rgba(22, 22, 26, 0.10);
	font-size: 1.05rem;
}
.mc-drawer__body .woocommerce-mini-cart__total strong { font-weight: 600; }
.mc-drawer__body .woocommerce-mini-cart__total .amount {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--mc-ink);
}

/* Кнопки */
.mc-drawer__body .woocommerce-mini-cart__buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 16px 0 0;
	padding: 0;
}
.mc-drawer__go {
	display: block;
	text-align: center;
	background: var(--mc-ink);
	color: #fff !important;
	padding: 15px 20px;
	border-radius: 30px;
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	transition: background 0.2s ease;
}
.mc-drawer__go:hover { background: #000; }
.mc-drawer__continue {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--mc-gray);
	font-size: 0.95rem;
	padding: 6px;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.mc-drawer__continue:hover { color: var(--mc-ink); }

/* Кнопка «Дозаказать в Telegram» — самодостаточные стили (price-modes.css есть не везде) */
.mc-drawer__tg { margin-top: 6px; }
.mc-tg-chat {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	box-sizing: border-box;
	padding: 12px 18px;
	border-radius: 30px;
	background: transparent;
	color: #229ED9;
	border: 1.5px solid #229ED9;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background 0.18s ease, color 0.18s ease;
}
.mc-tg-chat:hover { background: #229ED9; color: #fff; }
.mc-tg-chat .mc-ico-tg { flex: 0 0 auto; }

/* CTA под итогом заказа (корзина/оформление) */
.mc-reorder-cta {
	font-family: 'Jost', system-ui, sans-serif;
	margin: 16px 0 0;
	text-align: center;
}
.mc-reorder-cta__hint {
	margin: 0 0 10px;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--mc-gray);
}

@media (max-width: 480px) {
	.mc-drawer { width: 100vw; max-width: 100vw; }
	.mc-drawer__head { padding: 16px 18px; }
	.mc-drawer__body { padding: 16px 18px 20px; }
	.mc-drawer__toast { margin: 12px 18px 0; }
}
