/* ── Scroll lock ─────────────────────────────────────────────────────────── */
body.wcbs-modal-open {
	overflow: hidden;
}

/* ── Floating button ─────────────────────────────────────────────────────── */
.wcbs-float-btn {
	position: fixed;
	z-index: 9999;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	background: #1d4480;
	color: #fff !important;
	border: none;
	border-radius: 50px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0,0,0,.28);
	transition: transform .15s, box-shadow .15s, background .15s;
	text-decoration: none;
	line-height: 1;
}

.wcbs-float-btn:hover {
	background: #143564;
	box-shadow: 0 6px 22px rgba(0,0,0,.35);
	transform: translateY(-2px);
}

.wcbs-float-btn:active {
	transform: translateY(0);
	box-shadow: 0 3px 10px rgba(0,0,0,.25);
}

.wcbs-pos-bottom-right  { bottom: 24px; right: 24px; }
.wcbs-pos-bottom-left   { bottom: 24px; left: 24px; }
.wcbs-pos-bottom-center { bottom: 24px; left: 50%; transform: translateX(-50%); }
.wcbs-pos-bottom-center:hover  { transform: translateX(-50%) translateY(-2px); }
.wcbs-pos-bottom-center:active { transform: translateX(-50%); }

.wcbs-float-label { white-space: nowrap; }

/* ── Shortcode trigger button ─────────────────────────────────────────────── */
.wcbs-scan-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.wcbs-fe-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0,0,0,.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

/* ── Modal box ───────────────────────────────────────────────────────────── */
.wcbs-fe-modal {
	background: #fff;
	border-radius: 12px;
	width: 100%;
	max-width: 480px;
	max-height: 92vh;
	overflow-y: auto;
	box-shadow: 0 24px 64px rgba(0,0,0,.38);
	animation: wcbs-modal-in .2s cubic-bezier(.22,.61,.36,1);
}

@keyframes wcbs-modal-in {
	from { transform: translateY(-16px) scale(.97); opacity: 0; }
	to   { transform: translateY(0)     scale(1);   opacity: 1; }
}

/* ── Modal header ────────────────────────────────────────────────────────── */
.wcbs-fe-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid #ebebeb;
	position: sticky;
	top: 0;
	background: #fff;
	border-radius: 12px 12px 0 0;
	z-index: 1;
}

.wcbs-fe-modal-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #1a1a1a;
}

.wcbs-fe-close {
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #9e9e9e;
	padding: 2px 6px;
	border-radius: 6px;
	transition: background .12s, color .12s;
}

.wcbs-fe-close:hover {
	background: #f4f4f4;
	color: #1a1a1a;
}

/* ── Modal body ──────────────────────────────────────────────────────────── */
.wcbs-fe-modal-body {
	padding: 20px 22px 24px;
}

/* ── Camera reader ───────────────────────────────────────────────────────── */
#wcbs-fe-reader {
	width: 100%;
	border: 2px dashed #c3c4c7;
	border-radius: 8px;
	background: #f8f8f8;
	overflow: hidden;
	transition: min-height .25s ease, border-color .25s ease, box-shadow .25s ease;
}

#wcbs-fe-reader.wcbs-fe-active {
	min-height: 200px;
	border-style: solid;
	border-color: #2271b1;
}

#wcbs-fe-reader.wcbs-fe-flash {
	border-color: #1a7f37;
	box-shadow: 0 0 0 3px rgba(26,127,55,.25);
	animation: wcbs-flash-pulse .55s ease;
}

@keyframes wcbs-flash-pulse {
	0%   { box-shadow: 0 0 0 3px rgba(26,127,55,.0); }
	35%  { box-shadow: 0 0 0 5px rgba(26,127,55,.45); }
	100% { box-shadow: 0 0 0 3px rgba(26,127,55,.0); }
}

#wcbs-fe-reader video {
	width: 100% !important;
	height: auto !important;
}

#wcbs-fe-reader img { display: none; }

