/* OpenCart 3.0.5.0 - Special Search Bivate
   All class names are prefixed "ocssb-" so they cannot collide with theme CSS. */

.ocssb-dropdown,
.ocssb-dropdown *,
.ocssb-barcode-overlay,
.ocssb-barcode-overlay * {
	box-sizing: border-box;
}

.ocssb-dropdown {
	position: fixed;
	z-index: 99999;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 4px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	max-height: 420px;
	overflow-y: auto;
	font-size: 13px;
	line-height: 1.35;
	font-family: inherit;
	-webkit-overflow-scrolling: touch;
}

.ocssb-list {
	display: flex;
	flex-direction: column;
}

.ocssb-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	text-decoration: none;
	color: #333;
	border-bottom: 1px solid #f2f2f2;
}

.ocssb-item:last-child {
	border-bottom: none;
}

.ocssb-item:hover,
.ocssb-item.ocssb-active {
	background: #f6f6f6;
	text-decoration: none;
	color: #333;
}

.ocssb-thumb {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	display: block;
	overflow: hidden;
	border-radius: 4px;
	background: #f5f5f5;
}

.ocssb-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.ocssb-info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ocssb-name {
	font-weight: 600;
	font-size: 13px;
	color: #222;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ocssb-meta {
	display: flex;
	gap: 8px;
	font-size: 11px;
	color: #888;
}

.ocssb-stock--in {
	color: #2e8b3d;
}

.ocssb-stock--out {
	color: #c0392b;
}

.ocssb-price {
	display: flex;
	gap: 6px;
	align-items: baseline;
	font-size: 13px;
}

.ocssb-price--regular {
	font-weight: 600;
	color: #111;
}

.ocssb-price--old {
	text-decoration: line-through;
	color: #999;
	font-size: 11px;
}

.ocssb-price--special {
	font-weight: 700;
	color: #e2231a;
}

.ocssb-all {
	display: block;
	text-align: center;
	padding: 10px 12px;
	font-size: 12px;
	font-weight: 600;
	color: #337ab7;
	text-decoration: none;
	border-top: 1px solid #eee;
	background: #fafafa;
}

.ocssb-all:hover {
	background: #f0f0f0;
	color: #23527c;
	text-decoration: underline;
}

.ocssb-empty {
	padding: 18px 12px;
	text-align: center;
	color: #999;
	font-size: 13px;
}

.ocssb-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px 12px;
}

.ocssb-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid #ddd;
	border-top-color: #888;
	border-radius: 50%;
	display: inline-block;
	animation: ocssb-spin 0.6s linear infinite;
}

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

@media (max-width: 480px) {
	.ocssb-dropdown {
		max-height: 70vh;
		left: 8px !important;
		right: 8px !important;
		width: auto !important;
	}

	.ocssb-name {
		white-space: normal;
	}
}

/* Barcode scan button - floating over the theme's own search input, positioned
   in JS via getBoundingClientRect() so it never depends on the theme's markup. */
.ocssb-barcode-btn {
	position: fixed;
	z-index: 99998;
	width: 30px;
	height: 30px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	border-radius: 50%;
	color: #777;
	cursor: pointer;
}

.ocssb-barcode-btn:hover {
	background: rgba(0, 0, 0, 0.06);
	color: #333;
}

.ocssb-barcode-btn svg {
	pointer-events: none;
}

/* Barcode scanner overlay */
.ocssb-barcode-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
}

.ocssb-barcode-box {
	position: relative;
	width: min(92vw, 480px);
	height: min(70vh, 480px);
	background: #000;
	border-radius: 8px;
	overflow: hidden;
}

.ocssb-barcode-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ocssb-barcode-frame {
	position: absolute;
	left: 10%;
	right: 10%;
	top: 38%;
	bottom: 38%;
	border: 2px solid rgba(255, 255, 255, 0.85);
	border-radius: 6px;
	box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.35);
	pointer-events: none;
}

.ocssb-barcode-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.ocssb-barcode-message {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 14px;
	text-align: center;
	color: #fff;
	font-size: 13px;
	padding: 0 16px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.ocssb-barcode-message--error {
	color: #ff8a8a;
	font-weight: 600;
}
