/**
 * VDF BR — Cart Drawer (slide-out lateral)
 * Mobile-first. 92vw mobile / 420px desktop.
 * Decisões em /tmp/vdf-audit/cart-drawer-research-2026-04-24.md
 */

:root {
	--vdfc-navy: #1E3A5F;
	--vdfc-gold: #C9A961;
	--vdfc-cream: #F5F1E8;
	--vdfc-green: #16A34A;
	--vdfc-g100: #F3F4F6;
	--vdfc-g200: #E5E7EB;
	--vdfc-g600: #6B7280;
	--vdfc-g900: #111827;
	--vdfc-radius: 6px;
	--vdfc-shadow: 0 -8px 24px rgba(17,24,39,.08);
}

/* ─── ROOT ─── */
.vdf-cart-drawer {
	position: fixed;
	inset: 0;
	z-index: 9999;
	pointer-events: none;
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.vdf-cart-drawer[aria-hidden="false"],
.vdf-cart-drawer.is-open { pointer-events: auto; }

/* ─── BACKDROP ─── */
.vdf-cart-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.5);
	opacity: 0;
	transition: opacity 300ms ease;
}
.vdf-cart-drawer.is-open .vdf-cart-drawer__backdrop { opacity: 1; }

/* ─── PANEL ─── */
.vdf-cart-drawer__panel {
	position: absolute;
	top: 0; right: 0; bottom: 0;
	width: 92vw;
	max-width: 420px;
	background: #fff;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 300ms ease;
	box-shadow: var(--vdfc-shadow);
}
.vdf-cart-drawer.is-open .vdf-cart-drawer__panel { transform: translateX(0); }

@media (min-width: 768px) {
	.vdf-cart-drawer__panel { width: 420px; }
}

/* ─── HEADER ─── */
.vdf-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--vdfc-g200);
	background: #fff;
	flex-shrink: 0;
}
.vdf-cart-drawer__title {
	margin: 0;
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 18px;
	font-weight: 700;
	color: var(--vdfc-navy);
	line-height: 1.2;
}
.vdf-cart-drawer__close {
	border: 0;
	background: transparent;
	font-size: 22px;
	cursor: pointer;
	color: var(--vdfc-g600);
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}
.vdf-cart-drawer__close:hover { background: var(--vdfc-g100); color: var(--vdfc-navy); }

/* ─── BODY (scroll) ─── */
.vdf-cart-drawer__body {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 16px 20px;
}

/* ─── PROGRESS BAR FRETE GRÁTIS (sticky top do body, fundo opaco para cobrir scroll) ─── */
.vdf-cart-drawer__progress {
	position: sticky;
	top: -16px;
	margin: -16px -20px 16px;
	padding: 12px 20px;
	background: #FFF8E7; /* fundo opaco creme — cobre items abaixo no scroll */
	border-bottom: 1px solid var(--vdfc-gold);
	box-shadow: 0 2px 6px rgba(17,24,39,.06);
	z-index: 5;
}
.vdf-cart-drawer__progress.is-reached {
	background: #E8F7EE; /* opaco verde claro */
	border-bottom-color: var(--vdfc-green);
}
.vdf-cart-drawer__progress-text {
	font-size: 13px;
	color: var(--vdfc-g900);
	margin-bottom: 8px;
	line-height: 1.35;
}
.vdf-cart-drawer__progress-text strong { color: var(--vdfc-navy); font-weight: 700; }
.vdf-cart-drawer__progress.is-reached .vdf-cart-drawer__progress-text strong { color: var(--vdfc-green); }
.vdf-cart-drawer__progress-bar {
	height: 6px;
	background: rgba(201,169,97,0.2);
	border-radius: 999px;
	overflow: hidden;
}
.vdf-cart-drawer__progress.is-reached .vdf-cart-drawer__progress-bar { background: rgba(22,163,74,0.2); }
.vdf-cart-drawer__progress-fill {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--vdfc-gold), #e0c178);
	border-radius: 999px;
	transition: width 400ms ease;
}
.vdf-cart-drawer__progress.is-reached .vdf-cart-drawer__progress-fill {
	background: linear-gradient(90deg, var(--vdfc-green), #22c55e);
}

/* ─── ITEMS ─── */
.vdf-cart-drawer__items {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.vdf-cart-drawer__item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--vdfc-g200);
}
.vdf-cart-drawer__item:last-child { border-bottom: none; padding-bottom: 0; }
.vdf-cart-drawer__item-thumb {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: var(--vdfc-radius);
	background: var(--vdfc-cream);
	flex-shrink: 0;
}
.vdf-cart-drawer__item-body { flex: 1; min-width: 0; }
.vdf-cart-drawer__item-name {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: var(--vdfc-navy);
	text-decoration: none;
	margin-bottom: 6px;
	line-height: 1.3;
}
.vdf-cart-drawer__item-name:hover { text-decoration: underline; }
.vdf-cart-drawer__item-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.vdf-cart-drawer__item-price {
	font-size: 14px;
	font-weight: 700;
	color: var(--vdfc-navy);
}
.vdf-cart-drawer__item-remove {
	border: 0;
	background: transparent;
	font-size: 16px;
	cursor: pointer;
	color: var(--vdfc-g600);
	padding: 4px 6px;
	flex-shrink: 0;
	align-self: flex-start;
}
.vdf-cart-drawer__item-remove:hover { color: #dc2626; }

/* ─── QTY STEPPER ─── */
.vdf-cart-drawer__qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--vdfc-g200);
	border-radius: var(--vdfc-radius);
	overflow: hidden;
	background: #fff;
}
.vdf-cart-drawer__qty-btn {
	border: 0;
	background: transparent;
	width: 28px;
	height: 28px;
	font-size: 16px;
	cursor: pointer;
	color: var(--vdfc-navy);
	display: flex;
	align-items: center;
	justify-content: center;
}
.vdf-cart-drawer__qty-btn:hover { background: var(--vdfc-g100); }
.vdf-cart-drawer__qty-val {
	min-width: 24px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--vdfc-g900);
}

