/* ============================================================
   Custom Cart Widget — Luxury Jewelry
   ============================================================ */

/* ── Toggle button (inline in Elementor) ── */
.luxury-custom-cart {
	display: inline-block;
	line-height: 1;
}

.lcart-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	background: var(--lcart-toggle-bg, none);
	border: var(--lcart-toggle-border, none);
	border-radius: var(--lcart-toggle-radius, 0);
	cursor: pointer;
	padding: 6px;
	gap: 6px;
	color: inherit;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lcart-toggle:hover {
	background: var(--lcart-toggle-bg-hover, var(--lcart-toggle-bg, transparent));
}

.lcart-toggle-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--lcart-toggle-icon-size, 24px);
	width: var(--lcart-toggle-icon-size, 24px);
	height: var(--lcart-toggle-icon-size, 24px);
	color: var(--lcart-toggle-icon-color, inherit);
}

.lcart-toggle-icon svg {
	width: 100%;
	height: 100%;
	fill: var(--lcart-toggle-icon-color, currentColor);
}

/* Count badge */
.lcart-count-badge {
	position: absolute;
	top: 0;
	right: 0;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 9px;
	background-color: var(--lcart-badge-bg, #B4996C);
	color: var(--lcart-badge-color, #ffffff);
	font-size: 10px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	pointer-events: none;
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.2s, transform 0.2s;
}

.lcart-count-badge.is-visible {
	opacity: 1;
	transform: scale(1);
}

/* ── Panel wrap (moved to body by JS) ── */
.lcart-panel-wrap {
	position: fixed;
	inset: 0;
	z-index: 99999;
	pointer-events: none;
	direction: rtl;
}

.lcart-panel-wrap.is-open {
	pointer-events: auto;
}

/* ── Backdrop ── */
.lcart-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0);
	transition: background 0.35s ease;
}

.lcart-panel-wrap.is-open .lcart-backdrop {
	background: rgba(0, 0, 0, 0.45);
}

