/*
 * Tholkudi Market - AI Visual Search System Styles
 */

/* Camera / Visual Search button in Header */
.selvamart-header__camera {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 100%;
	min-height: 44px;
	background: #fffdf8;
	border: 0;
	border-left: 1px solid #ede0c8;
	color: var(--selvamart-primary, #c4622d);
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
	padding: 0;
	box-sizing: border-box;

}
.selvamart-header__camera:hover {
	background: #fff3e8;
	color: var(--selvamart-terra-dark, #8b3a15);
}
.selvamart-header__camera i,
.selvamart-header__camera svg {
	font-size: 1.25rem;
}

/* Modal Overlay */
.sm-vs-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	background: rgba(42, 31, 20, 0.75);
	backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}
.sm-vs-modal-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

/* Modal Window */
.sm-vs-modal {
	background: #fffdf8;
	border: 1px solid var(--selvamart-border, #ede0c8);
	border-top: 4px solid var(--selvamart-primary, #c4622d);
	border-radius: 16px;
	width: min(720px, 100%);
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 24px 60px rgba(42, 31, 20, 0.35);
	overflow: hidden;
	transform: translateY(20px) scale(0.97);
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.sm-vs-modal-overlay.is-active .sm-vs-modal {
	transform: translateY(0) scale(1);
}

/* Modal Header */
.sm-vs-header {
	padding: 1.1rem 1.5rem;
	background: #fff7f0;
	border-bottom: 1px solid var(--selvamart-border, #ede0c8);
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.sm-vs-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--selvamart-charcoal, #2a1f14);
	display: flex;
	align-items: center;
	gap: 0.6rem;
}
.sm-vs-title i {
	color: var(--selvamart-primary, #c4622d);
}
.sm-vs-close {
	background: transparent;
	border: 0;
	font-size: 1.35rem;
	color: #8b6340;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	border-radius: 6px;
	transition: background 0.18s;
}
.sm-vs-close:hover {
	background: #ede0c8;
	color: #2a1f14;
}

/* Provider & Model Bar */
.sm-vs-providers {
	padding: 0.75rem 1.5rem;
	background: #fffdf8;
	border-bottom: 1px solid #ede0c8;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}
.sm-vs-provider-label {
	font-size: 0.8rem;
	font-weight: 700;
	color: #8b6340;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-right: 0.25rem;
}
.sm-vs-chip {
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	border: 1px solid #ede0c8;
	background: #fff;
	color: #5c3d1e;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.18s ease;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}
.sm-vs-chip:hover {
	background: #fff3e8;
	border-color: #c4622d;
}
.sm-vs-chip.is-selected {
	background: var(--selvamart-primary, #c4622d);
	color: #ffffff;
	border-color: var(--selvamart-primary, #c4622d);
	box-shadow: 0 4px 12px rgba(196, 98, 45, 0.25);
}

/* Modal Body */
.sm-vs-body {
	padding: 1.5rem;
	overflow-y: auto;
	flex: 1;
}

/* Dropzone & Viewfinder */
.sm-vs-dropzone {
	border: 2px dashed #c4622d;
	border-radius: 12px;
	padding: 2rem 1.5rem;
	text-align: center;
	background: #fff7f0;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
	position: relative;
}
.sm-vs-dropzone:hover,
.sm-vs-dropzone.is-dragover {
	background: #fff3e8;
	border-color: #8b3a15;
}
.sm-vs-dropzone-icon {
	font-size: 2.75rem;
	color: var(--selvamart-primary, #c4622d);
	margin-bottom: 0.75rem;
}
.sm-vs-dropzone-text {
	font-size: 1rem;
	font-weight: 700;
	color: #2a1f14;
	margin-bottom: 0.35rem;
}
.sm-vs-dropzone-subtext {
	font-size: 0.825rem;
	color: #8b6340;
}
.sm-vs-file-input {
	display: none;
}

/* Camera Live Viewfinder */
.sm-vs-camera-viewport {
	display: none;
	position: relative;
	width: 100%;
	max-height: 280px;
	border-radius: 12px;
	overflow: hidden;
	background: #000;
	margin-bottom: 1rem;
}
.sm-vs-camera-video {
	width: 100%;
	height: 280px;
	object-fit: cover;
}
.sm-vs-scan-line {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, transparent, #c4622d, #ffc327, #c4622d, transparent);
	box-shadow: 0 0 12px #c4622d;
	animation: smScan 2s linear infinite;
	display: none;
}
@keyframes smScan {
	0% { top: 0; }
	50% { top: 90%; }
	100% { top: 0; }
}

/* Action Controls Bar */
.sm-vs-actions {
	display: flex;
	gap: 0.75rem;
	margin-top: 1.25rem;
	justify-content: center;
}
.sm-vs-btn {
	padding: 0.65rem 1.35rem;
	border-radius: 8px;
	font-weight: 700;
	font-size: 0.925rem;
	cursor: pointer;
	border: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	transition: all 0.18s ease;
}
.sm-vs-btn--primary {
	background: var(--selvamart-primary, #c4622d);
	color: #fff;
	box-shadow: 0 4px 14px rgba(196, 98, 45, 0.28);
}
.sm-vs-btn--primary:hover {
	background: #8b3a15;
}
.sm-vs-btn--secondary {
	background: #ede0c8;
	color: #2a1f14;
}
.sm-vs-btn--secondary:hover {
	background: #e0d0b0;
}

/* AI Analysis Results Area */
.sm-vs-results {
	display: none;
	margin-top: 1.5rem;
}
.sm-vs-analysis-card {
	background: #fffdf8;
	border: 1px solid #ede0c8;
	border-left: 4px solid var(--selvamart-primary, #c4622d);
	border-radius: 10px;
	padding: 1rem 1.25rem;
	margin-bottom: 1.25rem;
	display: flex;
	align-items: flex-start;
	gap: 1rem;
}
.sm-vs-preview-thumb {
	width: 68px;
	height: 68px;
	border-radius: 8px;
	object-fit: cover;
	border: 1px solid #ede0c8;
	flex-shrink: 0;
}
.sm-vs-analysis-details {
	flex: 1;
	min-width: 0;
}
.sm-vs-badge {
	display: inline-block;
	background: #fff3e8;
	color: #c4622d;
	font-size: 0.75rem;
	font-weight: 800;
	padding: 0.2rem 0.55rem;
	border-radius: 4px;
	text-transform: uppercase;
	margin-bottom: 0.35rem;
}
.sm-vs-detected-name {
	font-size: 1.05rem;
	font-weight: 800;
	color: #2a1f14;
	margin: 0 0 0.25rem;
}
.sm-vs-confidence {
	font-size: 0.8125rem;
	color: #8b6340;
}

/* Products Grid in Modal */
.sm-vs-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 1rem;
}
.sm-vs-product-card {
	background: #ffffff;
	border: 1px solid #ede0c8;
	border-radius: 10px;
	padding: 0.75rem;
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sm-vs-product-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(42, 31, 20, 0.12);
}
.sm-vs-product-img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: 0.6rem;
}
.sm-vs-product-title {
	font-size: 0.875rem;
	font-weight: 700;
	color: #2a1f14;
	margin: 0 0 0.35rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.sm-vs-product-price {
	font-size: 0.9rem;
	font-weight: 800;
	color: var(--selvamart-primary, #c4622d);
	margin-top: auto;
}
