/*
 * Arnav Infosystem - Shop page (Phase 5B). Loaded on the main Shop only.
 *
 * Product cards, container tokens and the Elementor adapter come from home.css /
 * home-elementor.css (the Shop <main> carries .ai-home). This file adds the
 * title band, filter sidebar / bottom sheet, toolbar, sort menu, pagination and
 * empty state. Values are the ones measured on production /shop (Phase 5A/5B).
 */

/* ---------- Container ---------- */

.ai-home .ai-shop-wrap,
.ai-home .ai-shop__wrap {
	width: 100%;
	max-width: var(--ai-container);
	margin-inline: auto;
	padding-inline: var(--ai-space-x);
}

/* ---------- Title band (Elementor page #6, or the plain fallback) ---------- */

.ai-home .ai-shop-band {
	padding-top: 16px;
}

.ai-home .ai-shop-title,
.ai-home .ai-shop-title .elementor-heading-title {
	color: var(--ai-text);
	font-family: var(--ai-font-heading);
	font-size: var(--ai-t-xl);
	font-weight: 700;
	line-height: 1.4;
}

@media (min-width: 640px) {
	.ai-home .ai-shop-title,
	.ai-home .ai-shop-title .elementor-heading-title {
		font-size: var(--ai-t-2xl);
		line-height: 1.3333;
	}
}

.ai-home .ai-shop-crumb {
	margin-top: 8px;
	color: var(--ai-muted);
	line-height: 0;
}

.ai-home .ai-shop-crumb.elementor-widget { margin-top: 8px; }

.ai-home .ai-shop-crumb a {
	display: inline-flex;
	color: var(--ai-muted);
}

.ai-home .ai-shop-crumb a:hover { color: var(--ai-primary); }

.ai-home .ai-shop-intro:empty,
.ai-home .ai-shop-intro .elementor-widget-container:empty { display: none; }

/* ---------- Layout ---------- */

.ai-home .ai-shop__wrap { padding-block: 24px; }

.ai-home .ai-shop__layout {
	display: flex;
	align-items: flex-start;
	gap: 24px;
}

.ai-home .ai-shop__content {
	flex: 1;
	min-width: 0;
}

/* Product grid: 2 columns, 3 once the sidebar is beside it (production). */
.ai-home.ai-shop .ai-grid--products {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 1024px) {
	.ai-home.ai-shop .ai-grid--products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Filter sidebar (desktop) / bottom sheet (< 1024px) ---------- */

.ai-home .ai-shop__filters {
	flex: none;
	width: 256px;
}

.ai-home .ai-shop__sheet-head,
.ai-home .ai-shop__backdrop { display: none; }

.ai-home .ai-fbox {
	padding: 16px;
	border: 1px solid var(--ai-border);
	border-radius: 14px;
	background: #fff;
}

.ai-home .ai-fg {
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--ai-border);
}

