/**
 * jsm-floating-cart.css
 * Refactored: dedup + cleanup duplicates (v0.43.1)
 * Total rules: 90 (reduced from 170)
 *
 * Class hierarchy:
 *   .jsm-fc (wrapper)          — fixed bottom, container untuk bar + panel
 *   .jsm-fc-bar (toggle)       — selalu visible
 *   .jsm-fc-panel              — slide-up expand
 *   .jsm-fc-row*               — single product row dalam panel
 *
 * Legacy (deprecated):
 *   .jsm-floating-cart*        — sebelum v0.43, sudah tidak di-render
 */

.jsm-floating-cart[hidden] { display: none; }

.jsm-floating-cart-empty .jsm-floating-cart-count { display: none; }

.jsm-floating-cart-bar:hover {
	box-shadow: 0 12px 28px rgba(31,44,114,0.22) !important;
	transform: translateY(-1px);
}

.jsm-floating-cart.is-open .jsm-floating-cart-bar {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	border-bottom-color: var(--jsm-border);
}

.jsm-floating-cart-bar-toggle {
	background: var(--jsm-bg);
	color: var(--jsm-navy);
	width: 34px; height: 34px;
	border-radius: 10px;
	display: flex; align-items: center; justify-content: center;
	flex-shrink: 0;
}

.jsm-floating-cart-bar-chevron {
	transition: transform .2s ease !important;
}

.jsm-floating-cart.is-open .jsm-floating-cart-bar-chevron {
	transform: rotate(180deg) !important;
}

.jsm-floating-cart-panel[hidden] { display: none; }

@keyframes jsm-fc-panel-up {
	from { transform: translateY(12px); opacity: 0; }
	to   { transform: translateY(0); opacity: 1; }
}

