/* ==========================================================================
   La Buchette — Drawer Cart
   Slide-in from the right. Triggered by .open-cart-preview clicks and by
   the WC 'added_to_cart' event.
   ========================================================================== */

:root {
	--lbc-primary: #71331C;
	--lbc-primary-dark: #4a1f10;
	--lbc-black: #000000;
	--lbc-body: #4a4a4a;
	--lbc-muted: #888;
	--lbc-border: #E0E0E0;
	--lbc-bg: #ffffff;
	--lbc-bg-soft: #f6f6f6;
	--lbc-radius: 5px;
	--lbc-trans: 0.25s ease;
	--lbc-ff: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Hide WC's "View cart →" link that appears next to archive add-to-cart
   buttons after AJAX add. Our drawer + header icon already cover this. */
a.added_to_cart,
a.added_to_cart.wc-forward,
.woocommerce a.added_to_cart {
	display: none !important;
}

/* ---------- Header cart icon shortcode wrapper -------------------------- */
.lb-header-cart-wrap {
	display: inline-flex;
	align-items: center;
}

.lb-header-cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--lbc-black);
	text-decoration: none;
	transition: color var(--lbc-trans);
	padding: 6px;
}

.lb-header-cart:hover {
	color: var(--lbc-primary);
}

.lb-header-cart .header-cart-count {
	position: absolute;
	top: -4px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: var(--lbc-primary);
	color: #fff;
	border-radius: 100px;
	font-family: var(--lbc-ff);
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
	box-sizing: border-box;
}

.lb-header-cart .header-cart-count.is-hidden {
	display: none;
}

/* ---------- Popup container --------------------------------------------- */
.cart-preview-popup {
	position: fixed;
	inset: 0;
	z-index: 99998;
	font-family: var(--lbc-ff);
	color: var(--lbc-body);
	pointer-events: none;
}

.cart-preview-popup * {
	box-sizing: border-box;
}

.cart-preview-popup.is-open {
	pointer-events: auto;
}

/* ---------- Overlay ----------------------------------------------------- */
.cart-preview-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	opacity: 0;
	transition: opacity var(--lbc-trans);
}

.cart-preview-popup.is-open .cart-preview-overlay {
	opacity: 1;
}

/* ---------- Drawer content --------------------------------------------- */
.cart-preview-content {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 440px;
	background: var(--lbc-bg);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform var(--lbc-trans);
	box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.cart-preview-popup.is-open .cart-preview-content {
	transform: translateX(0);
}

/* ---------- Drawer header ---------------------------------------------- */
.cart-preview-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 24px;
	border-bottom: 1px solid var(--lbc-border);
}

.cart-preview-header h3 {
	font-family: var(--lbc-ff);
	font-size: 18px;
	font-weight: 700;
	color: #000;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 10px;
}

.cart-preview-header .cart-preview-count {
	font-size: 13px;
	font-weight: 500;
	color: var(--lbc-muted);
}

.cart-preview-header .cart-preview-count.is-hidden {
	display: none;
}

.cart-preview-close {
	-webkit-appearance: none;
	appearance: none;
	background: transparent !important;
	border: none !important;
	padding: 4px !important;
	margin: 0;
	color: #000;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: background var(--lbc-trans);
	box-shadow: none !important;
}

.cart-preview-close:hover {
	background: rgba(0, 0, 0, 0.05) !important;
}

/* ---------- Drawer body ------------------------------------------------ */
.cart-preview-body {
	flex: 1;
	overflow-y: auto;
	padding: 8px 24px 24px;
}

.cart-preview-items {
	display: flex;
	flex-direction: column;
}

.cart-preview-empty {
	padding: 60px 0;
	text-align: center;
	color: var(--lbc-muted);
}

.cart-preview-empty p {
	margin: 0;
	font-size: 15px;
}

/* ---------- Cart item card --------------------------------------------- */
.product-card {
	display: flex;
	gap: 14px;
	padding: 18px 0;
	border-bottom: 1px solid var(--lbc-border);
	overflow: hidden;
	transition: opacity var(--lbc-trans), height 0.22s ease, padding 0.22s ease, margin 0.22s ease;
}

.product-card:last-child {
	border-bottom: none;
}

.product-card.is-loading {
	opacity: 0.55;
}

