/*
 * Toysprovider premium AJAX cart drawer.
 * Namespaced `.tp-cd-*`; shares the header's design language (white,
 * Toysprovider orange #f05a28, near-black text, #ededed hairlines).
 */

.tp-cd-root {
	--tp-cd-ink: #16181d;
	--tp-cd-copy: #454a52;
	--tp-cd-muted: #7b8089;
	--tp-cd-line: #ededed;
	--tp-cd-line-2: #e2e3e5;
	--tp-cd-warm: #fff4ec;
	--tp-cd-orange: #f05a28;
	--tp-cd-orange-dark: #d1481b;
	--tp-cd-radius: 14px;
	--tp-cd-ease: cubic-bezier(.22, 1, .36, 1);

	position: fixed;
	inset: 0;
	z-index: 100000;
}
.tp-cd-root[hidden] { display: none; }
.tp-cd-root * { box-sizing: border-box; }

/* ---------- Overlay + drawer shell ---------- */
.tp-cd-overlay {
	position: absolute;
	inset: 0;
	background: rgba(16, 18, 22, .5);
	opacity: 0;
	transition: opacity .3s var(--tp-cd-ease);
}
.tp-cd-root.is-open .tp-cd-overlay { opacity: 1; }

.tp-cd-drawer {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 468px;
	max-width: 100vw;
	display: flex;
	flex-direction: column;
	background: #fff;
	box-shadow: -18px 0 48px rgba(16, 18, 22, .18);
	transform: translateX(100%);
	transition: transform .36s var(--tp-cd-ease);
	will-change: transform;
}
.tp-cd-root.is-open .tp-cd-drawer { transform: translateX(0); }

.tp-cd-drawer,
.tp-cd-drawer * { font-family: inherit; }
.tp-cd-drawer a { text-decoration: none; color: inherit; }
.tp-cd-drawer button { font: inherit; cursor: pointer; }
.tp-cd-drawer :focus-visible {
	outline: 2px solid var(--tp-cd-orange);
	outline-offset: 2px;
	border-radius: 4px;
}

html.tp-cd-lock,
html.tp-cd-lock body { overflow: hidden; }

/* ---------- Head ---------- */
.tp-cd-head {
	flex: 0 0 auto;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 22px 22px 16px;
	border-bottom: 1px solid var(--tp-cd-line);
}
.tp-cd-title {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
	letter-spacing: .01em;
	color: var(--tp-cd-ink);
	text-transform: none;
}
.tp-cd-subcount { margin: 3px 0 0; font-size: 12.5px; color: var(--tp-cd-muted); }
.tp-cd-close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--tp-cd-ink);
	transition: background .16s ease, color .16s ease;
}
.tp-cd-close:hover { background: var(--tp-cd-warm); color: var(--tp-cd-orange); }
.tp-cd-close svg { width: 18px; height: 18px; }

/* ---------- Body (scrolls) ---------- */
.tp-cd-body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 4px 22px;
}
.tp-cd-root.is-busy .tp-cd-body,
.tp-cd-root.is-busy .tp-cd-foot { opacity: .55; pointer-events: none; }
.tp-cd-body,
.tp-cd-foot { transition: opacity .15s ease; }

.tp-cd-items { list-style: none; margin: 0; padding: 0; }
.tp-cd-item {
	display: grid;
	grid-template-columns: 74px 1fr;
	gap: 14px;
	padding: 18px 0;
	border-bottom: 1px solid var(--tp-cd-line);
}
.tp-cd-item__media img {
	width: 74px;
	height: 74px;
	object-fit: cover;
	border-radius: 12px;
	background: #f6f6f7;
	display: block;
}
.tp-cd-item__main { min-width: 0; }
.tp-cd-item__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tp-cd-item__name {
	font-size: 13.5px;
	font-weight: 650;
	line-height: 1.35;
	color: var(--tp-cd-ink);
}
.tp-cd-item__name a:hover { color: var(--tp-cd-orange); }
.tp-cd-item__line-total { flex: 0 0 auto; font-size: 13.5px; font-weight: 800; color: var(--tp-cd-ink); }
.tp-cd-item__meta { margin-top: 3px; font-size: 11.5px; color: var(--tp-cd-muted); }
.tp-cd-item__meta p { margin: 0; }
.tp-cd-item__unit { margin-top: 3px; font-size: 11.5px; color: var(--tp-cd-muted); }
.tp-cd-item__unit .amount { font-weight: 600; }

