@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
	--rls-brand: #f77057;
	--rls-orange-icon: #f97316;
	--rls-text: #0f172a;
	--rls-text-secondary: #334155;
	--rls-text-muted: #64748b;
	--rls-text-faint: #94a3b8;
	--rls-border: #e2e8f0;
	--rls-border-light: #f1f5f9;
	--rls-filter-active-bg: #fff7ed;
	--rls-filter-active-border: #fdba74;
	--rls-success: #16a34a;
	--rls-veg-track: #86efac;
	--rls-shadow: -2px 2px 8px rgba(38, 38, 38, 0.2);
}

/* ── Home search bar ── */

.rl-search-bar {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 680px;
	height: 64px;
	margin: 0 auto 12px;
	padding: 0 16px;
	border-radius: 16px;
	border: 1px solid #d1d5db;
	background: #fff;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	cursor: pointer;
	user-select: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rl-search-bar:hover {
	border-color: #fdba74;
	box-shadow: 0 0 0 3px rgba(247, 112, 87, 0.08);
}

.rl-search-bar:focus-visible {
	outline: none;
	border-color: var(--rls-brand);
	box-shadow: 0 0 0 3px rgba(247, 112, 87, 0.15);
}

.rl-search-bar-icon {
	display: inline-flex;
	color: var(--rls-orange-icon);
	margin-right: 8px;
	flex-shrink: 0;
}

.rl-search-bar-placeholder-wrap {
	position: relative;
	flex: 1;
	min-width: 0;
	height: 24px;
	overflow: hidden;
}

.rl-search-bar-placeholder {
	display: block;
	font-size: 18px;
	font-weight: 400;
	color: #737373;
	line-height: 24px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.rl-search-bar-placeholder.is-exit {
	opacity: 0;
	transform: translateY(-15px);
}

.rl-search-bar-placeholder.is-enter {
	opacity: 0;
	transform: translateY(5px);
}

/* ── Search page shell ── */

.rl-search-page {
	--rls-pad: 16px;
	box-sizing: border-box;
	width: 100vw;
	max-width: 100vw;
	min-height: 100vh;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	background: #f8fafc;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--rls-text);
}

.rl-search-page *,
.rl-search-page *::before,
.rl-search-page *::after {
	box-sizing: border-box;
}

.rl-search-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--rls-border-light);
	box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.rl-search-header-copy {
	flex: 1;
	min-width: 0;
}

.rl-search-location {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 2px 0 0;
	font-size: 12px;
	font-weight: 600;
	color: var(--rls-text-muted);
	line-height: 1.3;
}

.rl-search-location svg {
	flex-shrink: 0;
	color: var(--rls-brand);
}

.rl-search-header-top {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px var(--rls-pad) 0;
}

.rl-search-back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: var(--rls-text);
	text-decoration: none;
	flex-shrink: 0;
}

.rl-search-header-title {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
	color: var(--rls-text);
	line-height: 1.2;
}

.rl-search-input-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px var(--rls-pad) 0;
}

.rl-search-input-wrap {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 48px;
	padding: 0 12px;
	border-radius: 14px;
	border: 1px solid var(--rls-border);
	background: #f8fafc;
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.rl-search-input-icon {
	color: var(--rls-text-muted);
	flex-shrink: 0;
}

.rl-search-input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	font-size: 15px;
	color: var(--rls-text);
	font-family: inherit;
	padding: 0;
}

.rl-search-input:focus {
	outline: none;
}

.rl-search-input::placeholder {
	color: var(--rls-text-faint);
}

.rl-search-clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--rls-text-muted);
	cursor: pointer;
	padding: 0;
}

.rl-search-clear.is-hidden {
	display: none;
}

.rl-search-veg-toggle {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 52px;
	flex-shrink: 0;
	cursor: pointer;
}

.rl-search-veg-input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.rl-search-veg-track {
	position: relative;
	width: 44px;
	height: 24px;
	border-radius: 999px;
	background: var(--rls-border);
	transition: background 0.2s ease;
}

.rl-search-veg-thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	border-radius: 999px;
	background: #f8fafc;
	transition: transform 0.2s ease, background 0.2s ease;
}

.rl-search-veg-input:checked + .rl-search-veg-track {
	background: var(--rls-veg-track);
}

.rl-search-veg-input:checked + .rl-search-veg-track .rl-search-veg-thumb {
	transform: translateX(20px);
	background: var(--rls-success);
}

.rl-search-veg-label {
	margin-top: 2px;
	font-size: 10px;
	font-weight: 800;
	color: var(--rls-success);
}

.rl-search-tabs {
	display: flex;
	gap: 24px;
	padding: 16px var(--rls-pad) 0;
	border-bottom: 1px solid var(--rls-border);
}

