/**
 * Cart Drawer — slide-in panel from right.
 *
 * Theming via CSS custom properties (BTF-compatible):
 * --bcom-drawer-width: 420px
 * --bcom-drawer-bg: #fff
 * --bcom-drawer-overlay: rgba(0,0,0,.45)
 * --bcom-accent: #111
 * --bcom-accent-hover: #333
 * --bcom-border: #e5e5e5
 * --bcom-text: #1a1a1a
 * --bcom-text-muted: #777
 * --bcom-radius: 0
 */

/* ─── Drawer shell ───────────────────────────────────────────── */
.bcom-drawer {
	position: fixed;
	inset: 0;
	z-index: 99999;
	pointer-events: none;
	visibility: hidden;
}
.bcom-drawer--open {
	pointer-events: auto;
	visibility: visible;
}

/* ─── Overlay ────────────────────────────────────────────────── */
.bcom-drawer__overlay {
	position: absolute;
	inset: 0;
	background: var(--bcom-drawer-overlay, rgba(0,0,0,.45));
	opacity: 0;
	transition: opacity .3s ease;
}
.bcom-drawer--open .bcom-drawer__overlay {
	opacity: 1;
}

/* ─── Panel ──────────────────────────────────────────────────── */
.bcom-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: var(--bcom-drawer-width, 420px);
	max-width: 92vw;
	background: var(--bcom-drawer-bg, #fff);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform .35s cubic-bezier(.16,1,.3,1);
	box-shadow: -4px 0 24px rgba(0,0,0,.12);
}
.bcom-drawer--open .bcom-drawer__panel {
	transform: translateX(0);
}

/* ─── Header ─────────────────────────────────────────────────── */
.bcom-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid var(--bcom-border, #e5e5e5);
	flex-shrink: 0;
}
.bcom-drawer__title {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--bcom-text, #1a1a1a);
	margin: 0;
}
.bcom-drawer__close {
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--bcom-text-muted, #777);
	padding: 0 4px;
	transition: color .15s;
}
.bcom-drawer__close:hover {
	color: var(--bcom-text, #1a1a1a);
}

/* ─── Body (scrollable items) ────────────────────────────────── */
.bcom-drawer__body {
	flex: 1;
	overflow-y: auto;
	padding: 0;
	-webkit-overflow-scrolling: touch;
}

/* ─── Empty state ────────────────────────────────────────────── */
.bcom-drawer__empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	color: var(--bcom-text-muted, #777);
	font-size: 15px;
	text-align: center;
	padding: 40px 24px;
}

/* ─── Cart item ──────────────────────────────────────────────── */
.bcom-drawer-item {
	display: grid;
	grid-template-columns: 72px 1fr 28px;
	gap: 14px;
	padding: 16px 24px;
	border-bottom: 1px solid var(--bcom-border, #e5e5e5);
	align-items: start;
}
.bcom-drawer-item__img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: var(--bcom-radius, 0);
	background: #f5f5f5;
}
.bcom-drawer-item__img--placeholder {
	display: block;
}
.bcom-drawer-item__info {
	min-width: 0;
}
.bcom-drawer-item__name {
	font-size: 14px;
	font-weight: 500;
	color: var(--bcom-text, #1a1a1a);
	line-height: 1.35;
	margin-bottom: 2px;
}
.bcom-drawer-item__variant {
	font-size: 12px;
	color: var(--bcom-text-muted, #777);
	margin-bottom: 6px;
}
.bcom-drawer-item__price {
	font-size: 14px;
	font-weight: 600;
	color: var(--bcom-text, #1a1a1a);
	margin-bottom: 8px;
}
.bcom-drawer-item__remove {
	background: none;
	border: none;
	font-size: 18px;
	color: var(--bcom-text-muted, #777);
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: color .15s;
	align-self: start;
	margin-top: 2px;
}
.bcom-drawer-item__remove:hover {
	color: #dc3232;
}

/* ─── Quantity control ───────────────────────────────────────── */
.bcom-drawer-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--bcom-border, #e5e5e5);
	border-radius: var(--bcom-radius, 0);
	overflow: hidden;
}
.bcom-drawer-qty__btn {
	background: none;
	border: none;
	width: 32px;
	height: 32px;
	font-size: 16px;
	cursor: pointer;
	color: var(--bcom-text, #1a1a1a);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
}
.bcom-drawer-qty__btn:hover {
	background: #f5f5f5;
}
.bcom-drawer-qty__input {
	width: 40px;
	height: 32px;
	border: none;
	border-left: 1px solid var(--bcom-border, #e5e5e5);
	border-right: 1px solid var(--bcom-border, #e5e5e5);
	text-align: center;
	font-size: 13px;
	font-weight: 500;
	-moz-appearance: textfield;
	color: var(--bcom-text, #1a1a1a);
}
.bcom-drawer-qty__input::-webkit-outer-spin-button,
.bcom-drawer-qty__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.bcom-drawer__footer {
	flex-shrink: 0;
	padding: 20px 24px;
	border-top: 1px solid var(--bcom-border, #e5e5e5);
	background: var(--bcom-drawer-bg, #fff);
}
.bcom-drawer__totals {
	margin-bottom: 16px;
}
.bcom-drawer__total-row {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	padding: 4px 0;
	color: var(--bcom-text-muted, #777);
}
.bcom-drawer__total-row--grand {
	font-size: 16px;
	font-weight: 600;
	color: var(--bcom-text, #1a1a1a);
	padding: 6px 0;
}

/* ─── Checkout button ────────────────────────────────────────── */
.bcom-drawer__checkout-btn {
	display: block;
	width: 100%;
	padding: 14px;
	background: var(--boost-btn-primary-bg, var(--boost-primary, var(--wp--preset--color--primary, var(--bcom-accent, #111))));
	color: var(--boost-btn-primary-text, var(--boost-text-inverse, #fff));
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	border: none;
	border-radius: var(--boost-radius, var(--bcom-radius, 6px));
	cursor: pointer;
	transition: background .2s;
}
.bcom-drawer__checkout-btn:hover {
	background: var(--boost-btn-primary-hover, var(--boost-primary-hover, #333));
	color: var(--boost-btn-primary-text, #fff);
}
.bcom-drawer__cart-link {
	display: block;
	text-align: center;
	margin-top: 10px;
	font-size: 13px;
	color: var(--bcom-text-muted, #777);
	text-decoration: underline;
}
.bcom-drawer__cart-link:hover {
	color: var(--bcom-text, #1a1a1a);
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
	.bcom-drawer__panel {
		width: 100vw;
		max-width: 100vw;
	}
}

/* ─── Mini-cart (header icon + badge) ────────────────────────── */
.bcom-mini-cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	padding: 4px;
}
.bcom-mini-cart__icon {
	display: flex;
	align-items: center;
}
.bcom-mini-cart__icon svg {
	display: block;
}
.bcom-mini-cart-count {
	position: absolute;
	top: -4px;
	right: -6px;
	background: var(--bcom-accent, #111);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	min-width: 18px;
	height: 18px;
	border-radius: 9px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
	line-height: 1;
}
.bcom-mini-cart__text {
	font-size: 14px;
	font-weight: 500;
}