.tp-cd-item__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 11px;
}
.tp-cd-qty {
	display: inline-flex;
	align-items: center;
	height: 34px;
	border: 1px solid var(--tp-cd-line-2);
	border-radius: 999px;
	overflow: hidden;
}
.tp-cd-qty__btn {
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	color: var(--tp-cd-ink);
	font-size: 16px;
	line-height: 1;
	transition: background .14s ease, color .14s ease;
}
.tp-cd-qty__btn:hover:not(:disabled) { background: var(--tp-cd-warm); color: var(--tp-cd-orange); }
.tp-cd-qty__btn:disabled { opacity: .4; cursor: not-allowed; }
.tp-cd-qty__val { min-width: 30px; text-align: center; font-size: 13px; font-weight: 700; color: var(--tp-cd-ink); }
.tp-cd-item__remove {
	border: 0;
	background: none;
	padding: 4px 2px;
	font-size: 12px;
	color: var(--tp-cd-muted);
	transition: color .14s ease;
}
.tp-cd-item__remove:hover { color: var(--tp-cd-orange); text-decoration: underline; }

/* ---------- Empty state ---------- */
.tp-cd-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 46px 20px 30px;
}
.tp-cd-empty__icon {
	display: grid;
	place-items: center;
	width: 66px;
	height: 66px;
	border-radius: 999px;
	background: var(--tp-cd-warm);
	color: var(--tp-cd-orange);
	margin-bottom: 16px;
}
.tp-cd-empty__icon svg { width: 28px; height: 28px; }
.tp-cd-empty__title { margin: 0 0 6px; font-size: 17px; font-weight: 800; color: var(--tp-cd-ink); }
.tp-cd-empty__text { margin: 0 0 20px; font-size: 13px; color: var(--tp-cd-muted); }
.tp-cd-empty__pop { width: 100%; margin-top: 34px; text-align: left; }
.tp-cd-pop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tp-cd-pop {
	display: block;
	padding: 10px;
	border: 1px solid var(--tp-cd-line);
	border-radius: 12px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.tp-cd-pop:hover { border-color: #dcdcdc; box-shadow: 0 6px 18px rgba(16, 18, 22, .07); }
.tp-cd-pop img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; background: #f6f6f7; }
.tp-cd-pop__name { display: block; margin-top: 8px; font-size: 12px; font-weight: 650; color: var(--tp-cd-ink); }
.tp-cd-pop__price { display: block; margin-top: 2px; font-size: 12px; color: var(--tp-cd-copy); }
.tp-cd-pop__price .amount { font-weight: 700; }

/* ---------- Foot (recommendation / progress / summary) ---------- */
.tp-cd-foot { flex: 0 0 auto; background: #fff; }
.tp-cd-foot:empty { display: none; }

.tp-cd-eyebrow {
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--tp-cd-muted);
}

.tp-cd-rec {
	padding: 14px 22px;
	border-top: 1px solid var(--tp-cd-line);
	background: #fffdfb;
}
.tp-cd-rec__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tp-cd-rec__nav { display: inline-flex; gap: 6px; }
.tp-cd-rec__arrow {
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--tp-cd-line-2);
	border-radius: 999px;
	background: #fff;
	color: var(--tp-cd-ink);
	font-size: 15px;
	line-height: 1;
	transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.tp-cd-rec__arrow:hover { background: var(--tp-cd-warm); color: var(--tp-cd-orange); border-color: var(--tp-cd-warm); }
.tp-cd-rec__track { position: relative; }
.tp-cd-rec__card { display: none; grid-template-columns: 66px 1fr; gap: 12px; align-items: center; }
.tp-cd-rec__card.is-active { display: grid; }
.tp-cd-rec__media img {
	width: 66px;
	height: 66px;
	object-fit: cover;
	border-radius: 12px;
	background: #f6f6f7;
	display: block;
}
.tp-cd-rec__body { min-width: 0; }
.tp-cd-rec__name {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--tp-cd-ink);
}
.tp-cd-rec__name:hover { color: var(--tp-cd-orange); }
.tp-cd-rec__blurb {
	margin: 2px 0 0;
	font-size: 11.5px;
	color: var(--tp-cd-muted);
	line-height: 1.35;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
}
.tp-cd-rec__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.tp-cd-rec__price { font-size: 13px; font-weight: 800; color: var(--tp-cd-ink); }
.tp-cd-rec__price .amount { font-weight: 800; }
.tp-cd-rec__price del { font-weight: 500; color: var(--tp-cd-muted); margin-right: 4px; }

/* ---------- Progress ---------- */
.tp-cd-progress {
	padding: 13px 22px;
	border-top: 1px solid var(--tp-cd-line);
}
.tp-cd-progress__msg {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 600;
	color: var(--tp-cd-copy);
	letter-spacing: .01em;
}
.tp-cd-progress__msg strong { font-weight: 800; color: var(--tp-cd-ink); }
.tp-cd-progress__check { color: var(--tp-cd-orange); font-weight: 900; }
.tp-cd-progress[data-reached="1"] .tp-cd-progress__msg { color: var(--tp-cd-orange-dark); font-weight: 800; }
.tp-cd-progress__track {
	height: 8px;
	border-radius: 999px;
	background: #f0f0f0;
	overflow: hidden;
}
.tp-cd-progress__track i {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--tp-cd-orange), #ff7a45);
	transition: width .45s var(--tp-cd-ease);
}

