/* ========================================================
   MJ WORLD FOOD — INTERACTIVE SEARCH MODAL STYLES
   ======================================================== */

/* 1. Modal Overlay Backdrop */
#mj-search-modal.mj-search-modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(15, 23, 12, 0.65);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 24px 16px 32px 16px;
	overflow-y: auto;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#mj-search-modal.is-open {
	display: flex !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

/* 2. Modal Card Container */
.mj-search-modal-box {
	width: 100%;
	max-width: 1060px;
	background: #ffffff;
	border-radius: 24px;
	padding: 24px 28px;
	box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(228, 233, 216, 0.8);
	transform: translateY(-16px) scale(0.98);
	opacity: 0;
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
	margin: auto 0;
	display: flex;
	flex-direction: column;
	text-align: left;
}

#mj-search-modal.is-open .mj-search-modal-box {
	transform: translateY(0) scale(1) !important;
	opacity: 1 !important;
}

/* 3. Visibility Classes (High Specificity to Prevent View Stacking) */
#mj-search-default-view.hidden,
#mj-search-results-view.hidden,
#mj-search-spinner.hidden,
#mj-search-clear-btn.hidden,
#mj-latest-searches-container.hidden,
.mj-search-modal-box .hidden,
.mj-search-hidden {
	display: none !important;
}

/* 4. Search Header Row */
.mj-search-header-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-bottom: 14px;
	border-bottom: 1px solid #EAEFE0;
}

.mj-search-logo-col {
	flex-shrink: 0;
	display: flex;
	align-items: center;
}

.mj-search-form {
	flex: 1;
	position: relative;
	display: flex;
	align-items: center;
}

.mj-search-glass-icon {
	position: absolute;
	left: 16px;
	font-size: 20px;
	color: #5F6658;
	pointer-events: none;
}

.mj-search-input {
	width: 100%;
	height: 48px;
	background: #FAFCF4;
	border: 1.5px solid #E4E9D8;
	border-radius: 14px;
	padding-left: 48px;
	padding-right: 86px;
	font-size: 14.5px;
	font-weight: 500;
	color: #111111;
	transition: all 0.2s ease;
	outline: none;
}

.mj-search-input::placeholder {
	color: #94a3b8;
	font-weight: 400;
}

.mj-search-input:hover {
	border-color: #cbd5e1;
}

.mj-search-input:focus {
	background: #ffffff;
	border-color: #527D18;
	box-shadow: 0 0 0 3px rgba(82, 125, 24, 0.12);
}

.mj-search-clear {
	position: absolute;
	right: 48px;
	color: #94a3b8;
	font-size: 18px;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	transition: color 0.15s ease;
}

.mj-search-clear:hover {
	color: #1e293b;
}

.mj-search-spin-icon {
	position: absolute;
	right: 48px;
	font-size: 18px;
	color: #527D18;
}

.mj-search-submit-btn {
	position: absolute;
	right: 7px;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: linear-gradient(135deg, #527D18 0%, #85A91B 100%);
	color: #ffffff;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 6px rgba(82, 125, 24, 0.25);
}

.mj-search-submit-btn:hover {
	background: #3B5A11;
	transform: scale(1.04);
}

.mj-search-submit-btn:active {
	transform: scale(0.94);
}

.mj-search-close-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #FAFCF4;
	border: 1.5px solid #E4E9D8;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	color: #5F6658;
	cursor: pointer;
	flex-shrink: 0;
	transition: all 0.2s ease;
}

.mj-search-close-btn:hover {
	background: #F4F8E8;
	border-color: #85A91B;
	color: #111111;
	transform: rotate(90deg);
}

/* 5. Latest Searches Row */
.mj-latest-searches-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 0;
	border-bottom: 1px solid #EAEFE0;
	font-size: 12.5px;
}

.mj-latest-label {
	font-weight: 600;
	color: #5F6658;
	margin-right: 4px;
	flex-shrink: 0;
}

.mj-latest-chips-wrap {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

.mj-search-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #ffffff;
	border: 1px solid #D8E0CC;
	padding: 3px 10px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: 500;
	color: #374151;
	transition: all 0.18s ease;
	cursor: pointer;
}

.mj-search-chip:hover {
	background: #F4F8E8;
	border-color: #85A91B;
	color: #527D18;
}

.mj-search-chip .mj-chip-remove {
	color: #94a3b8;
	font-size: 14px;
	font-weight: bold;
	margin-left: 2px;
	transition: color 0.15s ease;
}

.mj-search-chip:hover .mj-chip-remove {
	color: #527D18;
}

.mj-search-chip .mj-chip-remove:hover {
	color: #ef4444;
}

.mj-delete-all-btn {
	margin-left: auto;
	color: #F28A2E;
	font-weight: 700;
	font-size: 12px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px 4px;
	transition: opacity 0.15s ease;
}

