/*
 * cart-drawer.css — Mini-cart drawer Peperi Bimbi.
 * Shell in template-parts/global/cart-drawer.php, popolata da cart-drawer.js.
 * Riusa i token :root globali (critical.css).
 */

.pb-cart-overlay {
	position: fixed;
	inset: 0;
	background: rgba(27, 20, 16, .5);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility .3s ease;
	z-index: 1000;
}
.pb-cart-overlay.is-open { opacity: 1; visibility: visible; }

.pb-cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: 420px;
	max-width: 92vw;
	background: var(--bone, #F4EBDD);
	z-index: 1001;
	transform: translateX(100%);
	transition: transform .35s cubic-bezier(.4, 0, .2, 1);
	display: flex;
	flex-direction: column;
	box-shadow: -20px 0 50px rgba(27, 20, 16, .22);
}
.pb-cart-drawer.is-open { transform: translateX(0); }
.pb-cart-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }
body.pb-cd-lock { overflow: hidden; }

/* Head */
.pb-cd-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 22px;
	border-bottom: 1px solid var(--line);
	flex-shrink: 0;
}
.pb-cd-title {
	font-family: 'Fraunces', serif;
	font-weight: 500;
	font-size: 21px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.pb-cd-count {
	background: var(--terra);
	color: #fff;
	font-family: 'Instrument Sans', sans-serif;
	font-size: 12px;
	font-weight: 700;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.pb-cd-close {
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	color: var(--ink-soft);
	cursor: pointer;
	padding: 0 4px;
	transition: color .15s;
}
.pb-cd-close:hover { color: var(--terra); }

/* Barra spedizione */
.pb-cd-ship {
	padding: 14px 22px;
	border-bottom: 1px solid var(--line);
	background: var(--bone-2);
	flex-shrink: 0;
}
.pb-cd-ship-t { font-size: 13.5px; margin-bottom: 8px; }
.pb-cd-ship-bar {
	height: 8px;
	background: var(--bone);
	border-radius: 999px;
	overflow: hidden;
}
.pb-cd-ship-bar i {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--forest), var(--butter));
	border-radius: 999px;
	transition: width .4s ease;
}
.pb-cd-ship.done .pb-cd-ship-bar i { background: var(--forest); }

/* Body */
.pb-cd-body {
	flex: 1;
	overflow-y: auto;
	padding: 8px 22px;
	min-height: 0;
}
.pb-cd-loading { text-align: center; color: var(--mute); padding: 40px 0; }

/* Item */
.pb-cd-item {
	display: grid;
	grid-template-columns: 76px 1fr auto;
	gap: 14px;
	padding: 18px 0;
	border-bottom: 1px solid var(--line);
	position: relative;
	transition: opacity .2s ease;
}
.pb-cd-item.is-removing { opacity: .4; pointer-events: none; }
.pb-cd-thumb {
	width: 76px;
	height: 90px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--bone-2);
	display: block;
}
.pb-cd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pb-cd-thumb-ph {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	font-size: 30px;
	opacity: .5;
}
.pb-cd-info { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pb-cd-name {
	font-family: 'Fraunces', serif;
	font-size: 15.5px;
	font-weight: 500;
	line-height: 1.25;
	color: var(--ink);
}
.pb-cd-name:hover { color: var(--terra); }
.pb-cd-variants { display: flex; flex-wrap: wrap; gap: 6px; }
.pb-cd-vpill {
	font-size: 11.5px;
	background: var(--bone-2);
	border: 1px solid var(--line);
	padding: 3px 9px;
	border-radius: 999px;
	color: var(--ink-soft);
}
.pb-cd-edit {
	align-self: flex-start;
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--terra);
	cursor: pointer;
	text-decoration: underline;
}
.pb-cd-edit:hover { color: var(--terra-deep); }
.pb-cd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.pb-cd-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--line);
	border-radius: 999px;
	overflow: hidden;
	background: var(--bone);
}
.pb-cd-qty button {
	width: 30px;
	height: 30px;
	background: none;
	border: none;
	font-size: 16px;
	cursor: pointer;
	color: var(--ink-soft);
	transition: background .15s;
}
.pb-cd-qty button:hover { background: var(--bone-2); }
.pb-cd-qty span { min-width: 28px; text-align: center; font-weight: 600; font-size: 14px; }
.pb-cd-price { font-weight: 700; font-size: 15px; }
.pb-cd-remove {
	position: absolute;
	top: 16px;
	right: 0;
	background: none;
	border: none;
	font-size: 19px;
	line-height: 1;
	color: var(--mute);
	cursor: pointer;
	padding: 2px;
	transition: color .15s;
}
.pb-cd-remove:hover { color: var(--terra-deep); }

/* Editor variazione inline */
.pb-cd-veditor {
	margin-top: 8px;
	padding: 12px;
	background: var(--bone-2);
	border: 1px solid var(--line);
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.pb-cd-vloading { font-size: 13px; color: var(--mute); }
.pb-cd-vfield { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.pb-cd-vfield select {
	padding: 9px 12px;
	border: 1px solid var(--line);
	border-radius: 7px;
	font: inherit;
	font-size: 14px;
	background: var(--bone);
	color: var(--ink);
}
.pb-cd-verr select { border-color: var(--terra); }
.pb-cd-vsave {
	background: var(--ink);
	color: var(--bone);
	border: none;
	padding: 10px;
	border-radius: 999px;
	font: inherit;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
}
.pb-cd-vsave:hover { background: var(--terra); }
.pb-cd-vlink { font-size: 13px; color: var(--terra); text-decoration: underline; }

/* Empty */
.pb-cd-empty { text-align: center; padding: 50px 24px; margin: auto 0; }
.pb-cd-empty-ico { font-size: 54px; margin-bottom: 12px; }
.pb-cd-empty-t { font-family: 'Fraunces', serif; font-size: 22px; margin-bottom: 6px; }
.pb-cd-empty-s { color: var(--mute); margin-bottom: 22px; }

/* Footer */
.pb-cd-foot {
	border-top: 1px solid var(--line);
	padding: 18px 22px 20px;
	background: var(--bone);
	flex-shrink: 0;
}
.pb-cd-subtotal {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 15px;
	margin-bottom: 2px;
}
.pb-cd-subtotal strong { font-family: 'Fraunces', serif; font-size: 22px; }
.pb-cd-vat { font-size: 11.5px; color: var(--mute); margin-bottom: 14px; }
.pb-cd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: 999px;
	padding: 14px 24px;
	font-family: inherit;
	font-weight: 700;
	font-size: 13.5px;
	text-transform: uppercase;
	letter-spacing: .05em;
	cursor: pointer;
	border: none;
	transition: .18s;
}
.pb-cd-btn-full { width: 100%; }
.pb-cd-btn-terra { background: var(--terra); color: #fff; }
.pb-cd-btn-terra:hover { background: var(--terra-deep); }
.pb-cd-btn-ghost {
	background: transparent;
	color: var(--ink);
	border: 1.5px solid var(--line);
	margin-top: 10px;
}
.pb-cd-btn-ghost:hover { border-color: var(--ink); }
.pb-cd-continue {
	display: block;
	width: 100%;
	background: none;
	border: none;
	margin-top: 14px;
	font: inherit;
	font-size: 13.5px;
	color: var(--ink-soft);
	cursor: pointer;
	padding: 4px;
}
.pb-cd-continue:hover { color: var(--terra); }

@media (max-width: 520px) {
	.pb-cart-drawer { width: 100%; max-width: 100%; }
}