.ai-home .ai-fg--last {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

.ai-home .ai-fg__title {
	margin-bottom: 8px;
	color: var(--ai-text);
	font-family: var(--ai-font-heading);
	font-size: var(--ai-t-sm);
	font-weight: 600;
	line-height: 1.4286;
}

.ai-home .ai-fg__list > * + * { margin-top: 4px; }

.ai-home .ai-fg__row,
.ai-home .ai-fg__rate {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px;
	border-radius: 8px;
	color: var(--ai-text);
	font-size: var(--ai-t-sm);
	line-height: 1.4286;
	cursor: pointer;
}

.ai-home .ai-fg__row:hover,
.ai-home .ai-fg__rate:hover { background: #f1f5f9; }

.ai-home .ai-fg__row input {
	flex: none;
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--ai-primary);
	cursor: pointer;
}

.ai-home .ai-fg__row span { flex: 1; }

.ai-home .ai-fg__rate { padding-block: 6px; }
.ai-home .ai-fg__rate.is-on { background: var(--ai-blue-50); }

.ai-home .ai-fg__stars {
	display: inline-flex;
	gap: 0;
}

.ai-home .ai-fg__stars .ai-icon.is-full { color: #f59e0b; fill: #f59e0b; }
.ai-home .ai-fg__stars .ai-icon.is-empty { color: #cbd5e1; }

.ai-home .ai-fg__price-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ai-home .ai-fg__price-row input {
	flex: 1;
	min-width: 0;
	height: 32px;
	padding: 0 8px;
	border: 1px solid var(--ai-border);
	border-radius: 10px;
	background: #fff;
	color: var(--ai-text);
	font: inherit;
	font-size: var(--ai-t-sm);
	box-shadow: none;
}

.ai-home .ai-fg__price-row input:focus {
	border-color: var(--ai-primary);
	outline: 0;
}

.ai-home .ai-fg__price-row span { color: var(--ai-muted); }

.ai-home .ai-fg__apply {
	width: 100%;
	height: 28px;
	margin-top: 12px;
	padding: 0;
	border: 1px solid var(--ai-border);
	border-radius: 8px;
	background: var(--ai-background);
	color: var(--ai-text);
	font: inherit;
	font-size: 12.8px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
}

.ai-home .ai-fg__apply:hover { background: #f1f5f9; }

/* ---------- Toolbar ---------- */

.ai-home .ai-shop__toolbar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	margin-bottom: 16px;
}

.ai-home .ai-shop__filters-btn {
	display: none;
	align-items: center;
	gap: 6px;
	margin-right: auto;
	padding: 8px 12px;
	border: 1px solid var(--ai-border);
	border-radius: 10px;
	background: transparent;
	color: var(--ai-text);
	font: inherit;
	font-size: var(--ai-t-sm);
	font-weight: 500;
	line-height: 1.4286;
	cursor: pointer;
}

.ai-home .ai-sort { position: relative; }

.ai-home .ai-sort__btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border: 1px solid var(--ai-border);
	border-radius: 10px;
	background: var(--ai-background);
	color: var(--ai-text);
	font-size: var(--ai-t-sm);
	font-weight: 500;
	line-height: 1.4286;
	list-style: none;
	cursor: pointer;
	user-select: none;
}

.ai-home .ai-sort__btn::-webkit-details-marker { display: none; }
.ai-home .ai-sort__lead { color: var(--ai-muted); }

.ai-home .ai-sort__menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 30;
	min-width: 182px;
	padding: 4px;
	border: 1px solid var(--ai-border);
	border-radius: 10px;
	background: #fff;
	box-shadow: var(--ai-shadow-lg);
}

.ai-home .ai-sort__menu a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 12px;
	border-radius: 8px;
	color: var(--ai-text);
	font-size: var(--ai-t-sm);
	line-height: 1.4286;
	white-space: nowrap;
}