.jsm-floating-cart-panel-head { background: #1F2C72 !important; }

.jsm-floating-cart-panel-head h3 {
	font-size: 15px !important;
	font-weight: 800 !important;
	margin: 0 0 2px 0 !important;
}

.jsm-floating-cart-panel-head small {
	font-size: 11px !important;
	opacity: 0.85 !important;
}

.jsm-floating-cart-panel-close {
	background: rgba(255,255,255,0.15) !important;
	color: white !important;
	border: 0 !important;
	width: 28px !important;
	height: 28px !important;
	border-radius: 50% !important;
	cursor: pointer !important;
	display: grid !important;
	place-items: center !important;
	font-size: 14px !important;
}

.jsm-floating-cart-panel-close:hover { background: rgba(255,255,255,0.3); }

.jsm-floating-cart-panel-body {
	overflow-y: auto; flex: 1;
	padding: 10px 14px;
	background: #fafbfc;
}

.jsm-floating-cart-panel-empty {
	text-align: center; color: var(--jsm-text-muted);
	padding: 30px 10px; font-size: 13px;
}

.jsm-fc-cat-group:last-child { margin-bottom: 0 !important; }

.jsm-fc-cat-head {
	font-size: 10px !important;
	font-weight: 800 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.08em !important;
	color: #94a3b8 !important;
	margin-bottom: 4px !important;
	padding: 0 !important;
}

.jsm-fc-brand-group {
	border: 1px solid #f1f5f9 !important;
	border-radius: 10px !important;
	padding: 8px 12px !important;
	margin-bottom: 6px !important;
	background: white !important;
}

.jsm-fc-brand-head {
	font-size: 11px !important;
	color: #1F2C72 !important;
	font-weight: 700 !important;
	margin-bottom: 4px !important;
	padding: 4px 0 !important;
	border-bottom: 1px dashed #e5e7eb !important;
	position: relative !important;
	padding-left: 12px !important;
}

.jsm-fc-brand-head::before {
	content: '';
	position: absolute;
	left: 0; top: 50%;
	transform: translateY(-50%);
	width: 6px; height: 6px;
	border-radius: 50%;
	background: #C8F133;
}

.jsm-fc-row {
	display: grid;
	grid-template-columns: 44px 1fr auto;
	gap: 8px;
	align-items: center;
	background: white;
	border: 1px solid var(--jsm-border);
	border-radius: 8px;
	padding: 6px 8px;
	margin-bottom: 4px;
}

.jsm-fc-row-thumb {
	flex: 0 0 48px !important;
	width: 48px !important; height: 48px !important;
	border-radius: 8px !important;
	overflow: hidden !important;
	background: #f1f5f9 !important;
	display: grid !important;
	place-items: center !important;
}

.jsm-fc-row-thumb img {
	width: 100% !important; height: 100% !important;
	object-fit: cover !important;
	display: block !important;
}

.jsm-fc-row-info {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	display: flex !important;
	flex-direction: column !important;
	gap: 2px !important;
}

.jsm-fc-row-name {
	font-size: 13px !important;
	font-weight: 700 !important;
	color: #1F2C72 !important;
	line-height: 1.3 !important;
	display: -webkit-box !important;
	-webkit-line-clamp: 1 !important;
	-webkit-box-orient: vertical !important;
	overflow: hidden !important;
}

.jsm-fc-row-meta {
	display: flex !important;
	gap: 6px !important;
	font-size: 11px !important;
	color: #94a3b8 !important;
	margin-top: 0 !important;
}

.jsm-fc-row-meta strong {
	color: #1F2C72 !important;
	font-weight: 800 !important;
	font-size: 12px !important;
}

.jsm-fc-row-qty {
	display: flex; align-items: center; gap: 2px;
	border: 1px solid var(--jsm-border);
	border-radius: 6px;
	background: white;
	padding: 1px;
}

.jsm-fc-row-qty button {
	flex: 0 0 30px !important;
	width: 30px !important;
	height: 100% !important;
	border: 0 !important;
	background: transparent !important;
	font-size: 16px !important;
	font-weight: 800 !important;
	color: #1F2C72 !important;
	cursor: pointer !important;
	border-radius: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	font-family: inherit !important;
}

.jsm-fc-row-qty button:hover {
	background: #f1f5f9 !important;
}

.jsm-fc-row-qty input {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	width: 36px !important;
	height: 100% !important;
	border: 0 !important;
	background: transparent !important;
	text-align: center !important;
	font-size: 13px !important;
	font-weight: 800 !important;
	color: #1F2C72 !important;
	padding: 0 !important;
	margin: 0 !important;
	-webkit-appearance: none !important;
	-moz-appearance: textfield !important;
	line-height: 1 !important;
	font-family: inherit !important;
}

.jsm-fc-row-qty input::-webkit-inner-spin-button { display: none; }

.jsm-fc-row-remove {
	background: transparent; border: 0; color: var(--jsm-danger);
	cursor: pointer; padding: 0; margin-left: 4px;
	font-size: 14px;
}

.jsm-floating-cart-panel-foot {
	border-top: 1px solid var(--jsm-border);
	background: white;
	padding: 12px 14px;
	display: flex; flex-direction: column; gap: 8px;
}

.jsm-floating-cart-panel-total {
	display: flex !important;
	justify-content: space-between !important;
	align-items: center !important;
	margin-bottom: 10px !important;
	font-size: 13px !important;
	color: #4b5563 !important;
}

.jsm-floating-cart-panel-total strong {
	font-size: 18px !important;
	color: #1F2C72 !important;
	font-weight: 900 !important;
}

.jsm-floating-cart-btn-block {
	display: flex !important; justify-content: center;
	padding: 11px 14px !important; font-size: 14px !important;
}

.jsm-floating-cart-empty .jsm-floating-cart-btn-block { display: none !important; }

.jsm-floating-cart-bar { z-index: 1; }

.jsm-floating-cart-panel { z-index: 2; }

.jsm-floating-cart-count {
	background: #C8F133 !important;
	color: #1F2C72 !important;
}

@keyframes jsm-fc-slide-in {
	from { transform: translateY(20px); opacity: 0; }
	to   { transform: translateY(0); opacity: 1; }
}

.jsm-floating-cart-info {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 0;
}

.jsm-floating-cart-icon {
	background: #1F2C72 !important;
	color: #C8F133 !important;
	width: 36px !important;
	height: 36px !important;
	border-radius: 10px !important;
	display: grid !important;
	place-items: center !important;
	font-size: 16px !important;
	flex-shrink: 0 !important;
	position: relative !important;
	overflow: visible !important;
}

.jsm-floating-cart-text { min-width: 0; }

.jsm-floating-cart-label {
	font-size: 10px !important;
	color: #94a3b8 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.06em !important;
	font-weight: 700 !important;
	margin: 0 0 1px 0 !important;
	line-height: 1 !important;
}

.jsm-floating-cart-total {
	font-size: 15px !important;
	font-weight: 800;
	color: #1F2C72;
	line-height: 1.1;
}

.jsm-floating-cart-actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}