.product-card.is-removing {
	opacity: 0;
}

.product-image {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	background: var(--lbc-bg-soft);
	border-radius: var(--lbc-radius);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.product-image img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.product-image a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.product-details {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.product-header {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	justify-content: space-between;
}

.product-title {
	font-size: 14px;
	font-weight: 600;
	color: #000;
	line-height: 1.35;
	min-width: 0;
}

.product-title a {
	color: inherit;
	text-decoration: none;
}

.product-title a:hover {
	color: var(--lbc-primary);
}

.product-right {
	flex-shrink: 0;
}

.delete-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	color: var(--lbc-muted);
	border-radius: 4px;
	text-decoration: none;
	transition: background var(--lbc-trans), color var(--lbc-trans);
}

.delete-btn:hover {
	background: rgba(0, 0, 0, 0.05);
	color: #c0392b;
}

.variation-info {
	font-size: 12px;
	color: var(--lbc-muted);
	line-height: 1.4;
}

.variation-info p {
	margin: 0;
}

.product-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

/* ---------- Quantity stepper (inside cart drawer) ---------------------- */
.quantity-control {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--lbc-border);
	border-radius: var(--lbc-radius);
	background: #fff;
	height: 36px;
	overflow: hidden;
}

.quantity-control .qty-btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 100%;
	padding: 0 !important;
	background: transparent !important;
	border: none !important;
	color: #000;
	font-size: 16px;
	cursor: pointer;
	transition: background var(--lbc-trans);
	box-shadow: none !important;
	outline: none !important;
}

.quantity-control .qty-btn:hover {
	background: rgba(0, 0, 0, 0.05) !important;
	color: var(--lbc-primary);
}

.quantity-control .qty-input {
	-webkit-appearance: textfield;
	appearance: textfield;
	-moz-appearance: textfield;
	width: 36px;
	height: 100%;
	border: none !important;
	outline: none !important;
	background: transparent !important;
	text-align: center;
	font-family: var(--lbc-ff);
	font-size: 14px;
	color: #000;
	padding: 0 !important;
	box-shadow: none !important;
}

.quantity-control .qty-input::-webkit-outer-spin-button,
.quantity-control .qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.product-price {
	font-size: 14px;
	font-weight: 700;
	color: #000;
	text-align: right;
}

.product-price .amount {
	font-weight: 700;
}

/* ---------- Drawer footer ---------------------------------------------- */
.cart-preview-footer {
	border-top: 1px solid var(--lbc-border);
	padding: 18px 24px 22px;
	background: var(--lbc-bg);
}

.cart-preview-notice {
	font-size: 12px;
	color: var(--lbc-muted);
	margin: 0 0 12px;
	text-align: center;
}

.cart-preview-subtotal {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 14px;
	font-family: var(--lbc-ff);
}

.cart-preview-subtotal-label {
	font-size: 14px;
	font-weight: 600;
	color: #000;
}

.cart-preview-subtotal-value {
	font-size: 18px;
	font-weight: 700;
	color: #000;
}

.cart-preview-subtotal-value .amount {
	font-weight: 700;
}

.cart-preview-buttons {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cart-preview-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 46px;
	padding: 0 18px;
	font-family: var(--lbc-ff);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.02em;
	border-radius: var(--lbc-radius);
	text-decoration: none;
	border: 1px solid #000;
	transition: background var(--lbc-trans), color var(--lbc-trans);
}

.cart-preview-btn--primary {
	background: #000;
	color: #fff;
}

.cart-preview-btn--primary:hover {
	background: var(--lbc-primary-dark);
	border-color: var(--lbc-primary-dark);
	color: #fff;
}

.cart-preview-btn--secondary {
	background: transparent;
	color: #000;
}

.cart-preview-btn--secondary:hover {
	background: rgba(0, 0, 0, 0.04);
	color: #000;
}

/* ---------- Responsive ------------------------------------------------- */
@media (max-width: 480px) {
	.cart-preview-content {
		max-width: 100%;
	}
	.cart-preview-header,
	.cart-preview-body,
	.cart-preview-footer {
		padding-left: 18px;
		padding-right: 18px;
	}
	.product-image {
		flex: 0 0 64px;
		width: 64px;
		height: 64px;
	}
	.cart-preview-btn {
		height: 44px;
	}
}
