/* AI Smart Search — widget styles v1.1 */

.aiss-widget {
	--aiss-primary: #1c3564;
	--aiss-accent: #e8374a;
	direction: rtl;
	max-width: 1100px;
	margin: 0 auto;
	font-family: inherit;
	line-height: 1.5;
}

.aiss-widget *,
.aiss-widget *::before,
.aiss-widget *::after {
	box-sizing: border-box;
}

/* --- מעטפת אחת מעוגלת: פאנל כחול למעלה, אזור לבן למטה --- */

.aiss-shell {
	background: #fff;
	border-radius: 22px;
	overflow: hidden;
	box-shadow: 0 16px 44px rgba(16, 30, 60, 0.16);
}

/* --- הפאנל העליון --- */

.aiss-panel {
	position: relative;
	overflow: hidden;
	padding: 32px 30px 30px;
	background: var(--aiss-primary);
	background: linear-gradient(140deg, var(--aiss-primary) 0%, color-mix(in srgb, var(--aiss-primary) 70%, #000) 100%);
}

.aiss-panel::before,
.aiss-panel::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.06);
	pointer-events: none;
}

.aiss-panel::before {
	width: 240px;
	height: 240px;
	top: -110px;
	inset-inline-start: -70px;
}

.aiss-panel::after {
	width: 160px;
	height: 160px;
	bottom: -80px;
	inset-inline-end: -40px;
}

.aiss-title {
	position: relative;
	margin: 0 0 6px;
	color: #fff;
	font-size: clamp(22px, 3.2vw, 30px);
	font-weight: 800;
	letter-spacing: -0.3px;
}

.aiss-subtitle {
	position: relative;
	margin: 0 0 20px;
	color: rgba(255, 255, 255, 0.75);
	font-size: 15px;
}

/* --- שורת החיפוש --- */

.aiss-form {
	position: relative;
	display: flex;
	gap: 10px;
	align-items: stretch;
}

.aiss-inputwrap {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}

.aiss-icon-search {
	position: absolute;
	width: 20px;
	height: 20px;
	top: 50%;
	inset-inline-start: 18px;
	transform: translateY(-50%);
	color: rgba(28, 53, 100, 0.45);
	pointer-events: none;
}

.aiss-input {
	width: 100%;
	padding: 15px 48px 15px 20px;
	font-size: 16px;
	font-family: inherit;
	color: var(--aiss-primary);
	background: #fff;
	border: none;
	border-radius: 999px;
	outline: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	transition: box-shadow 0.15s ease;
}

.aiss-input::placeholder {
	color: rgba(28, 53, 100, 0.45);
}

.aiss-input:focus {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.aiss-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 15px 30px;
	font-size: 16px;
	font-weight: 700;
	font-family: inherit;
	color: #fff;
	background: var(--aiss-accent);
	border: none;
	border-radius: 999px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
	transition: filter 0.15s ease, transform 0.1s ease;
}

.aiss-icon-spark {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

.aiss-btn:hover:not(:disabled) {
	filter: brightness(1.1);
}

.aiss-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.aiss-btn:disabled {
	opacity: 0.7;
	cursor: wait;
}

/* --- האזור הלבן: סטטוס + מוצרים --- */

.aiss-body {
	padding: 22px 26px 28px;
	background: #fff;
}

.aiss-status:not(:empty) {
	margin-bottom: 16px;
}

.aiss-wait {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--aiss-primary);
	font-size: 15px;
	font-weight: 600;
}

.aiss-wait::before {
	content: "";
	width: 18px;
	height: 18px;
	border: 3px solid rgba(28, 53, 100, 0.18);
	border-top-color: var(--aiss-accent);
	border-radius: 50%;
	animation: aiss-spin 0.8s linear infinite;
}

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

.aiss-summary {
	color: var(--aiss-primary);
	font-size: 17px;
	font-weight: 700;
}

.aiss-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.aiss-chip {
	display: inline-block;
	padding: 4px 13px;
	font-size: 13px;
	font-weight: 600;
	color: var(--aiss-primary);
	background: rgba(28, 53, 100, 0.07);
	border: 1px solid rgba(28, 53, 100, 0.16);
	border-radius: 999px;
}

