/**
 * Mokana Live Search — Styles
 *
 * Mokana-branded overlay: #202023 primary, #638e47 accent, Inter.
 * No Tailwind — all custom classes with mokana-search prefix.
 */

/* ---------- Blocksy search form controls: black icon ---------- */
.ct-search-form-controls .wp-element-button {
	color: #fff !important;
	background-color: #202023 !important;
}

/* ---------- Hide Blocksy's native search elements ---------- */
#search-modal {
	display: none !important;
}

.ct-search-box .ct-search-results {
	display: none !important;
}

/* ---------- Hide DGWT Ajax Search overlay/suggestions ---------- */
.dgwt-wcas-overlay-mobile,
.dgwt-wcas-suggestions-wrapp,
.dgwt-wcas-search-darkoverl {
	display: none !important;
}

/* ---------- Alpine x-cloak ---------- */
[x-cloak] {
	display: none !important;
}

/* ---------- SR-only ---------- */
.mokana-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Backdrop ---------- */
.mokana-search-backdrop {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: rgba(18, 18, 18, 0.6);
	backdrop-filter: blur(4px);
}

/* ---------- Panel ---------- */
.mokana-search-panel {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 101;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ---------- Container ---------- */
.mokana-search-container {
	max-width: 1520px;
	margin: 0 auto;
}

/* ---------- Input bar ---------- */
.mokana-search-input-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px 64px;
	border-bottom: 1px solid rgba(32, 32, 35, 0.06);
	background: #fff;
}

.mokana-search-icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	color: rgba(32, 32, 35, 0.4);
}

.mokana-search-input {
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	font-size: 16px;
	font-family: 'Inter', sans-serif;
	color: #202023;
}

.mokana-search-input::placeholder {
	color: rgba(32, 32, 35, 0.25);
}

.mokana-search-count {
	font-size: 14px;
	color: rgba(32, 32, 35, 0.4);
	white-space: nowrap;
}

.mokana-search-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border-radius: 50%;
	background: #202023 !important;
	color: #fff !important;
	border: none;
	cursor: pointer;
	transition: background 0.15s;
}

.mokana-search-close:hover {
	background: #1a1a1d;
}

.mokana-search-close svg {
	width: 16px;
	height: 16px;
}

/* ---------- Skeleton ---------- */
.mokana-search-skeleton {
	padding: 32px 64px;
}

.mokana-search-skeleton__pills {
	display: flex;
	gap: 12px;
	margin-bottom: 24px;
}

.mokana-search-skeleton__pill {
	height: 28px;
	width: 96px;
	border-radius: 9999px;
	background: #f5f3f1;
	animation: mokana-pulse 1.5s ease-in-out infinite;
}

.mokana-search-skeleton__pill--md {
	width: 80px;
}

.mokana-search-skeleton__pill--sm {
	width: 64px;
}

.mokana-search-skeleton__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.mokana-search-skeleton__card {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mokana-search-skeleton__image {
	height: 180px;
	border-radius: 12px;
	background: #f5f3f1;
	animation: mokana-pulse 1.5s ease-in-out infinite;
}

.mokana-search-skeleton__line {
	height: 16px;
	width: 100%;
	border-radius: 4px;
	background: #f5f3f1;
	animation: mokana-pulse 1.5s ease-in-out infinite;
}

.mokana-search-skeleton__line--short {
	width: 64px;
	height: 12px;
}

@keyframes mokana-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

/* ---------- No results ---------- */
.mokana-search-empty {
	padding: 64px 20px;
	text-align: center;
}

.mokana-search-empty__text {
	font-size: 14px;
	color: rgba(32, 32, 35, 0.5);
	margin: 0;
}

.mokana-search-empty__query {
	font-weight: 500;
	color: #202023;
}

.mokana-search-empty__hint {
	font-size: 12px;
	color: rgba(32, 32, 35, 0.3);
	margin: 4px 0 0;
}

/* ---------- Results layout ---------- */
.mokana-search-results {
	display: flex;
	gap: 48px;
	padding: 32px 64px;
}

/* ---------- Sidebar ---------- */
.mokana-search-sidebar {
	width: 220px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 32px;
}

/* ---------- Shared label ---------- */
.mokana-search-label {
	display: block;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: rgba(32, 32, 35, 0.3);
	margin-bottom: 12px;
	font-family: 'Inter', sans-serif;
}

/* ---------- Suggestions ---------- */
.mokana-search-suggestions__list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mokana-search-suggestions__link {
	font-size: 14px;
	font-weight: 500;
	color: #202023;
	text-decoration: none;
	transition: color 0.15s;
}

.mokana-search-suggestions__link:hover {
	color: #638e47;
}

.mokana-search-suggestions__all {
	font-size: 14px;
	font-weight: 500;
	color: #638e47;
	text-decoration: none;
}

/* ---------- Category pills ---------- */
.mokana-search-categories__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mokana-search-pill {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: 500;
	text-decoration: none;
	border: 1px solid rgba(32, 32, 35, 0.1);
	color: #202023;
	transition: border-color 0.15s;
}

.mokana-search-pill:hover {
	border-color: rgba(32, 32, 35, 0.25);
}

.mokana-search-pill--active {
	background: #202023;
	color: #fff;
	border-color: #202023;
}

.mokana-search-pill--active:hover {
	border-color: #202023;
}

/* ---------- CTA button (desktop) ---------- */
.mokana-search-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 20px;
	border-radius: 12px;
	background: #202023;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s;
}