.jsm-floating-cart-btn {
	padding: 9px 14px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 12px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: opacity 0.15s, background 0.15s;
}

.jsm-floating-cart-btn-ghost {
	background: var(--jsm-bg);
	color: var(--jsm-navy);
}

.jsm-floating-cart-btn-ghost:hover { background: var(--jsm-border); }

.jsm-floating-cart-btn-primary {
	background: #C8F133 !important;
	color: #1F2C72 !important;
}

.jsm-floating-cart-btn-primary:hover {
	background: #b5e02a !important;
}

.jsm-floating-cart-total,
.jsm-floating-cart-total span {
	font-size: 14px !important;
	font-weight: 800 !important;
	color: #1F2C72 !important;
	line-height: 1.15 !important;
	margin: 0 !important;
	letter-spacing: -0.01em !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
}

.jsm-app-body .jsm-fc-row-info {
	min-width: 0;
	overflow: hidden;
}

.jsm-app-body .jsm-fc-row-name {
	white-space: normal !important;
	overflow: visible !important;
	text-overflow: clip !important;
	line-height: 1.3 !important;
}

.jsm-floating-cart-count.is-updated {
	animation: jsm-fc-pulse .35s ease;
}

.jsm-fc-blink {
	animation: jsm-fc-blink .6s ease both !important;
}

@keyframes jsm-fc-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-3px); }
	40% { transform: translateX(3px); }
	60% { transform: translateX(-2px); }
	80% { transform: translateX(2px); }
}

.jsm-fc-shake {
	animation: jsm-fc-shake .45s ease;
}

@keyframes jsm-fc-blink-total {
	0%   { background: transparent; }
	30%  { background: #d1fae5; padding: 2px 8px; border-radius: 6px; }
	100% { background: transparent; }
}

@media (max-width: 720px) {
	.jsm-floating-cart {
		left: 12px !important;
		right: 12px !important;
		bottom: 12px !important;
	}
	.jsm-floating-cart-bar {
		min-height: 56px !important;
		padding: 10px 14px !important;
	}
}

@media (min-width: 720px) {
	.jsm-floating-cart {
		right: 20px !important;
		bottom: 20px !important;
		left: auto !important;
		width: auto !important;
	}
	.jsm-floating-cart-bar {
		min-width: 280px !important;
		padding: 12px 16px !important;
	}
	.jsm-floating-cart-icon {
		width: 40px !important;
		height: 40px !important;
		font-size: 18px !important;
	}
	.jsm-floating-cart-total,
	.jsm-floating-cart-total span {
		font-size: 15px !important;
	}
}

@media (min-width: 720px) {
	.jsm-floating-cart-panel {
		left: auto !important;
		right: 0 !important;
		width: 400px !important;
		max-width: calc(100vw - 40px) !important;
	}
}

.jsm-fc-row:last-child { border-bottom: 0 !important; }

.jsm-fc-row-qty button:active {
	background: #e5e7eb !important;
}

.jsm-fc-row-qty input::-webkit-outer-spin-button,
.jsm-fc-row-qty input::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
	margin: 0 !important;
}