.rl-search-tab {
	border: 0;
	background: transparent;
	padding: 0 0 10px;
	font-size: 15px;
	font-weight: 600;
	color: var(--rls-text-muted);
	cursor: pointer;
	font-family: inherit;
	border-bottom: 3px solid transparent;
	margin-bottom: -1px;
	text-transform: capitalize;
}

.rl-search-tab.is-active {
	font-weight: 800;
	color: var(--rls-text);
	border-bottom-color: var(--rls-text);
}

.rl-search-filters {
	position: sticky;
	top: 168px;
	z-index: 15;
	background: rgba(248, 250, 252, 0.96);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--rls-border-light);
}

.rl-search-filters,
.rl-search-tags {
	display: flex;
	gap: 8px;
	padding: 10px var(--rls-pad);
	overflow-x: auto;
	scrollbar-width: none;
}

.rl-search-filters::-webkit-scrollbar,
.rl-search-tags::-webkit-scrollbar,
.rl-search-featured::-webkit-scrollbar {
	display: none;
}

.rl-search-tags {
	padding-top: 0;
	padding-bottom: 12px;
}

.rl-search-tags[hidden] {
	display: none;
}

.rl-search-filter-pill,
.rl-search-tag-pill {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid var(--rls-border);
	background: #fff;
	font-size: 13px;
	font-weight: 700;
	color: var(--rls-text-secondary);
	cursor: pointer;
	font-family: inherit;
	white-space: nowrap;
}

.rl-search-filter-pill.is-active,
.rl-search-filter-pill.is-active:hover {
	background: var(--rls-filter-active-bg);
	border-color: var(--rls-filter-active-border);
}

.rl-search-tag-pill {
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 12px;
	background: #fff;
}

.rl-search-body {
	padding: 4px 0 40px;
}

.rl-search-panel.is-active .rl-search-restaurants,
.rl-search-panel.is-active .rl-search-dishes {
	background: #fff;
	border-top: 1px solid var(--rls-border-light);
}

.rl-search-panel[hidden] {
	display: none;
}

.rl-search-section-label {
	margin: 8px var(--rls-pad) 4px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 1.2px;
	color: var(--rls-text-faint);
}

.rl-search-section-label[hidden] {
	display: none;
}

.rl-search-featured {
	display: flex;
	gap: 12px;
	padding: 8px var(--rls-pad) 4px;
	overflow-x: auto;
}

.rl-search-featured[hidden] {
	display: none;
}

.rl-search-featured-card {
	flex: 0 0 280px;
	width: 280px;
	height: 168px;
	border-radius: 16px;
	overflow: hidden;
	position: relative;
	text-decoration: none;
	color: #fff;
	display: block;
}

.rl-search-featured-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rl-search-featured-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(transparent 35%, rgba(0, 0, 0, 0.75));
}

.rl-search-featured-offer {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	padding: 4px 8px;
	border-radius: 6px;
	background: rgba(247, 112, 87, 0.95);
	font-size: 11px;
	font-weight: 800;
	color: #fff;
}

.rl-search-featured-meta {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	padding: 12px;
}