.mokana-search-cta:hover {
	background: #1a1a1d;
	color: #fff;
}

.mokana-search-cta svg {
	width: 14px;
	height: 14px;
}

/* ---------- Product grid ---------- */
.mokana-search-grid-wrap {
	flex: 1;
}

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

.mokana-search-grid-count {
	font-size: 12px;
	color: rgba(32, 32, 35, 0.3);
}

.mokana-search-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

/* ---------- Product card ---------- */
.mokana-search-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 12px;
	background: #f5f3f1;
	text-decoration: none;
	transition: box-shadow 0.2s;
}

.mokana-search-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mokana-search-card--active {
	outline: 2px solid #638e47;
	outline-offset: -2px;
}

.mokana-search-card__image {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 180px;
	padding: 16px;
}

.mokana-search-card__image img {
	max-height: 100%;
	width: auto;
	object-fit: contain;
	transition: transform 0.3s;
}

.mokana-search-card:hover .mokana-search-card__image img {
	transform: scale(1.05);
}

.mokana-search-card__info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px 14px;
	background: #fff;
	flex: 1;
}

.mokana-search-card__category {
	font-size: 10px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: rgba(32, 32, 35, 0.35);
	font-family: 'Inter', sans-serif;
}

.mokana-search-card__name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: #202023;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-family: 'Inter', sans-serif;
}

/* ---------- Mobile footer ---------- */
.mokana-search-mobile-footer {
	display: none;
	border-top: 1px solid rgba(32, 32, 35, 0.06);
	padding: 16px 20px;
}

.mokana-search-mobile-cta {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px;
	border-radius: 12px;
	background: #202023;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.mokana-search-mobile-cta svg {
	width: 14px;
	height: 14px;
}

/* ---------- Transitions (Alpine x-transition classes) ---------- */
.mokana-search-fade-enter {
	transition: opacity 0.2s ease-out;
}
.mokana-search-fade-enter-start {
	opacity: 0;
}
.mokana-search-fade-enter-end {
	opacity: 1;
}
.mokana-search-fade-leave {
	transition: opacity 0.15s ease-in;
}
.mokana-search-fade-leave-start {
	opacity: 1;
}
.mokana-search-fade-leave-end {
	opacity: 0;
}

.mokana-search-slide-enter {
	transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
.mokana-search-slide-enter-start {
	opacity: 0;
	transform: translateY(-100%);
}
.mokana-search-slide-enter-end {
	opacity: 1;
	transform: translateY(0);
}
.mokana-search-slide-leave {
	transition: opacity 0.2s ease-in, transform 0.2s ease-in;
}
.mokana-search-slide-leave-start {
	opacity: 1;
	transform: translateY(0);
}
.mokana-search-slide-leave-end {
	opacity: 0;
	transform: translateY(-100%);
}

/* ========== Tablet (768-1024px) ========== */
@media (max-width: 1024px) {
	.mokana-search-input-bar {
		padding: 20px 40px;
	}

	.mokana-search-skeleton {
		padding: 32px 40px;
	}

	.mokana-search-skeleton__grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.mokana-search-skeleton__image {
		height: 160px;
	}

	.mokana-search-results {
		flex-direction: column;
		gap: 24px;
		padding: 24px 40px;
	}

	.mokana-search-sidebar {
		width: 100%;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 24px;
	}

	.mokana-search-suggestions {
		display: none;
	}

	.mokana-search-cta {
		display: none;
	}

	.mokana-search-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.mokana-search-card__image {
		height: 160px;
	}

	.mokana-search-mobile-footer {
		display: block;
	}
}

/* ========== Mobile (<768px) ========== */
@media (max-width: 767px) {
	.mokana-search-input-bar {
		padding: 16px 20px;
		gap: 12px;
	}

	.mokana-search-icon {
		width: 20px;
		height: 20px;
	}

	.mokana-search-count {
		display: none;
	}

	.mokana-search-skeleton {
		padding: 24px 20px;
	}

	.mokana-search-skeleton__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.mokana-search-skeleton__image {
		height: 140px;
	}

	.mokana-search-results {
		padding: 20px 20px;
		gap: 20px;
	}

	.mokana-search-suggestions {
		display: none;
	}

	.mokana-search-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.mokana-search-card__image {
		height: 140px;
	}

	.mokana-search-card__info {
		padding: 10px 12px;
	}
}
