/* ═══════════════════════════════════════════════════════
   AliKart — Live Search Spotlight (cacheable stylesheet)
   ═══════════════════════════════════════════════════════ */

/* ── Header Search Trigger ── */
.header-search form input[name="s"] {
	border-radius: 50px !important;
	border: 2px solid #e2e8f0 !important;
	padding-left: 20px !important;
	padding-right: 50px !important;
	cursor: pointer !important;
	background-color: #f8fafc !important;
	transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}
.header-search form input[name="s"]:hover {
	border-color: #cbd5e1 !important;
}

/* Hide ALL native search dropdowns */
.header-search .search-result,
.header-search .search-results,
.header-search .ajax-search-result,
.ajax-search-results,
.search-dropdown,
.dgwt-wcas-search-wrapp,
.ak-search-results {
	display: none !important;
}

/* ── Spotlight Overlay ── */
.ak-spotlight-overlay {
	position: fixed; inset: 0;
	background: rgba(15, 23, 42, 0.65);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	z-index: 999990;
	opacity: 0; visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}
.ak-spotlight-overlay.active { opacity: 1; visibility: visible; }

/* ── Spotlight Modal ── */
.ak-spotlight-modal {
	position: fixed; inset: 0;
	width: 100%; max-width: 100%; height: 100vh;
	background: #f4f6f9; border-radius: 0;
	z-index: 999999; box-shadow: none;
	transform: translateY(-12px) scale(0.98);
	opacity: 0; visibility: hidden;
	transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex; flex-direction: column; overflow: hidden;
}
html.dark .ak-spotlight-modal { background: #0f172a; }
.ak-spotlight-modal.active { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* ── Modal Header ── */
.ak-spotlight-header {
	padding: 14px 24px; border-bottom: 1px solid #e2e8f0;
	display: flex; align-items: center; gap: 12px;
	background: #ffffff; z-index: 10;
	box-shadow: 0 4px 20px rgba(0,0,0,0.03);
	flex-shrink: 0;
}
html.dark .ak-spotlight-header { border-bottom-color: #334155; background: #1e293b; }

.ak-spotlight-header .ak-sp-search-icon { font-size: 22px; color: #2bbef9; flex-shrink: 0; }

.ak-spotlight-header .ak-sp-input-wrap {
	flex: 1; display: flex; align-items: center; position: relative;
}

.ak-spotlight-header input {
	width: 100%; border: none !important; background: transparent !important;
	font-size: 17px !important; font-weight: 500 !important; color: #0f172a !important;
	padding: 0 !important; outline: none !important; box-shadow: none !important;
}
html.dark .ak-spotlight-header input { color: #f8fafc !important; }
.ak-spotlight-header input::placeholder { color: #94a3b8; }

.ak-sp-kbd {
	display: inline-flex; align-items: center; padding: 3px 7px;
	border-radius: 5px; background: #f1f5f9; border: 1px solid #e2e8f0;
	color: #94a3b8; font-size: 11px; font-family: inherit; font-weight: 600;
	flex-shrink: 0; line-height: 1; pointer-events: none;
}
html.dark .ak-sp-kbd { background: #334155; border-color: #475569; color: #94a3b8; }

.ak-spotlight-loader {
	display: none; font-size: 20px; color: #2bbef9;
	flex-shrink: 0; animation: akSpSpin 0.8s linear infinite;
}
@keyframes akSpSpin { to { transform: rotate(360deg); } }

.ak-spotlight-header .ak-sp-cart {
	position: relative; color: #0f172a; text-decoration: none;
	display: flex; align-items: center; flex-shrink: 0; margin-left: 4px;
}
html.dark .ak-spotlight-header .ak-sp-cart { color: #f8fafc; }
.ak-spotlight-header .ak-sp-cart .ak-sp-cart-icon { font-size: 24px; }
.ak-spotlight-header .ak-sp-cart .ak-sp-cart-count {
	position: absolute; top: -5px; right: -8px;
	background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
	min-width: 16px; height: 16px; display: flex; align-items: center;
	justify-content: center; border-radius: 10px; padding: 0 4px;
	line-height: 1; border: 1.5px solid #fff;
}

.ak-spotlight-close {
	background: #f1f5f9; border: none; width: 34px; height: 34px;
	border-radius: 50%; display: flex; align-items: center;
	justify-content: center; font-size: 18px; color: #64748b;
	cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.ak-spotlight-close:hover { background: #fee2e2; color: #ef4444; }
html.dark .ak-spotlight-close { background: #334155; color: #f8fafc; }
html.dark .ak-spotlight-close:hover { background: #475569; color: #f87d09; }

/* ── Modal Body ── */
.ak-spotlight-results {
	padding: 24px 30px; flex: 1; overflow-y: auto;
	display: none; scroll-behavior: smooth;
}

/* ── Trending / Empty State ── */
.ak-sp-trending { padding: 30px 0; text-align: center; }
.ak-sp-trending-label {
	font-size: 12px; font-weight: 700; color: #94a3b8;
	text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px;
}
.ak-sp-trending-hint { font-size: 13px; color: #64748b; margin: 0; }

.ak-sp-recent-bar {
	display: flex; align-items: center; justify-content: space-between;
	padding: 0 0 16px; border-bottom: 1px solid #f1f5f9; margin-bottom: 20px;
}
.ak-sp-recent-label { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.08em; }
.ak-sp-recent-clear {
	background: none; border: none; color: #94a3b8; font-size: 12px;
	font-weight: 600; cursor: pointer; font-family: inherit;
	transition: color 0.2s;
}
.ak-sp-recent-clear:hover { color: #ef4444; }

.ak-sp-recent-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.ak-sp-recent-chip {
	display: inline-flex; align-items: center; gap: 4px;
	padding: 6px 14px; border-radius: 8px; background: #f1f5f9;
	border: 1px solid #e2e8f0; color: #475569; font-size: 13px;
	font-weight: 500; cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.ak-sp-recent-chip:hover { background: #fff5f0; border-color: #f87d09; color: #f87d09; }

/* ── Budget (Under ₹X) Chip ── */
.ak-sp-budget {
	display: flex; align-items: center; gap: 8px;
	padding: 10px 14px; margin-bottom: 16px; border-radius: 10px;
	background: #fff7ed; border: 1px solid #fed7aa; color: #c2410c;
	font-size: 14px; font-weight: 600;
}
html.dark .ak-sp-budget { background: #431407; border-color: #7c2d12; color: #fdba74; }
.ak-sp-budget .bx-rupee { font-size: 18px; color: #f87d09; }
.ak-sp-budget-label { flex: 1; }
.ak-sp-budget-clear {
	background: #ffedd5; border: none; width: 24px; height: 24px;
	border-radius: 50%; display: inline-flex; align-items: center;
	justify-content: center; font-size: 15px; color: #c2410c;
	cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.ak-sp-budget-clear:hover { background: #fed7aa; color: #9a3412; }

/* ── Product Grid ── */
.ak-spotlight-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;
}

.ak-search-item {
	display: flex; flex-direction: column; align-items: center; text-align: center;
	padding: 14px; border: 1.5px solid #e2e8f0; border-radius: 14px;
	transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); background: #ffffff;
	position: relative; overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
html.dark .ak-search-item { border-color: #334155; background: #1e293b; }
.ak-search-item:hover {
	border-color: #2bbef9; transform: translateY(-4px);
	box-shadow: 0 12px 28px rgba(43,190,249,0.12);
}
html.dark .ak-search-item:hover { border-color: #38bdf8; }

.ak-product-image-wrapper {
	position: relative; width: 100%; display: flex;
	justify-content: center; align-items: center;
	border-radius: 10px; margin-bottom: 12px;
	background: #f8fafc; padding: 8px;
}
.ak-product-image-wrapper img {
	width: 100%; height: 140px; object-fit: contain; mix-blend-mode: multiply;
}
html.dark .ak-product-image-wrapper img { mix-blend-mode: normal; }

.ak-item-info {
	display: flex; flex-direction: column; align-items: center;
	justify-content: space-between; width: 100%; flex: 1;
}
.ak-item-title {
	color: #0f172a; font-size: 13px; font-weight: 600; line-height: 1.4;
	margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2;
	-webkit-box-orient: vertical; overflow: hidden; text-decoration: none;
	min-height: 36px;
}
.ak-item-title:hover { color: #2bbef9; }
html.dark .ak-search-item .ak-item-title { color: #f8fafc; }

.ak-item-price {
	font-size: 16px; font-weight: 800; display: flex; align-items: center;
	justify-content: center; gap: 6px; flex-wrap: wrap;
}
.ak-item-price del, .ak-item-price del span {
	color: #ef4444 !important; font-weight: 600; font-size: 12px;
	text-decoration: line-through;
}
.ak-item-price ins, .ak-item-price ins span, .ak-item-price > span {
	color: #10b981 !important; font-weight: 800; text-decoration: none;
}

/* Add to Cart Button */
.ak-add-to-cart-plus {
	position: absolute; bottom: -10px; right: -4px;
	background-color: #FFCC00 !important; color: #000 !important;
	width: 38px; height: 38px; border-radius: 50% !important;
	display: flex !important; align-items: center !important;
	justify-content: center !important; font-size: 22px !important;
	font-weight: 900 !important; text-decoration: none !important;
	box-shadow: 0 4px 10px rgba(0,0,0,0.12) !important; z-index: 10;
	transition: transform 0.2s, background-color 0.2s !important;
	line-height: 1 !important; border: none !important; padding: 0 !important;
}
.ak-add-to-cart-plus:hover { transform: scale(1.1); background-color: #ffdb4d !important; }
.ak-add-to-cart-plus.loading { opacity: 0.5; pointer-events: none; }
.ak-search-item a.added_to_cart { display: none !important; }

/* Empty State */
.ak-search-empty { text-align: center; padding: 40px 15px; color: #64748b; }
.ak-search-empty i { font-size: 40px; color: #cbd5e1; margin-bottom: 10px; display: block; }

/* View All Footer */
.ak-search-footer { text-align: center; padding: 16px; margin-top: 16px; }
.ak-search-all {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 12px 24px; background: #f1f5f9; color: #0f172a;
	border-radius: 12px; font-weight: 600; font-size: 14px;
	text-decoration: none; transition: all 0.2s; border: 1px solid transparent;
}
.ak-search-all:hover { background: #fff5f0; border-color: #f87d09; color: #f87d09; }

/* Infinite Scroll Loader */
.ak-search-more { text-align: center; padding: 20px; }
.ak-search-more i { font-size: 22px; color: #2bbef9; }
.ak-search-more div { font-size: 13px; color: #64748b; margin-top: 4px; }

/* ── Skeleton Loading ── */
.ak-sp-skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.ak-sp-skeleton-item {
	border: 1.5px solid #e2e8f0; border-radius: 14px; padding: 14px;
	background: #fff; overflow: hidden;
}
.ak-sp-skel-img { width: 100%; height: 120px; background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: akSpShimmer 1.5s infinite; border-radius: 8px; margin-bottom: 12px; }
.ak-sp-skel-title { width: 80%; height: 12px; background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: akSpShimmer 1.5s infinite; border-radius: 4px; margin: 0 auto 8px; }
.ak-sp-skel-price { width: 40%; height: 14px; background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: akSpShimmer 1.5s infinite; border-radius: 4px; margin: 0 auto; }
@keyframes akSpShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Responsive ── */
@media (max-width: 768px) {
	.ak-spotlight-header { padding: 12px 15px; gap: 10px; }
	.ak-spotlight-header input { font-size: 15px !important; }
	.ak-sp-kbd { display: none; }
	.ak-spotlight-results { padding: 15px; }
	.ak-spotlight-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.ak-sp-skeleton-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.ak-product-image-wrapper img { height: 110px; }
	.ak-item-title { font-size: 12px; min-height: 32px; }
	.ak-item-price { font-size: 14px; }
	.ak-add-to-cart-plus { width: 34px; height: 34px; font-size: 18px !important; }
}
@media (max-width: 480px) {
	.ak-spotlight-header .ak-sp-cart { display: none; }
	.ak-spotlight-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
	.ak-search-item { padding: 10px; border-radius: 12px; }
	.ak-product-image-wrapper img { height: 90px; }
}