.ai-home .ai-sort__menu a:hover { background: #f1f5f9; }
.ai-home .ai-sort__menu a.is-on { color: var(--ai-primary-dark, #0045ad); font-weight: 500; }

/* ---------- Active filters / empty state ---------- */

.ai-home .ai-shop__chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
}

.ai-home .ai-xchip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border: 1px solid var(--ai-border);
	border-radius: 9999px;
	background: #fff;
	color: var(--ai-text);
	font-size: var(--ai-t-xs);
	font-weight: 500;
	line-height: 1.3333;
}

.ai-home .ai-xchip:hover { border-color: rgba(31, 99, 240, 0.5); color: var(--ai-primary); }

.ai-home .ai-shop__clear {
	color: var(--ai-primary);
	font-size: var(--ai-t-xs);
	font-weight: 600;
	line-height: 1.3333;
}

.ai-home .ai-shop__clear:hover { text-decoration: underline; }

.ai-home .ai-shop__count {
	margin-bottom: 17px;
	color: var(--ai-muted);
	font-size: var(--ai-t-sm);
	line-height: 1.4;
}

.ai-home .ai-shop__count span {
	color: var(--ai-text);
	font-weight: 600;
	overflow-wrap: anywhere;
}

.ai-home .ai-shop__empty {
	padding: 64px 16px;
	border: 1px solid var(--ai-border);
	border-radius: 14px;
	background: #fff;
	text-align: center;
}

.ai-home .ai-shop__empty-icon {
	display: block;
	margin: 0 auto 12px;
	color: var(--ai-muted);
}

.ai-home .ai-shop__empty p {
	margin-bottom: 12px;
	color: var(--ai-text);
	font-size: var(--ai-t-sm);
	font-weight: 500;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.ai-home .ai-shop__clear-btn {
	display: inline-flex;
	align-items: center;
	height: 28px;
	padding: 0 10px;
	border: 1px solid var(--ai-border);
	border-radius: 8px;
	background: var(--ai-background);
	color: var(--ai-text);
	font-size: 12.8px;
	font-weight: 500;
	line-height: 1;
}

.ai-home .ai-shop__clear-btn:hover { background: #f1f5f9; }

/* ---------- Pagination ---------- */

.ai-home .ai-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	margin-top: 32px;
}

.ai-home .ai-pager__nums {
	display: flex;
	align-items: center;
	gap: 4px;
}

.ai-home .ai-pager__box,
.ai-home .ai-pager__gap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--ai-border);
	border-radius: 8px;
	color: var(--ai-text);
	font-size: var(--ai-t-sm);
	font-weight: 500;
}

.ai-home .ai-pager__gap { border: 0; font-weight: 400; }
.ai-home a.ai-pager__box:hover { background: #f1f5f9; }

.ai-home .ai-pager__box.is-current {
	border-color: var(--ai-border);
	background: var(--ai-primary);
	color: #fff;
}

.ai-home .ai-pager__box.is-disabled {
	opacity: 0.4;
	pointer-events: none;
}

/* ---------- Below 1024px: Filters button + bottom sheet ---------- */

@media (max-width: 1023px) {
	.ai-home .ai-shop__layout { display: block; }

	.ai-home .ai-shop__filters-btn { display: inline-flex; }

	.ai-home .ai-shop__filters {
		position: fixed;
		inset: auto 0 0 0;
		z-index: 1001;
		display: none;
		flex-direction: column;
		width: auto;
		max-height: 85vh;
		border-radius: 14px 14px 0 0;
		background: #fff;
		box-shadow: var(--ai-shadow-lg);
	}

	.ai-home .ai-shop__filters.is-open { display: flex; }

	.ai-home .ai-shop__sheet-head {
		display: flex;
		flex: none;
		align-items: center;
		justify-content: space-between;
		height: 65px;
		padding: 0 16px;
		border-bottom: 1px solid var(--ai-border);
	}

	.ai-home .ai-shop__sheet-title {
		color: var(--ai-text);
		font-family: var(--ai-font-heading);
		font-size: var(--ai-t-base);
		font-weight: 600;
	}

	.ai-home .ai-shop__sheet-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 32px;
		height: 32px;
		padding: 0;
		border: 0;
		border-radius: 8px;
		background: transparent;
		color: var(--ai-text);
		cursor: pointer;
	}

	.ai-home .ai-shop__sheet-close:hover { background: #f1f5f9; }

	.ai-home .ai-shop__sheet-body {
		flex: 1;
		overflow-y: auto;
		overscroll-behavior: contain;
		padding: 16px;
	}

	.ai-home .ai-fbox {
		padding: 0;
		border: 0;
		border-radius: 0;
	}

	.ai-home .ai-shop__backdrop {
		position: fixed;
		inset: 0;
		z-index: 1000;
		background: rgba(2, 6, 23, 0.5);
	}

	.ai-home .ai-shop__backdrop.is-open { display: block; }
}

/* Scroll lock while the sheet is open (set by shop.js). */
html.ai-shop-lock,
html.ai-shop-lock body { overflow: hidden; }