.mj-delete-all-btn:hover {
	text-decoration: underline;
	opacity: 0.85;
}

/* 6. Modal Body Scroll Container */
.mj-search-body-scroll {
	margin-top: 16px;
	max-height: 68vh;
	overflow-y: auto;
	padding-right: 4px;
}

/* 7. Side-by-Side Flex Layout (Default State) */
.mj-search-default-grid {
	display: flex;
	gap: 24px;
	align-items: flex-start;
}

/* Left Column: Popular Searches Sidebar */
.mj-search-sidebar-col {
	width: 190px;
	flex-shrink: 0;
	border-right: 1px solid #EAEFE0;
	padding-right: 18px;
}

.mj-col-title {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: 'Poppins', sans-serif;
	font-size: 13.5px;
	font-weight: 700;
	color: #111111;
	margin: 0 0 10px 0;
}

.mj-fire-icon {
	color: #F28A2E;
	font-size: 16px;
}

.mj-sparkle-icon {
	color: #527D18;
	font-size: 16px;
}

.mj-popular-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.mj-popular-keyword-btn {
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	border-radius: 8px;
	padding: 6px 8px;
	font-size: 13px;
	font-weight: 500;
	color: #475569;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	transition: all 0.18s ease;
}

.mj-popular-keyword-btn:hover {
	background: #F4F8E8;
	color: #527D18;
	font-weight: 600;
	padding-left: 12px;
}

.mj-arrow-hint {
	font-size: 11px;
	color: #85A91B;
	opacity: 0;
	transition: opacity 0.18s ease;
}

.mj-popular-keyword-btn:hover .mj-arrow-hint {
	opacity: 1;
}

/* Right Column: Recommended Products */
.mj-search-main-col {
	flex: 1 1 0%;
	min-width: 0;
}

.mj-col-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.mj-carousel-nav {
	display: flex;
	align-items: center;
	gap: 6px;
}

.mj-nav-btn {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #ffffff;
	border: 1.5px solid #E4E9D8;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	color: #5F6658;
	cursor: pointer;
	transition: all 0.2s ease;
}

.mj-nav-btn:hover {
	background: #F4F8E8;
	border-color: #85A91B;
	color: #527D18;
	transform: scale(1.05);
}

/* 8. Recommended Carousel & Cards */
.mj-rec-carousel {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding: 4px 2px 14px 2px;
	scrollbar-width: none;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
}

.mj-rec-carousel::-webkit-scrollbar {
	display: none;
}

.mj-rec-card {
	flex-shrink: 0;
	width: 175px;
	background: #ffffff;
	border: 1.5px solid #EAEFE0;
	border-radius: 16px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	position: relative;
	scroll-snap-align: start;
	transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.mj-rec-card:hover {
	border-color: #85A91B;
	box-shadow: 0 8px 24px -4px rgba(82, 125, 24, 0.15);
	transform: translateY(-3px);
}

.mj-discount-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	background: linear-gradient(135deg, #F28A2E 0%, #E07318 100%);
	color: #ffffff;
	font-size: 10px;
	font-weight: 800;
	padding: 2px 7px;
	border-radius: 6px;
	z-index: 5;
	box-shadow: 0 2px 5px rgba(242, 138, 46, 0.3);
}

.mj-card-img-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	background: #FAFCF4;
	padding: 6px;
	overflow: hidden;
	margin-bottom: 8px;
	text-decoration: none;
}

.mj-card-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.25s ease;
}

.mj-rec-card:hover .mj-card-img {
	transform: scale(1.05);
}