/* ── Panel slide-in ── */
.lcart-panel {
	position: absolute;
	top: 0;
	width: min(900px, 85vw);
	height: 100%;
	background: var(--lcart-panel-bg, #fff);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1),
	            left  0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Panel open/close positioning by side class */
.lcart-panel-wrap.lcart-side-right .lcart-panel {
	right: -100% !important;
	left: auto !important;
}
.lcart-panel-wrap.lcart-side-right.is-open .lcart-panel {
	right: 0 !important;
	left: auto !important;
	box-shadow: -4px 0 30px rgba(0,0,0,0.15);
}
.lcart-panel-wrap.lcart-side-left .lcart-panel {
	left: -100% !important;
	right: auto !important;
}
.lcart-panel-wrap.lcart-side-left.is-open .lcart-panel {
	left: 0 !important;
	right: auto !important;
	box-shadow: 4px 0 30px rgba(0,0,0,0.15);
}

/* ── Header ── */
.lcart-header {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 20px;
	border-bottom: 1px solid #ebebeb;
	flex-shrink: 0;
	background: inherit;
}

.lcart-close {
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
	color: #555;
	border-radius: 50%;
	transition: background 0.2s, color 0.2s;
	flex-shrink: 0;
}

.lcart-close:hover {
	background: #f0f0f0;
	color: #111;
}

.lcart-shipping-bar {
	flex: 1;
	min-width: 0;
}

/* Progress bar container */
.lcart-shipping-progress {
	display: flex;
	flex-direction: column;
	gap: 6px;
	background: #f9f6f1;
	padding: 9px 16px;
	border-radius: 6px;
}

.lcart-shipping-track {
	width: 100%;
	height: 5px;
	background: #e5e1d8;
	border-radius: 3px;
	overflow: hidden;
}

.lcart-shipping-fill {
	height: 100%;
	background: #B4996C;
	border-radius: 3px;
	transition: width 0.5s ease;
	max-width: 100%;
}

.lcart-shipping-progress.is-achieved .lcart-shipping-fill {
	background: #4caf50;
}

.lcart-shipping-msg {
	font-size: 12px;
	font-weight: 600;
	color: #555;
	text-align: center;
	line-height: 1.3;
}

.lcart-shipping-progress.is-achieved .lcart-shipping-msg {
	color: #2e7d32;
}

/* ── Body (two columns) ── */
.lcart-body {
	display: flex;
	flex: 1;
	overflow: hidden;
	min-height: 0;
}

/* ── Items column ── */
.lcart-items-col {
	order: 2;
	flex: 0 0 55%;
	display: flex;
	flex-direction: column;
	border-right: 1px solid #ebebeb;
	min-width: 0;
}

.lcart-items-list {
	flex: 1;
	overflow-y: auto;
	padding: 16px 20px;
	scrollbar-width: thin;
	scrollbar-color: #ddd transparent;
}

.lcart-items-list::-webkit-scrollbar {
	width: 4px;
}

.lcart-items-list::-webkit-scrollbar-thumb {
	background: #ddd;
	border-radius: 2px;
}

/* Empty cart message */
.lcart-empty {
	padding: 40px 20px;
	text-align: center;
	color: #999;
	font-size: 14px;
}

/* ── Single cart item ── */
.lcart-item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px 0;
	border-bottom: 1px solid #f0f0f0;
	position: relative;
}

.lcart-item:last-child {
	border-bottom: none;
}

.lcart-item-image {
	flex-shrink: 0;
	width: 90px;
	height: 90px;
}

.lcart-item-image a {
	display: block;
	width: 100%;
	height: 100%;
}

.lcart-item-image img,
.lcart-item-image .lcart-item-img {
	display: block;
	width: 90px;
	height: 90px;
	object-fit: cover;
	border-radius: 6px;
	background: #f5f5f5;
}

.lcart-item-info {
	flex: 1;
	min-width: 0;
}

.lcart-item-name {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #222;
	text-decoration: none;
	margin-bottom: 6px;
	line-height: 1.35;
}

.lcart-item-name:hover {
	color: #B4996C;
}

/* Item price */
.lcart-item-price {
	font-size: 13px;
	font-weight: 700;
	color: #111;
	margin-top: 4px;
}

.lcart-item-price .woocommerce-Price-amount {
	color: inherit;
}

/* WooCommerce variation + cart item meta (e.g. סוג מתכת) */
.lcart-item-info .variation,
.lcart-item-info dl.variation,
.lcart-item-info .wc-item-meta {
	font-size: 12px;
	color: #777;
	margin: 0;
	list-style: none;
	padding: 0;
}

.lcart-item-info dl.variation dt,
.lcart-item-info dl.variation dd,
.lcart-item-info .wc-item-meta li,
.lcart-item-info .wc-item-meta .wc-item-meta-label,
.lcart-item-info .wc-item-meta .wc-item-meta-value {
	display: inline;
	font-size: 12px;
	color: #777;
}

.lcart-item-info dl.variation dd::after,
.lcart-item-info .wc-item-meta li::after {
	content: '\A';
	white-space: pre;
}

/* Remove button */
.lcart-item-remove {
	position: absolute;
	top: 16px;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	color: #bbb;
	text-decoration: none;
	border-radius: 50%;
	transition: color 0.2s, background 0.2s;
	flex-shrink: 0;
}

.lcart-item-remove:hover {
	color: #e74c3c;
	background: #fff0ef;
}

/* ── Notes ── */
.lcart-notes-wrap {
	padding: 12px 20px;
	border-top: 1px solid #f0f0f0;
}

.lcart-notes {
	width: 100%;
	min-height: 50px;
	resize: vertical;
	border: none;
	background: none;
	font-size: 12px;
	color: #888;
	line-height: 1.5;
	outline: none;
	cursor: text;
	font-family: inherit;
}

.lcart-notes::placeholder {
	color: #bbb;
}

/* ── Footer / Checkout button ── */
.lcart-footer {
	padding: 16px 20px;
	border-top: 1px solid #ebebeb;
	flex-shrink: 0;
}

.lcart-checkout-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	background: var(--lcart-ckout-bg, #111);
	color: var(--lcart-ckout-color, #fff) !important;
	text-decoration: none;
	padding: 14px 20px;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 700;
	transition: opacity 0.2s;
}

.lcart-checkout-btn:hover {
	opacity: 0.88;
}

.lcart-ckout-text {
	flex: 1;
}

.lcart-ckout-sep {
	opacity: 0.4;
}

.lcart-ckout-total {
	font-weight: 700;
}

.lcart-ckout-lock {
	opacity: 0.6;
	flex-shrink: 0;
}

/* WooCommerce Price Amount inside checkout btn */
.lcart-checkout-btn .woocommerce-Price-amount {
	color: inherit;
}

/* ── Upsells column ── */
.lcart-upsells-col {
	order: 1;
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	background: var(--lcart-upsells-bg, #fafafa);
	padding: 16px 20px;
	min-width: 0;
	scrollbar-width: thin;
	scrollbar-color: #ddd transparent;
}

.lcart-upsells-col::-webkit-scrollbar {
	width: 4px;
}

.lcart-upsells-col::-webkit-scrollbar-thumb {
	background: #ddd;
	border-radius: 2px;
}

.lcart-upsells-title {
	font-size: 15px;
	font-weight: 700;
	color: #222;
	margin: 0 0 16px;
	text-align: center;
}

.lcart-upsells-list {
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* ── Single upsell row (same style as cart item) ── */
.lcart-upsell {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px 0;
	border-bottom: 1px solid #f0f0f0;
	position: relative;
	background: transparent;
	border-radius: 0;
	overflow: visible;
	box-shadow: none;
}

.lcart-upsell:last-child {
	border-bottom: none;
}

.lcart-upsell:hover {
	box-shadow: none;
}

.lcart-upsell-image {
	flex-shrink: 0;
	width: 90px;
	height: 90px;
	position: relative;
	overflow: hidden;
	border-radius: 6px;
}

.lcart-upsell-image a {
	display: block;
	width: 100%;
	height: 100%;
}

.lcart-upsell-image img,
.lcart-upsell-image .lcart-upsell-img {
	display: block;
	width: 90px;
	height: 90px;
	aspect-ratio: auto;
	object-fit: cover;
	transition: none;
	background: #f5f5f5;
	border-radius: 6px;
}

.lcart-upsell:hover .lcart-upsell-image img {
	transform: none;
}

/* Wishlist heart — repositioned like the remove button */
.lcart-upsell-wishlist {
	position: absolute;
	top: 16px;
	left: 0;
	right: auto;
	background: none;
	border: none;
	border-radius: 50%;
	width: 22px;
	height: 22px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #bbb;
	transition: color 0.2s, background 0.2s;
	z-index: 1;
}

.lcart-upsell-wishlist:hover {
	color: #e74c3c;
	background: #fff0ef;
}

.lcart-upsell-body {
	flex: 1;
	min-width: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.lcart-upsell-name {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #222;
	text-decoration: none;
	margin-bottom: 6px;
	line-height: 1.35;
}

.lcart-upsell-name:hover {
	color: #B4996C;
}

.lcart-upsell-price {
	font-size: 12px;
	color: #777;
	margin-bottom: 8px;
}

.lcart-upsell-price .woocommerce-Price-amount {
	color: inherit;
}

.lcart-upsell-btn {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	color: #B4996C;
	text-decoration: none;
	padding: 0;
	border-top: none;
	transition: color 0.2s;
	letter-spacing: 0.02em;
}

.lcart-upsell-btn:hover {
	color: #9a7e55;
	background: none;
}

/* ── Prevent body scroll when cart is open ── */
body.lcart-is-open {
	overflow: hidden;
}

/* ── Loading state ── */
.lcart-items-list.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
	.lcart-panel {
		width: 100%;
		max-width: 100%;
	}

	.lcart-body {
		flex-direction: column;
	}

	.lcart-items-col {
		order: 1;
		flex: 0 0 auto;
		border-right: none;
		border-bottom: 1px solid #ebebeb;
		max-height: 55vh;
	}

	.lcart-upsells-col {
		order: 2;
		flex: 0 0 auto;
		max-height: 40vh;
		overflow-x: hidden;
		overflow-y: auto;
		padding: 16px 20px;
	}

	.lcart-upsells-list {
		flex-direction: column;
		gap: 0;
	}

	.lcart-upsell {
		flex: 0 0 auto;
	}

	.lcart-upsells-title {
		display: block;
		margin-bottom: 12px;
	}
}