/* ── Camera controls ─────────────────────────────────────────────────────── */
.wcbs-fe-cam-row {
	display: flex;
	gap: 8px;
	margin: 12px 0;
}

/* ── Divider ─────────────────────────────────────────────────────────────── */
.wcbs-fe-divider {
	display: flex;
	align-items: center;
	text-align: center;
	margin: 14px 0;
	color: #bdbdbd;
	font-size: 11px;
}

.wcbs-fe-divider::before,
.wcbs-fe-divider::after {
	content: '';
	flex: 1;
	border-bottom: 1px solid #ebebeb;
}

.wcbs-fe-divider span {
	padding: 0 10px;
	text-transform: uppercase;
	letter-spacing: .07em;
}

/* ── Manual input ────────────────────────────────────────────────────────── */
.wcbs-fe-manual {
	display: flex;
	gap: 8px;
}

.wcbs-fe-input {
	flex: 1;
	padding: 9px 12px;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	font-size: 15px;
	line-height: 1.4;
	transition: border-color .15s, box-shadow .15s;
}

.wcbs-fe-input:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34,113,177,.18);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.wcbs-fe-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 18px;
	border-radius: 6px;
	border: 1px solid transparent;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .12s, border-color .12s, opacity .12s;
	text-decoration: none;
	white-space: nowrap;
	line-height: 1.4;
	box-sizing: border-box;
}

.wcbs-fe-btn-block {
	display: flex;
	width: 100%;
}

.wcbs-fe-btn-primary {
	background: #2271b1;
	color: #fff !important;
	border-color: #2271b1;
}

.wcbs-fe-btn-primary:hover {
	background: #135e96;
	border-color: #135e96;
}

.wcbs-fe-btn-primary:disabled {
	opacity: .6;
	cursor: not-allowed;
}

.wcbs-fe-btn-outline {
	background: #fff;
	color: #2271b1;
	border-color: #2271b1;
}

.wcbs-fe-btn-outline:hover { background: #f0f6fc; }

.wcbs-fe-btn-ghost {
	background: transparent;
	color: #646970;
	border-color: #c3c4c7;
}

.wcbs-fe-btn-ghost:hover { background: #f6f7f7; }

/* ── Loading ─────────────────────────────────────────────────────────────── */
.wcbs-fe-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 28px 0;
	color: #646970;
	font-size: 14px;
	justify-content: center;
}

.wcbs-fe-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2.5px solid #e0e0e0;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: wcbs-spin .65s linear infinite;
	flex-shrink: 0;
}

.wcbs-fe-spinner-sm {
	width: 14px;
	height: 14px;
	border-width: 2px;
}

@keyframes wcbs-spin { to { transform: rotate(360deg); } }

/* ── Found banner ────────────────────────────────────────────────────────── */
.wcbs-fe-found-banner {
	display: flex;
	align-items: center;
	gap: 7px;
	background: #edfaef;
	color: #1a6e20;
	font-weight: 700;
	font-size: 13px;
	padding: 8px 12px;
	border-radius: 6px;
	margin-bottom: 14px;
}

/* ── Product card ────────────────────────────────────────────────────────── */
.wcbs-fe-product-card {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 14px;
	background: #fafafa;
	border: 1px solid #e8e8e8;
	border-radius: 8px;
	margin-bottom: 14px;
}

.wcbs-fe-product-img {
	width: 88px;
	height: 88px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #e8e8e8;
	flex-shrink: 0;
	background: #f0f0f0;
}

.wcbs-fe-no-img {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #bdbdbd;
}

.wcbs-fe-product-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.wcbs-fe-product-name {
	font-weight: 700;
	font-size: 15px;
	line-height: 1.3;
	color: #1a1a1a;
	word-break: break-word;
}

.wcbs-fe-product-price {
	font-size: 16px;
	color: #1a1a1a;
}

.wcbs-fe-product-price del {
	color: #adadad;
	font-size: 13px;
	margin-right: 3px;
	font-weight: 400;
}

