/* AJ Visual (AI) Image Search — camera icon + upload modal styles. */

.dgwt-wcas-sf-wrapp {
	position: relative !important;
}

.aj-camera-wrapper {
	position: absolute;
	right: 46px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 99;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 4px;
	background: transparent !important;
	box-shadow: none !important;
	border: none !important;
}

.aj-camera-icon-svg {
	width: 20px;
	height: 20px;
	fill: #666666;
	transition: fill 0.2s ease, transform 0.2s ease;
}

.aj-camera-wrapper:hover .aj-camera-icon-svg {
	fill: #000000;
	transform: scale(1.1);
}

.dgwt-wcas-search-input {
	padding-right: 80px !important;
}

/* AJ Search's own search bar already lays out its icons (clear/spinner/
   submit) in a flex row (.aj-search-icons), so the camera icon joins that
   same row instead of being absolutely positioned like the FiboSearch one
   above — this keeps AJ Search's own layout/design untouched. */
.aj-camera-wrapper.is-inline {
	position: static;
	right: auto;
	top: auto;
	transform: none;
	flex-shrink: 0;
}

.aj-modal {
	display: none;
	position: fixed;
	z-index: 999999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(4px);
	align-items: center;
	justify-content: center;
}

.aj-modal-content {
	background-color: #ffffff;
	padding: 22px;
	border-radius: 16px;
	width: 90%;
	max-width: 390px;
	text-align: center;
	position: relative;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
	max-height: 85vh;
	overflow-y: auto;
}

.aj-modal-close {
	position: absolute;
	right: 14px;
	top: 10px;
	font-size: 24px;
	font-weight: bold;
	color: #888;
	cursor: pointer;
}

.aj-upload-box {
	position: relative;
	border: 2px dashed #d6d3f0;
	border-radius: 14px;
	padding: 34px 15px;
	background-color: #ffffff;
	margin-top: 15px;
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.aj-upload-box.aj-drag-over {
	border-color: #7c5cff;
	background-color: #f7f5ff;
}

.aj-upload-icon {
	width: 36px;
	height: 36px;
	margin: 0 auto 10px;
	display: block;
	color: #ff0000;
}

.aj-upload-title {
	font-size: 14px;
	font-weight: 700;
	color: #1a1a1a;
}

.aj-upload-subtitle {
	font-size: 12.5px;
	color: #777;
	margin-top: 2px;
}

.aj-upload-hint {
	font-size: 11px;
	color: #b3b3b3;
	margin-top: 8px;
}

.aj-native-file-input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	z-index: 99;
}

.aj-camera-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 12px;
	padding: 3px 14px;
	font-size: 12.5px;
	font-weight: 600;
	color: #333;
	background-color: #ffffff;
	border: 1px solid #ddd;
	border-radius: 999px;
	cursor: pointer;
}

.aj-camera-btn:hover {
	border-color: #999;
}

.aj-camera-btn svg {
	width: 15px;
	height: 15px;
}

.aj-preview-box {
	position: relative;
	margin-top: 15px;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	padding: 10px;
	background-color: #fff;
}

.aj-preview-box img {
	width: 100%;
	max-height: 220px;
	object-fit: contain;
	border-radius: 8px;
	display: block;
}

.aj-preview-close {
	position: absolute;
	right: -8px;
	top: -8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background-color: #333;
	color: #fff;
	font-size: 14px;
	line-height: 24px;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.aj-search-btn {
	display: block;
	width: 100%;
	margin-top: 14px;
	padding: 7px 16px;
	font-size: 14.5px;
	font-weight: 700;
	color: #fff;
	background-color: #000000;
	border: none;
	border-radius: 999px;
	cursor: pointer;
}

/* "Search Products": black normally, red (#ff0000) on hover/focus/active
 * and while searching. !important + the modal id keep any theme's own
 * button / button:hover / button:disabled styling from overriding it. */
#aj-image-search-modal .aj-search-btn {
	background-color: #000000 !important;
	color: #ffffff !important;
	opacity: 1 !important;
}

#aj-image-search-modal .aj-search-btn:hover,
#aj-image-search-modal .aj-search-btn:focus,
#aj-image-search-modal .aj-search-btn:active,
#aj-image-search-modal .aj-search-btn.is-loading,
#aj-image-search-modal .aj-search-btn.is-loading:hover,
#aj-image-search-modal .aj-search-btn.is-loading:focus,
#aj-image-search-modal .aj-search-btn.is-loading:active,
#aj-image-search-modal .aj-search-btn:disabled {
	background-color: #ff0000 !important;
	color: #ffffff !important;
	opacity: 1 !important;
}

#aj-image-search-modal .aj-search-btn.is-loading {
	cursor: wait;
	pointer-events: none;
}

/* "Use Camera": white button normally; on hover the theme turns it black,
 * so the text and icon must turn white at the same time. */
#aj-image-search-modal .aj-camera-btn:hover,
#aj-image-search-modal .aj-camera-btn:focus,
#aj-image-search-modal .aj-camera-btn:active {
	background-color: #000000 !important;
	border-color: #000000 !important;
	color: #ffffff !important;
}

#aj-image-search-modal .aj-camera-btn:hover svg,
#aj-image-search-modal .aj-camera-btn:focus svg,
#aj-image-search-modal .aj-camera-btn:active svg {
	stroke: #ffffff !important;
	color: #ffffff !important;
}

.aj-btn-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-right: 8px;
	vertical-align: -2px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: aj-vs-spin 0.7s linear infinite;
}

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

.aj-loader {
	display: none;
	margin-top: 12px;
	font-size: 13px;
	color: #0073aa;
	font-weight: 600;
}

.aj-no-result-box {
	display: none;
	margin-top: 15px;
	text-align: left;
}

.aj-no-result-title {
	color: #d9534f;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 5px;
	text-align: center;
}

.aj-suggest-title {
	font-size: 13px;
	font-weight: 600;
	color: #333;
	margin: 12px 0 8px 0;
	border-bottom: 1px solid #eee;
	padding-bottom: 4px;
}

.aj-suggest-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.aj-suggest-item {
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 6px;
	text-decoration: none;
	color: #333;
	display: flex;
	flex-direction: column;
	align-items: center;
	background: #fff;
	transition: border 0.2s ease;
}

.aj-suggest-item:hover {
	border-color: #0073aa;
}

.aj-suggest-item img {
	width: 100%;
	height: 70px;
	object-fit: contain;
	border-radius: 4px;
	margin-bottom: 5px;
}

.aj-suggest-item span {
	font-size: 11px;
	line-height: 1.2;
	text-align: center;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (max-width: 768px) {
	.aj-camera-wrapper {
		right: 40px;
	}
	.aj-camera-icon-svg {
		width: 18px;
		height: 18px;
	}
	.dgwt-wcas-search-input {
		padding-right: 70px !important;
	}
}