.aiss-clear {
	display: inline-block;
	margin-top: 12px;
	padding: 0;
	font-size: 13px;
	font-family: inherit;
	color: rgba(28, 53, 100, 0.7);
	background: none;
	border: none;
	border-bottom: 1px dashed rgba(28, 53, 100, 0.4);
	cursor: pointer;
}

.aiss-clear:hover {
	color: var(--aiss-accent);
	border-bottom-color: var(--aiss-accent);
}

/* --- כותרת מקטע המוצרים --- */

.aiss-results-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 4px 0 16px;
	color: var(--aiss-primary);
	font-size: 18px;
	font-weight: 800;
}

.aiss-results-head::before {
	content: "";
	width: 5px;
	height: 21px;
	border-radius: 3px;
	background: var(--aiss-accent);
}

/* --- הודעות --- */

.aiss-note,
.aiss-empty,
.aiss-error {
	margin: 0 0 16px;
	padding: 12px 16px;
	border-radius: 12px;
	font-size: 15px;
}

.aiss-note {
	color: #7a5b00;
	background: #fff7e0;
	border: 1px solid #f0dea2;
}

.aiss-empty {
	color: var(--aiss-primary);
	background: rgba(28, 53, 100, 0.05);
	border: 1px dashed rgba(28, 53, 100, 0.3);
	text-align: center;
	padding: 28px 16px;
}

.aiss-error {
	color: #8d2029;
	background: #fdecee;
	border: 1px solid #f3bfc5;
}

/* --- רשת המוצרים --- */

.aiss-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
	gap: 16px;
}

.aiss-searching .aiss-results {
	opacity: 0.4;
	filter: saturate(0.5);
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.aiss-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid rgba(28, 53, 100, 0.1);
	border-radius: 16px;
	overflow: hidden;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.aiss-card:hover {
	transform: translateY(-4px);
	border-color: rgba(28, 53, 100, 0.2);
	box-shadow: 0 12px 28px rgba(16, 30, 60, 0.16);
}

.aiss-card-img {
	position: relative;
	aspect-ratio: 1 / 1;
	background: #f4f6fa;
}

.aiss-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.aiss-card-name {
	padding: 11px 13px 4px;
	font-size: 14px;
	font-weight: 600;
	color: var(--aiss-primary);
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.aiss-card-price {
	padding: 0 13px 10px;
	margin-top: auto;
	font-size: 15px;
	font-weight: 800;
	color: var(--aiss-primary);
}

.aiss-card-price del {
	color: rgba(28, 53, 100, 0.4);
	font-weight: 400;
	font-size: 13px;
	margin-inline-end: 6px;
}

.aiss-card-price ins {
	text-decoration: none;
	color: var(--aiss-accent);
}

.aiss-card-btn {
	display: block;
	margin: 0 12px 12px;
	padding: 9px 10px;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	color: var(--aiss-primary);
	background: rgba(28, 53, 100, 0.07);
	border-radius: 10px;
	transition: background 0.15s ease, color 0.15s ease;
}

.aiss-card:hover .aiss-card-btn {
	background: var(--aiss-accent);
	color: #fff;
}

/* --- מסך החיפוש הקופץ (Overlay) --- */

html.aiss-lock,
html.aiss-lock body {
	overflow: hidden !important;
}

.aiss-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.22s ease, visibility 0.22s ease;
}

.aiss-overlay.aiss-open {
	opacity: 1;
	visibility: visible;
}

.aiss-overlay-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(9, 15, 30, 0.62);
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
}

.aiss-overlay-panel {
	position: relative;
	height: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 4vh 18px 60px;
	direction: rtl;
}