/* ---------- Summary + checkout ---------- */
.tp-cd-summary {
	padding: 16px 22px 20px;
	border-top: 1px solid var(--tp-cd-line);
	box-shadow: 0 -6px 18px rgba(16, 18, 22, .04);
}
.tp-cd-summary__row { display: flex; align-items: baseline; justify-content: space-between; }
.tp-cd-summary__row > span:first-child { font-size: 14px; font-weight: 650; color: var(--tp-cd-ink); }
.tp-cd-summary__value { font-size: 17px; font-weight: 800; color: var(--tp-cd-ink); }
.tp-cd-summary__value .amount { font-weight: 800; }
.tp-cd-summary__note { margin: 5px 0 13px; font-size: 11.5px; color: var(--tp-cd-muted); }

.tp-cd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 12px;
	font-weight: 800;
	text-align: center;
	transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
}
.tp-cd-btn:active { transform: translateY(1px); }
.tp-cd-btn--primary {
	padding: 13px 24px;
	background: var(--tp-cd-orange);
	color: #fff;
	font-size: 13px;
	letter-spacing: .03em;
}
.tp-cd-btn--primary:hover { background: var(--tp-cd-orange-dark); }
.tp-cd-btn--ghost {
	padding: 7px 16px;
	border: 1px solid var(--tp-cd-orange);
	border-radius: 999px;
	background: #fff;
	color: var(--tp-cd-orange);
	font-size: 12px;
	font-weight: 800;
}
.tp-cd-btn--ghost:hover { background: var(--tp-cd-orange); color: #fff; }
.tp-cd-btn--ghost[disabled] { opacity: .55; pointer-events: none; }
.tp-cd-btn--checkout {
	width: 100%;
	height: 52px;
	background: var(--tp-cd-ink);
	color: #fff;
	font-size: 14px;
	letter-spacing: .05em;
}
.tp-cd-btn--checkout:hover { background: #000; }
.tp-cd-continue {
	display: block;
	width: 100%;
	margin-top: 10px;
	padding: 6px;
	border: 0;
	background: none;
	color: var(--tp-cd-muted);
	font-size: 12px;
	transition: color .14s ease;
}
.tp-cd-continue:hover { color: var(--tp-cd-orange); text-decoration: underline; }

.tp-cd-toast {
	position: absolute;
	left: 22px;
	right: 22px;
	bottom: 16px;
	padding: 11px 14px;
	border-radius: 10px;
	background: var(--tp-cd-ink);
	color: #fff;
	font-size: 12.5px;
	font-weight: 600;
	text-align: center;
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
	z-index: 5;
}
.tp-cd-toast.is-show { opacity: 1; transform: translateY(0); }
.tp-cd-toast.is-error { background: #b3261e; }

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
	.tp-cd-drawer { width: 100vw; }
	.tp-cd-body { padding-inline: 18px; }
	.tp-cd-head,
	.tp-cd-rec,
	.tp-cd-progress,
	.tp-cd-summary { padding-inline: 18px; }
	.tp-cd-rec__blurb { display: none; }
	.tp-cd-btn--checkout { height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
	.tp-cd-overlay,
	.tp-cd-drawer,
	.tp-cd-progress__track i,
	.tp-cd-toast { transition-duration: .01ms !important; }
}