/* ─── EMPTY STATE ─── */
.vdf-cart-drawer__empty {
	text-align: center;
	padding: 32px 0;
	color: var(--vdfc-g600);
	list-style: none;
}
.vdf-cart-drawer__empty p { margin: 0 0 16px; font-size: 14px; }
.vdf-cart-drawer__empty-cta {
	display: inline-block;
	padding: 10px 20px;
	background: var(--vdfc-navy);
	color: #fff !important;
	text-decoration: none;
	border-radius: var(--vdfc-radius);
	font-size: 13px;
	font-weight: 600;
}

/* ─── UPSELL ─── */
.vdf-cart-drawer__upsell {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px dashed var(--vdfc-g200);
}
.vdf-cart-drawer__upsell-title {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 700;
	color: var(--vdfc-navy);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.vdf-cart-drawer__upsell ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.vdf-cart-drawer__upsell li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	background: var(--vdfc-g100);
	border-radius: var(--vdfc-radius);
}
.vdf-cart-drawer__upsell img {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 4px;
	background: #fff;
	flex-shrink: 0;
}
.vdf-cart-drawer__upsell li > div { flex: 1; min-width: 0; }
.vdf-cart-drawer__upsell-name {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: var(--vdfc-navy);
	text-decoration: none;
	line-height: 1.3;
	margin-bottom: 2px;
}
.vdf-cart-drawer__upsell-price {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: var(--vdfc-navy);
}
.vdf-cart-drawer__upsell-add {
	border: 0;
	background: var(--vdfc-gold);
	color: var(--vdfc-navy);
	width: 32px;
	height: 32px;
	font-size: 18px;
	font-weight: 700;
	border-radius: 50%;
	cursor: pointer;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.vdf-cart-drawer__upsell-add:hover { background: #b89651; }
.vdf-cart-drawer__upsell-add:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── COUPON (collapsed por padrão, anti-pattern Baymard se aberto) ─── */
.vdf-cart-drawer__coupon {
	margin-top: 16px;
	padding: 10px 0;
	border-top: 1px solid var(--vdfc-g200);
}
.vdf-cart-drawer__coupon summary {
	cursor: pointer;
	font-size: 13px;
	color: var(--vdfc-g600);
	padding: 4px 0;
	list-style: none;
}
.vdf-cart-drawer__coupon summary::-webkit-details-marker { display: none; }
.vdf-cart-drawer__coupon summary::before { content: '＋ '; color: var(--vdfc-gold); font-weight: 700; }
.vdf-cart-drawer__coupon[open] summary::before { content: '− '; }
.vdf-cart-drawer__coupon-row {
	display: flex;
	gap: 6px;
	margin-top: 8px;
}
.vdf-cart-drawer__coupon-input {
	flex: 1;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--vdfc-g200);
	border-radius: var(--vdfc-radius);
	font-size: 13px;
	background: #fff;
}
.vdf-cart-drawer__coupon-apply {
	border: 0;
	background: var(--vdfc-navy);
	color: #fff;
	padding: 0 14px;
	height: 36px;
	border-radius: var(--vdfc-radius);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	cursor: pointer;
}
.vdf-cart-drawer__coupon-msg {
	font-size: 12px;
	color: var(--vdfc-g600);
	margin-top: 6px;
	min-height: 16px;
}

/* ─── TOTALS ─── */
.vdf-cart-drawer__totals {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 14px 0 6px;
	border-top: 1px solid var(--vdfc-g200);
	margin-top: 16px;
}
.vdf-cart-drawer__totals-label {
	font-size: 14px;
	color: var(--vdfc-g600);
}
.vdf-cart-drawer__totals-val {
	font-size: 22px;
	font-weight: 700;
	color: var(--vdfc-navy);
}

/* ─── FOOTER (sticky bottom) ─── */
.vdf-cart-drawer__footer {
	flex-shrink: 0;
	padding: 16px 20px 20px;
	border-top: 1px solid var(--vdfc-g200);
	background: #fff;
}
.vdf-cart-drawer__cta {
	display: block;
	width: 100%;
	min-height: 52px;
	line-height: 52px;
	background: var(--vdfc-gold) !important;
	color: var(--vdfc-navy) !important;
	text-align: center;
	font-weight: 700;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	text-decoration: none !important;
	border-radius: var(--vdfc-radius);
	box-shadow: 0 1px 2px rgba(17,24,39,.05), 0 2px 8px rgba(30,58,95,.08);
}
.vdf-cart-drawer__cta:hover { background: #b89651 !important; }
.vdf-cart-drawer__continue {
	display: block;
	width: 100%;
	margin-top: 10px;
	border: 0;
	background: transparent;
	color: var(--vdfc-g600);
	font-size: 13px;
	cursor: pointer;
	padding: 8px;
}
.vdf-cart-drawer__continue:hover { color: var(--vdfc-navy); text-decoration: underline; }
.vdf-cart-drawer__trust {
	list-style: none;
	margin: 14px 0 0;
	padding: 12px 0 0;
	border-top: 1px dashed var(--vdfc-g200);
	display: flex;
	justify-content: space-around;
	gap: 6px;
}
.vdf-cart-drawer__trust li {
	font-size: 11px;
	color: var(--vdfc-g600);
	display: flex;
	align-items: center;
	gap: 4px;
}