.jsm-fc-bar:hover {
	background: #f8fafc !important;
}

.jsm-fc-bar-icon svg { display: block; }

.jsm-fc-bar-count {
	position: absolute !important;
	top: -4px !important;
	right: -4px !important;
	background: #C8F133 !important;
	color: #1F2C72 !important;
	min-width: 20px !important;
	height: 20px !important;
	padding: 0 5px !important;
	border-radius: 999px !important;
	border: 2px solid white !important;
	font-size: 11px !important;
	font-weight: 900 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	font-family: inherit !important;
}

.jsm-fc-empty .jsm-fc-bar-count {
	background: #e5e7eb !important;
	color: #94a3b8 !important;
}

.jsm-fc-bar-label {
	font-size: 10px !important;
	color: #94a3b8 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.06em !important;
	font-weight: 700 !important;
	margin-bottom: 1px !important;
}

.jsm-fc-bar-total {
	font-size: 14.5px !important;
	font-weight: 800 !important;
	color: #1F2C72 !important;
	letter-spacing: -0.01em !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
}

.jsm-fc.is-open .jsm-fc-bar-chevron {
	transform: rotate(180deg) !important;
}

.jsm-fc-panel[hidden] {
	display: none !important;
}

.jsm-fc.is-open .jsm-fc-panel {
	display: flex !important;
	max-height: 70vh !important;
	border-bottom: 1px solid #e5e7eb;
}

.jsm-fc-panel-head-text {
	display: flex !important;
	flex-direction: column !important;
	line-height: 1.2 !important;
}

.jsm-fc-panel-head-text strong {
	font-size: 15px !important;
	font-weight: 800 !important;
	color: white !important;
	margin-bottom: 2px !important;
}

.jsm-fc-panel-head-text small {
	font-size: 11px !important;
	color: rgba(255,255,255,0.7) !important;
}

.jsm-fc-panel-close {
	background: rgba(255,255,255,0.15) !important;
	color: white !important;
	border: 0 !important;
	width: 30px !important;
	height: 30px !important;
	border-radius: 50% !important;
	cursor: pointer !important;
	font-size: 13px !important;
	font-family: inherit !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: background .15s ease;
}

.jsm-fc-panel-close:hover {
	background: rgba(255,255,255,0.25) !important;
}

.jsm-fc-empty-msg {
	text-align: center;
	padding: 30px 14px;
	color: #94a3b8;
	font-size: 14px;
	line-height: 1.5;
}

.jsm-fc-empty-msg small {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	color: #cbd5e1;
}

.jsm-fc-empty-msg strong {
	color: #1F2C72;
	font-weight: 700;
}

.jsm-fc-panel-total {
	display: flex !important;
	justify-content: space-between !important;
	align-items: baseline !important;
	margin-bottom: 10px !important;
}

.jsm-fc-panel-total span {
	font-size: 13px !important;
	color: #4b5563 !important;
}

.jsm-fc-panel-total strong {
	font-size: 18px !important;
	color: #1F2C72 !important;
	font-weight: 900 !important;
}

.jsm-fc-checkout-btn {
	display: block !important;
	width: 100% !important;
	padding: 12px !important;
	background: #C8F133 !important;
	color: #1F2C72 !important;
	border-radius: 10px !important;
	font-weight: 800 !important;
	font-size: 14px !important;
	text-align: center !important;
	text-decoration: none !important;
	cursor: pointer !important;
	border: 0 !important;
	transition: all .15s ease;
}

.jsm-fc-checkout-btn:hover {
	background: #b5e02a !important;
}