.wcbs-fe-sale-price { color: #c0392b; }

/* ── Stock badges ────────────────────────────────────────────────────────── */
.wcbs-fe-badge {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
}

.wcbs-fe-instock    { background: #edfaef; color: #1a6e20; }
.wcbs-fe-outofstock { background: #fde8e8; color: #8a1f1f; }

/* ── Cart area ───────────────────────────────────────────────────────────── */
.wcbs-fe-cart-area {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 10px;
}

/* ── Qty stepper ─────────────────────────────────────────────────────────── */
.wcbs-fe-qty-stepper {
	display: flex;
	align-items: center;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	overflow: hidden;
	width: fit-content;
}

.wcbs-fe-qty-btn {
	background: #f6f7f7;
	border: none;
	padding: 0;
	width: 36px;
	height: 38px;
	font-size: 18px;
	font-weight: 500;
	color: #2271b1;
	cursor: pointer;
	transition: background .12s;
	flex-shrink: 0;
	line-height: 1;
}

.wcbs-fe-qty-btn:hover { background: #e8f0f8; }

.wcbs-fe-qty {
	width: 52px;
	padding: 6px 4px;
	border: none;
	border-left: 1px solid #c3c4c7;
	border-right: 1px solid #c3c4c7;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	height: 38px;
	box-sizing: border-box;
	-moz-appearance: textfield;
}

.wcbs-fe-qty::-webkit-outer-spin-button,
.wcbs-fe-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.wcbs-fe-qty:focus { outline: none; }

/* ── Add to cart button ──────────────────────────────────────────────────── */
.wcbs-fe-add-btn {
	font-size: 15px;
	padding: 11px 18px;
}

/* ── Actions row ─────────────────────────────────────────────────────────── */
.wcbs-fe-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 2px;
}

.wcbs-fe-actions-center { justify-content: center; }

.wcbs-fe-unavailable {
	font-size: 13px;
	color: #646970;
	font-style: italic;
	margin: 0 0 8px;
}

/* ── Cart success ────────────────────────────────────────────────────────── */
.wcbs-fe-success {
	text-align: center;
	padding: 32px 0 16px;
}

.wcbs-fe-success-icon {
	width: 56px;
	height: 56px;
	background: #edfaef;
	color: #1a6e20;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 14px;
	animation: wcbs-pop-in .3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes wcbs-pop-in {
	from { transform: scale(.5); opacity: 0; }
	to   { transform: scale(1);  opacity: 1; }
}

.wcbs-fe-success-msg {
	font-weight: 700;
	font-size: 16px;
	color: #1a6e20;
	margin-bottom: 20px;
}

.wcbs-fe-success-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
}

/* ── Status screens (not-found / error) ──────────────────────────────────── */
.wcbs-fe-status {
	text-align: center;
	padding: 32px 16px 20px;
}

.wcbs-fe-status-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 14px;
}

.wcbs-fe-status-warn .wcbs-fe-status-icon {
	background: #fff8e5;
	color: #9a6700;
}

.wcbs-fe-status-error .wcbs-fe-status-icon {
	background: #fde8e8;
	color: #8a1f1f;
}

.wcbs-fe-status-msg {
	font-size: 15px;
	font-weight: 600;
	color: #3c3c3c;
	margin-bottom: 20px;
	line-height: 1.4;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media ( max-width: 480px ) {
	.wcbs-fe-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.wcbs-fe-modal {
		max-height: 94vh;
		border-radius: 16px 16px 0 0;
		animation-name: wcbs-slide-up;
	}

	@keyframes wcbs-slide-up {
		from { transform: translateY(24px); opacity: 0; }
		to   { transform: translateY(0);   opacity: 1; }
	}

	.wcbs-float-btn .wcbs-float-label { display: none; }
	.wcbs-float-btn { padding: 14px; border-radius: 50%; }

	.wcbs-fe-product-img { width: 72px; height: 72px; }
}
