/* ==========================================================================
   CART DRAWER — Slide-out panel
   ========================================================================== */

.bb-cart-drawer {
	background: #fff;
	bottom: 0;
	box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
	display: flex;
	flex-direction: column;
	max-width: 90vw;
	position: fixed;
	right: 0;
	top: 0;
	transform: translateX(100%);
	transition: transform 0.3s ease;
	width: 400px;
	z-index: 210;
}

.bb-cart-drawer.is-open {
	transform: translateX(0);
}

.bb-cart-drawer__overlay {
	background: rgba(0, 0, 0, 0.4);
	bottom: 0;
	left: 0;
	opacity: 0;
	pointer-events: none;
	position: fixed;
	right: 0;
	top: 0;
	transition: opacity 0.3s ease;
	z-index: 209;
}

.bb-cart-drawer__overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

/* Header */
.bb-cart-drawer__header {
	align-items: center;
	border-bottom: 1px solid var(--bb-border, #e0dbd5);
	display: flex;
	justify-content: space-between;
	padding: 1rem 1.25rem;
}

.bb-cart-drawer__title {
	font-family: var(--k-font-heading, Georgia, serif);
	font-size: 1.1rem;
	margin: 0;
}

.bb-cart-drawer__close {
	background: none;
	border: none;
	color: #aaa;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.25rem;
	transition: color 0.2s ease;
}

.bb-cart-drawer__close:hover {
	background-color: var(--bb-cream, #f5f0eb);
	border-radius: 50%;
}

/* Inner — scrollable area */
.bb-cart-drawer__inner {
	flex: 1;
	overflow-y: auto;
}


/* ==========================================================================
   MINI CART ITEMS
   ========================================================================== */

.bb-mini-cart__items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bb-mini-cart__item {
	border-bottom: 1px solid var(--bb-border, #e0dbd5);
	display: flex;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
}

.bb-mini-cart__thumb {
	flex-shrink: 0;
	width: 72px;
}

.bb-mini-cart__thumb img {
	border-radius: 4px;
	display: block;
	height: auto;
	width: 100%;
}

.bb-mini-cart__details {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.bb-mini-cart__name {
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.3;
}

.bb-mini-cart__name a {
	color: var(--bb-text-dark, #1a1a1a);
	text-decoration: none;
}

.bb-mini-cart__name a:hover {
	color: var(--bb-teal, #5b9a96);
}

.bb-mini-cart__name .variation {
	color: #777;
	display: block;
	font-size: 0.8rem;
	font-weight: 400;
	margin-top: 0.15rem;
}

.bb-mini-cart__price {
	color: #555;
	font-size: 0.85rem;
}

.bb-mini-cart__qty-row {
	align-items: center;
	display: flex;
	gap: 0.75rem;
	margin-top: 0.25rem;
}

/* Quantity +/- */
.bb-mini-cart__qty {
	align-items: center;
	border: 1px solid var(--bb-border, #e0dbd5);
	border-radius: 4px;
	display: inline-flex;
}

.bb-mini-cart__qty-btn {
	align-items: center;
	background: none;
	border: none;
	color: var(--bb-text-dark, #1a1a1a);
	cursor: pointer;
	display: flex;
	font-size: 1rem;
	height: 28px;
	justify-content: center;
	padding: 0;
	transition: color 0.2s ease;
	width: 28px;
}

.bb-mini-cart__qty-btn:hover {
	background-color: var(--bb-cream, #f5f0eb);
}

.bb-mini-cart__qty-value {
	font-size: 0.85rem;
	min-width: 24px;
	text-align: center;
}

/* Remove button */
.bb-mini-cart__remove {
	background: none;
	border: none;
	color: #bbb;
	cursor: pointer;
	font-size: 1.2rem;
	line-height: 1;
	margin-left: auto;
	padding: 0.25rem;
	transition: color 0.2s ease;
}

.bb-mini-cart__remove:hover {
	color: #999;
}


/* ==========================================================================
   MINI CART FOOTER
   ========================================================================== */

.bb-mini-cart__footer {
	border-top: 1px solid var(--bb-border, #e0dbd5);
	padding: 1rem 1.25rem;
}

.bb-mini-cart__subtotal {
	display: flex;
	font-size: 1rem;
	font-weight: 600;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.bb-mini-cart__buttons {
	display: flex;
	gap: 0.5rem;
}

.bb-mini-cart__buttons .bb-btn {
	flex: 1;
	text-align: center;
}


/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.bb-mini-cart__empty {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	justify-content: center;
	padding: 3rem 1.25rem;
	text-align: center;
}

.bb-mini-cart__empty p {
	color: #777;
	font-size: 1rem;
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

/* Items fade in when drawer content is replaced (add-to-cart only) */
.bb-mini-cart__item {
	animation: bbFadeIn 0.2s ease;
}

.bb-mini-cart__empty {
	animation: bbFadeIn 0.2s ease;
}

.bb-mini-cart__footer {
	animation: bbFadeIn 0.2s ease 0.05s both;
}

@keyframes bbFadeIn {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Suppress all animations during qty/remove updates (no flash) */
.bb-cart-drawer__inner.no-animate .bb-mini-cart__item,
.bb-cart-drawer__inner.no-animate .bb-mini-cart__empty,
.bb-cart-drawer__inner.no-animate .bb-mini-cart__footer {
	animation: none;
}

/* Fade out item being removed */
.bb-mini-cart__item.is-removing {
	opacity: 0.3;
	transition: opacity 0.15s ease;
}

/* Cart count badge pulse when updated */
.bb-header__cart-count {
	transition: transform 0.2s ease;
}

.bb-header__cart-count.is-updating {
	animation: bbBadgePulse 0.3s ease;
}

@keyframes bbBadgePulse {
	0%   { transform: scale(1); }
	50%  { transform: scale(1.25); }
	100% { transform: scale(1); }
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 480px) {
	.bb-cart-drawer {
		max-width: 100vw;
		width: 100vw;
	}
}