.aiss-overlay-inner {
	max-width: 1000px;
	margin: 0 auto;
	transform: translateY(-28px);
	transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.aiss-overlay.aiss-open .aiss-overlay-inner {
	transform: translateY(0);
}

.aiss-overlay-top {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	justify-content: flex-end;
	padding: 4px 0 10px;
}

.aiss-overlay-close {
	width: 42px;
	height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
	font-family: inherit;
	color: #1c3564;
	background: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.aiss-overlay-close:hover {
	background: #e8374a;
	color: #fff;
	transform: rotate(90deg);
}

/* --- פאנל חי מתחת לתיבת החיפוש --- */

.aiss-live {
	--aiss-primary: #1c3564;
	--aiss-accent: #e8374a;
	position: fixed;
	inset: 0;
	z-index: 999998;
	pointer-events: none;
}

.aiss-live[hidden] {
	display: none;
}

.aiss-live-panel {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	width: min(1100px, calc(100vw - 24px));
	max-height: calc(100vh - 120px);
	display: flex;
	flex-direction: column;
	pointer-events: auto;
	direction: rtl;
	background: #fff;
	border: 1px solid rgba(28, 53, 100, 0.08);
	border-radius: 18px;
	box-shadow: 0 26px 70px rgba(16, 30, 60, 0.28);
	opacity: 0;
	margin-top: -10px;
	transition: opacity 0.18s ease, margin-top 0.18s ease;
	overflow: hidden;
	font-family: inherit;
	line-height: 1.5;
}

.aiss-live-panel *,
.aiss-live-panel *::before,
.aiss-live-panel *::after {
	box-sizing: border-box;
}

.aiss-live.aiss-open .aiss-live-panel {
	opacity: 1;
	margin-top: 0;
}

.aiss-live-cols {
	display: flex;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	min-height: 0;
}

.aiss-live-side {
	flex: 0 0 280px;
	padding: 18px 20px;
	border-inline-end: 1px solid #eef1f6;
}

.aiss-live-sec + .aiss-live-sec {
	margin-top: 18px;
}

.aiss-live-sec h4 {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 800;
	color: var(--aiss-accent);
}

.aiss-live-sec ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aiss-live-item {
	display: block;
	width: 100%;
	padding: 7px 0;
	font-size: 14px;
	font-family: inherit;
	text-align: start;
	color: var(--aiss-primary);
	text-decoration: none;
	background: none;
	border: 0;
	border-bottom: 1px solid #f3f5f9;
	cursor: pointer;
}

.aiss-live-item b {
	font-weight: 800;
}

.aiss-live-item:hover {
	color: var(--aiss-accent);
}

.aiss-live-main {
	flex: 1 1 auto;
	min-width: 0;
	padding: 18px 20px;
}

.aiss-live-main .aiss-results-head {
	margin-top: 0;
	font-size: 16px;
}

.aiss-live-main .aiss-results-head:empty {
	display: none;
}

.aiss-live-status:not(:empty) {
	margin-bottom: 14px;
}

.aiss-live-grid.aiss-grid {
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}

.aiss-live-grid .aiss-card-name {
	font-size: 13px;
}

.aiss-live-grid .aiss-card-btn {
	font-size: 12px;
	padding: 7px 8px;
	margin: 0 10px 10px;
}

.aiss-live-aibtn {
	display: block;
	margin: 14px auto 4px;
	padding: 11px 24px;
	font-size: 14px;
	font-weight: 700;
	font-family: inherit;
	color: #fff;
	background: var(--aiss-accent);
	border: none;
	border-radius: 999px;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.aiss-live-aibtn:hover {
	filter: brightness(1.08);
}

.aiss-live-all {
	flex: 0 0 auto;
	display: block;
	margin: 0 18px 16px;
	padding: 13px 16px;
	font-size: 15px;
	font-weight: 800;
	font-family: inherit;
	color: #fff;
	background: var(--aiss-accent);
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.aiss-live-all:hover {
	filter: brightness(1.08);
}

.aiss-live-all:active {
	transform: translateY(1px);
}

/* ================================================================== */
/* חיפוש בתמונה (רמה 2) — קטע עצמאי, אפשר להסיר בשלמותו                */
/* ================================================================== */

.aiss-cam {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 15px 20px;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	color: #fff;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}

.aiss-cam svg {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

.aiss-cam:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.24);
}

.aiss-cam:active:not(:disabled) {
	transform: translateY(1px);
}

.aiss-cam:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* בשורת החיפוש הרחבה מספיק הכיתוב מיותר — האייקון מדבר בעד עצמו */
@media (min-width: 561px) {
	.aiss-form .aiss-cam .aiss-cam-label {
		display: none;
	}
}

/* בפאנל החי הכפתור יושב על רקע לבן, ולכן צבעוני ולא שקוף */
.aiss-live-cam {
	flex: 0 0 auto;
	padding: 14px 20px 0;
}

.aiss-live-cam .aiss-cam {
	width: 100%;
	padding: 12px 18px;
	color: var(--aiss-primary);
	background: rgba(28, 53, 100, 0.06);
	border: 1px dashed rgba(28, 53, 100, 0.3);
}

.aiss-live-cam .aiss-cam:hover:not(:disabled) {
	color: #fff;
	background: var(--aiss-accent);
	border-color: var(--aiss-accent);
}

/* המתנה עם תצוגה מקדימה של התמונה שנשלחה */
.aiss-imgwait {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--aiss-primary);
	font-size: 15px;
	font-weight: 600;
}

.aiss-imgwait img {
	width: 54px;
	height: 54px;
	flex: 0 0 auto;
	object-fit: cover;
	border-radius: 10px;
	border: 1px solid rgba(28, 53, 100, 0.15);
}

.aiss-imgwait-text {
	position: relative;
	padding-inline-start: 26px;
}

.aiss-imgwait-text::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 50%;
	margin-top: -9px;
	width: 18px;
	height: 18px;
	border: 3px solid rgba(28, 53, 100, 0.18);
	border-top-color: var(--aiss-accent);
	border-radius: 50%;
	animation: aiss-spin 0.8s linear infinite;
}

/* ================================================================== */
/* סוף קטע חיפוש בתמונה                                                */
/* ================================================================== */

/* --- מובייל --- */

@media (max-width: 560px) {
	.aiss-panel {
		padding: 24px 18px 22px;
	}

	.aiss-form {
		flex-direction: column;
	}

	.aiss-btn {
		width: 100%;
	}

	.aiss-form .aiss-cam {
		width: 100%;
		order: 2;
	}

	.aiss-body {
		padding: 18px 14px 20px;
	}

	.aiss-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.aiss-overlay-panel {
		padding: 0 0 40px;
	}

	.aiss-overlay-inner {
		max-width: none;
	}

	.aiss-overlay-top {
		padding: 10px 12px;
	}

	.aiss-overlay .aiss-shell {
		border-radius: 0;
		min-height: calc(100vh - 62px);
	}
}

/* פאנל חי במסכים צרים: תופס את כל הרוחב עד תחתית המסך, עמודה אחת */
@media (max-width: 768px) {
	.aiss-live-panel {
		left: 0;
		transform: none;
		width: 100vw;
		border-radius: 0 0 16px 16px;
		max-height: calc(100vh - 70px);
	}

	.aiss-live-cols {
		flex-direction: column;
	}

	.aiss-live-side {
		flex: none;
		border-inline-end: none;
		border-bottom: 1px solid #eef1f6;
		padding: 14px 16px;
	}

	.aiss-live-sec ul li:nth-child(n+5) {
		display: none;
	}

	.aiss-live-main {
		padding: 14px 16px;
	}

	/* במובייל: מוצר אחד בשורה — תמונה מימין, שם מלא ומחיר לצידה */
	.aiss-live-grid.aiss-grid {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.aiss-live-grid .aiss-card {
		display: grid;
		grid-template-columns: 78px 1fr;
		grid-template-rows: auto auto;
		column-gap: 12px;
		row-gap: 2px;
		align-content: center;
		padding: 8px 10px;
		border-radius: 13px;
	}

	.aiss-live-grid .aiss-card:hover {
		transform: none;
	}

	.aiss-live-grid .aiss-card-img {
		grid-row: 1 / span 2;
		grid-column: 1;
		width: 78px;
		aspect-ratio: 1 / 1;
		border-radius: 10px;
		overflow: hidden;
	}

	.aiss-live-grid .aiss-card-name {
		grid-column: 2;
		grid-row: 1;
		align-self: end;
		padding: 0;
		font-size: 14px;
		display: block;
		-webkit-line-clamp: unset;
		-webkit-box-orient: unset;
		overflow: visible;
	}

	.aiss-live-grid .aiss-card-price {
		grid-column: 2;
		grid-row: 2;
		align-self: start;
		margin-top: 0;
		padding: 0;
		font-size: 14px;
	}

	.aiss-live-grid .aiss-card-btn {
		display: none;
	}

	.aiss-live-all {
		margin: 0 12px 12px;
	}
}