.rl-search-featured-name {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rl-search-featured-sub {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
	font-size: 12px;
	font-weight: 700;
}

.rl-search-restaurant {
	display: flex;
	gap: 12px;
	padding: 14px var(--rls-pad);
	border-bottom: 1px solid var(--rls-border-light);
	text-decoration: none;
	color: inherit;
}

.rl-search-restaurant:hover {
	background: #fafafa;
}

.rl-search-restaurant-thumb {
	position: relative;
	width: 88px;
	height: 88px;
	border-radius: 12px;
	overflow: hidden;
	flex-shrink: 0;
	background: #f3f4f6;
}

.rl-search-restaurant-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rl-search-restaurant-copy {
	flex: 1;
	min-width: 0;
}

.rl-search-restaurant-badge {
	margin: 0 0 4px;
	font-size: 11px;
	color: var(--rls-text-muted);
}

.rl-search-restaurant-name {
	margin: 0;
	font-size: 17px;
	font-weight: 800;
	color: var(--rls-text);
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rl-search-restaurant-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
}

.rl-search-rating {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 2px 6px;
	border-radius: 6px;
	background: var(--rls-success);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
}

.rl-search-restaurant-time {
	font-size: 13px;
	font-weight: 600;
	color: #475569;
}

.rl-search-restaurant-cuisines,
.rl-search-restaurant-location {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--rls-text-muted);
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rl-search-restaurant-location {
	font-size: 12px;
	color: var(--rls-text-faint);
	margin-top: 4px;
}

.rl-search-dish {
	display: flex;
	align-items: stretch;
	gap: 10px;
	margin: 0 var(--rls-pad) 12px;
	padding: 10px;
	border-radius: 18px;
	border: 1px solid #eef2f7;
	background: #fff;
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.rl-search-dish-main {
	flex: 1;
	min-width: 0;
	display: flex;
	gap: 12px;
	text-decoration: none;
	color: inherit;
}

.rl-search-dish:hover {
	border-color: #e2e8f0;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.rl-search-dish-copy {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.rl-search-dish-store {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	gap: 4px;
	margin-bottom: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	background: #fff7ed;
	border: 1px solid #ffedd5;
	font-size: 14px;
	font-weight: 600;
	color: #ea580c;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rl-search-dish-name {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #374151;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rl-search-dish-rating {
	display: inline-flex;
	align-self: flex-start;
	margin-top: 4px;
	padding: 2px 8px;
	border-radius: 6px;
	background: #ecfdf5;
	color: #047857;
	font-size: 11px;
	font-weight: 800;
}

.rl-search-dish-price-row {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-top: auto;
	padding-top: 8px;
}

.rl-search-dish-price {
	font-size: 18px;
	font-weight: 800;
	color: #059669;
}

.rl-search-dish-price-old {
	font-size: 13px;
	font-weight: 700;
	color: #ef4444;
	text-decoration: line-through;
}

.rl-search-dish-thumb {
	position: relative;
	width: 108px;
	height: 108px;
	border-radius: 20px;
	border: 1px solid #e5e7eb;
	overflow: hidden;
	flex-shrink: 0;
	background: #f3f4f6;
}

.rl-search-dish-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rl-search-diet-dot {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	width: 14px;
	height: 14px;
	border-radius: 4px;
	border: 2px solid transparent;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.rl-search-diet-dot::after {
	content: "";
	position: absolute;
	inset: 3px;
	border-radius: 50%;
	background: currentColor;
}

.rl-search-diet-dot.is-veg {
	color: #16a34a;
	border-color: #bbf7d0;
}

.rl-search-diet-dot.is-nonveg {
	color: #dc2626;
	border-color: #fecaca;
}

.rl-search-diet-dot.is-neutral {
	display: none;
}

.rl-search-dish-add {
	align-self: center;
	flex-shrink: 0;
	min-width: 64px;
	height: 36px;
	padding: 0 14px;
	border-radius: 10px;
	border: 2px solid var(--rls-brand);
	background: var(--rls-brand);
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	font-family: inherit;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	letter-spacing: 0.3px;
	transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.rl-search-dish-add:hover:not(:disabled) {
	background: #ef6046;
}

.rl-search-dish-add.is-loading,
.rl-search-dish-add:disabled,
.rl-search-dish-add.is-disabled {
	opacity: 0.72;
	cursor: not-allowed;
	background: #e2e8f0;
	border-color: #cbd5e1;
	color: #64748b;
}

.rl-search-empty-hint {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--rls-text-faint);
}

.rl-search-dishes {
	padding-top: 8px;
	padding-bottom: 8px;
}

.rl-search-loading,
.rl-search-empty-state,
.rl-search-error {
	padding: 40px var(--rls-pad);
	text-align: center;
	color: var(--rls-text-muted);
}

.rl-search-empty-state p,
.rl-search-error p {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}

.rl-search-spinner {
	width: 34px;
	height: 34px;
	margin: 0 auto;
	border: 2px solid #e2e8f0;
	border-top-color: var(--rls-brand);
	border-radius: 50%;
	animation: rls-spin 0.9s linear infinite;
}

.rl-search-load-more {
	display: block;
	width: calc(100% - 32px);
	margin: 8px auto 0;
	padding: 12px;
	border: 0;
	border-radius: 12px;
	background: var(--rls-brand);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
}

@keyframes rls-spin {
	to {
		transform: rotate(360deg);
	}
}

.is-hidden {
	display: none !important;
}

.rl-search-loading p {
	margin: 10px 0 0;
	font-size: 13px;
	font-weight: 600;
}

@media (min-width: 768px) {
	.rl-search-page {
		--rls-pad: 20px;
		max-width: 720px;
		margin-left: auto;
		margin-right: auto;
		width: 100%;
		border-left: 1px solid var(--rls-border-light);
		border-right: 1px solid var(--rls-border-light);
		box-shadow: 0 0 40px rgba(15, 23, 42, 0.06);
	}

	.rl-search-page .rl-search-restaurants,
	.rl-search-page .rl-search-dishes,
	.rl-search-page .rl-search-featured {
		max-width: 680px;
		margin-left: auto;
		margin-right: auto;
	}

	.rl-search-filters {
		top: 176px;
	}
}
