/* PB Košarica (prototip: .cartbtn, .drawer, .citem, .sumline) */
.pbw-cart button.pbw-cart__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 4px;
	border: 0;
	background: none;
	color: var(--text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.pbw-cart button.pbw-cart__toggle:hover,
.pbw-cart button.pbw-cart__toggle:focus {
	background: none;
	color: var(--text);
}

.pbw-cart__toggle svg {
	width: 22px;
	height: 22px;
	flex: none;
}

.pbw-cart__count {
	display: grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: var(--accent);
	color: var(--on-accent);
	font-size: .76rem;
	line-height: 1;
}

.pbw-cart__count[hidden] {
	display: none;
}

/* Scrim i ladica (position: fixed, iznad cijele stranice) */
.pbw-cart__scrim {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	transition: opacity .2s;
}

.pbw-cart__scrim.is-open {
	opacity: 1;
}

.pbw-cart__drawer {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	right: 0;
	bottom: 0;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	width: min(420px, 100vw);
	background: var(--bg);
	color: var(--text);
	font-family: var(--pbw-f-body);
	box-shadow: var(--pbw-shadow);
	transform: translateX(100%);
	transition: transform .2s ease-out;
}

.pbw-cart__drawer.is-open {
	transform: none;
}

.pbw-cart__scrim[hidden],
.pbw-cart__drawer[hidden] {
	display: none;
}

html.pbw-cart-lock {
	overflow: hidden;
}

.pbw-cart__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--border);
}

.pbw-cart__title {
	margin: 0;
	font-size: 1.08rem;
	font-weight: 600;
}

.pbw-cart button.pbw-cart__close {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: var(--pbw-r);
	background: none;
	color: var(--text);
	cursor: pointer;
}

.pbw-cart button.pbw-cart__close:hover {
	background: var(--bg-alt);
	color: var(--text);
}

.pbw-cart__close svg {
	width: 22px;
	height: 22px;
}

.pbw-cart__body {
	flex: 1;
	overflow-y: auto;
	padding: 16px 20px;
}

.pbw-cart__free {
	margin-bottom: 16px;
	padding: 10px 12px;
	border-radius: var(--pbw-r);
	background: var(--bg-alt);
	color: var(--accent-hover);
	font-size: .9rem;
	line-height: 1.45;
}

.pbw-cart__free[hidden] {
	display: none;
}

.pbw-cart__items[aria-busy="true"] {
	opacity: .6;
	pointer-events: none;
}

.pbw-cart__item {
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--border);
}

.pbw-cart__thumb {
	display: block;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: var(--pbw-r);
	background: var(--bg-alt);
}

.pbw-cart__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.pbw-cart__info {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.pbw-cart a.pbw-cart__name {
	color: var(--text);
	font-weight: 600;
	font-size: .95rem;
	line-height: 1.3;
	text-decoration: none;
}

.pbw-cart a.pbw-cart__name:hover {
	color: var(--text);
	text-decoration: underline;
}

.pbw-cart__ctrl {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.pbw-cart__qty {
	display: flex;
	align-items: center;
	border: 1px solid var(--border);
	border-radius: var(--pbw-r);
}

.pbw-cart .pbw-cart__qty button {
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--text);
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
}

.pbw-cart .pbw-cart__qty button:hover {
	background: var(--bg-alt);
	color: var(--text);
}

.pbw-cart .pbw-cart__qty button:disabled {
	opacity: .35;
	cursor: default;
}

.pbw-cart__qty span {
	min-width: 28px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.pbw-cart__price {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pbw-cart button.pbw-cart__remove {
	align-self: flex-start;
	padding: 0;
	border: 0;
	background: none;
	color: var(--text-secondary);
	font-size: .84rem;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.pbw-cart button.pbw-cart__remove:hover {
	background: none;
	color: var(--text);
}

.pbw-cart__empty {
	padding: 40px 12px;
	text-align: center;
	color: var(--text-secondary);
}

.pbw-cart__empty p {
	margin: 0 0 14px;
}

.pbw-cart a.pbw-cart__empty-btn,
.pbw-cart a.pbw-cart__checkout {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 14px;
	border-radius: var(--pbw-r);
	background: var(--accent);
	color: var(--on-accent);
	font-weight: 600;
	font-size: .9rem;
	text-decoration: none;
}

.pbw-cart a.pbw-cart__empty-btn:hover {
	background: var(--accent-hover);
	color: var(--on-accent);
}

.pbw-cart__foot {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px 20px 20px;
	border-top: 1px solid var(--border);
}

.pbw-cart__foot[hidden] {
	display: none;
}

.pbw-cart__line {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: .95rem;
}

.pbw-cart__line span:last-child {
	font-variant-numeric: tabular-nums;
}

.pbw-cart__line--total {
	padding-top: 8px;
	border-top: 1px solid var(--border);
	font-weight: 600;
	font-size: 1.05rem;
}

.pbw-cart a.pbw-cart__checkout {
	width: 100%;
	margin-top: 8px;
	padding: 13px 22px;
	font-size: 1rem;
	color: var(--on-accent);
}

.pbw-cart a.pbw-cart__checkout:hover,
.pbw-cart a.pbw-cart__checkout:focus-visible {
	background: var(--accent-hover);
	color: var(--on-accent);
}

.pbw-cart__trust {
	color: var(--text-secondary);
	font-size: .82rem;
	text-align: center;
}

.pbw-cart__drawer a:focus-visible,
.pbw-cart__drawer button:focus-visible,
.pbw-cart__toggle:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.pbw-cart__drawer,
	.pbw-cart__scrim {
		transition: none;
	}
}