.mj-card-details {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.mj-card-brand {
	font-size: 10px;
	font-weight: 700;
	color: #85A91B;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mj-card-title {
	font-size: 12px;
	font-weight: 600;
	color: #111111;
	line-height: 1.35;
	margin: 0 0 8px 0;
	height: 32px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mj-card-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.mj-card-title a:hover {
	color: #527D18;
}

.mj-card-footer {
	margin-top: auto;
	padding-top: 8px;
	border-top: 1px solid #F0F4E8;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
}

.mj-card-price {
	display: flex;
	flex-direction: column;
	font-size: 13.5px;
	font-weight: 800;
	color: #111111;
	line-height: 1.2;
}

/* Quick Add Button in MJ Orange */
.mj-quick-add-btn {
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: #F28A2E;
	color: #ffffff;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	cursor: pointer;
	flex-shrink: 0;
	text-decoration: none;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 2px 6px rgba(242, 138, 46, 0.25);
}

.mj-quick-add-btn:hover {
	background: #d9731d;
	color: #ffffff;
	transform: scale(1.06);
	box-shadow: 0 4px 12px rgba(242, 138, 46, 0.4);
}

.mj-quick-add-btn:active {
	transform: scale(0.92);
}

.mj-quick-add-btn.is-added {
	background: #527D18 !important;
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(82, 125, 24, 0.4);
}

.mj-card-view-btn {
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: #F4F8E8;
	color: #527D18;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	text-decoration: none;
	transition: all 0.15s ease;
}

.mj-card-view-btn:hover {
	background: #E4E9D8;
	color: #3B5A11;
}

/* 9. Price Del & Ins Formatting */
.mj-card-price .woocommerce-Price-amount {
	font-weight: 700;
	color: #111111;
}

.mj-card-price del,
.mj-card-price del .woocommerce-Price-amount {
	font-size: 11px !important;
	color: #94a3b8 !important;
	font-weight: 500 !important;
	text-decoration: line-through;
	margin-right: 4px;
}

.mj-card-price ins,
.mj-card-price ins .woocommerce-Price-amount {
	text-decoration: none !important;
	color: #F28A2E !important;
	font-weight: 800 !important;
}

/* 10. Live Search Results (When typing) */
.mj-live-taxonomies-wrap {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-bottom: 14px;
	margin-bottom: 16px;
	border-bottom: 1px solid #EAEFE0;
}

.mj-live-tax-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.mj-live-tax-label {
	font-size: 11.5px;
	font-weight: 700;
	color: #5F6658;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-right: 4px;
}

.mj-search-result-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #ffffff;
	border: 1px solid #D8E0CC;
	padding: 5px 12px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
	text-decoration: none;
	transition: all 0.2s ease;
}

.mj-search-result-pill:hover {
	border-color: #527D18;
	color: #527D18;
	background: #FAFCF4;
	transform: translateY(-1px);
}

.mj-search-result-pill span.count {
	font-size: 11px;
	background: #F4F8E8;
	color: #527D18;
	padding: 1px 6px;
	border-radius: 20px;
}

.mj-search-term-highlight {
	color: #527D18;
	font-weight: 700;
	background: #FEF9C3;
	padding: 0 2px;
	border-radius: 3px;
}

.mj-live-products-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.mj-live-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 12px;
}

.mj-view-all-row {
	padding-top: 16px;
	margin-top: 16px;
	border-top: 1px solid #EAEFE0;
	text-align: center;
}

.mj-view-all-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: linear-gradient(135deg, #527D18 0%, #85A91B 100%);
	color: #ffffff;
	font-weight: 600;
	padding: 10px 24px;
	border-radius: 12px;
	font-size: 13.5px;
	text-decoration: none;
	box-shadow: 0 2px 8px rgba(82, 125, 24, 0.2);
	transition: all 0.2s ease;
}

.mj-view-all-btn:hover {
	background: #3B5A11;
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(82, 125, 24, 0.3);
}

/* Shimmer Loading Skeleton */
.mj-skeleton-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 12px;
}

.mj-skeleton-card {
	background: #ffffff;
	border: 1.5px solid #EAEFE0;
	border-radius: 16px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mj-skeleton-img {
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
	background-size: 200% 100%;
	animation: mjShimmer 1.2s infinite;
}

.mj-skeleton-text {
	height: 12px;
	border-radius: 6px;
	background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
	background-size: 200% 100%;
	animation: mjShimmer 1.2s infinite;
}

@keyframes mjShimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* 11. Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
	width: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
	background: #f3f4f6;
	border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

/* 12. Responsive Layout for Tablets & Mobile */
@media (max-width: 860px) {
	.mj-search-modal-box {
		padding: 18px 18px;
		border-radius: 20px;
	}
	
	.mj-search-default-grid {
		flex-direction: column;
		gap: 16px;
	}

	.mj-search-sidebar-col {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid #EAEFE0;
		padding-right: 0;
		padding-bottom: 12px;
	}

	.mj-popular-list {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 6px;
	}

	.mj-popular-keyword-btn {
		width: auto;
		background: #FAFCF4;
		border: 1px solid #E4E9D8;
		border-radius: 9999px;
		padding: 4px 12px;
		font-size: 12px;
	}

	.mj-popular-keyword-btn:hover {
		padding-left: 12px;
	}

	.mj-arrow-hint {
		display: none;
	}

	.mj-rec-card {
		width: 155px;
	}
}

@media (max-width: 600px) {
	#mj-search-modal.mj-search-modal-backdrop {
		padding: 8px 8px 16px 8px;
	}
	
	.mj-search-logo-col {
		display: none;
	}

	.mj-search-input {
		height: 44px;
		font-size: 13.5px;
		padding-left: 42px;
		padding-right: 76px;
	}

	.mj-search-glass-icon {
		left: 14px;
		font-size: 18px;
	}

	.mj-search-close-btn {
		width: 36px;
		height: 36px;
		font-size: 16px;
	}
}
