/* Nersi Store — Mobile bottom navigation */

:root {
	--ns-bottom-nav-height: 72px;
}

@media (min-width: 992px) {
	.ns-bottom-nav,
	.ns-mobile-search {
		display: none !important;
	}
}

@media (max-width: 991px) {
	body.has-mobile-bottom-nav {
		padding-bottom: calc(var(--ns-bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
	}

	.ns-bottom-nav {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 480;
		padding: 0 12px calc(10px + env(safe-area-inset-bottom, 0px));
		pointer-events: none;
	}

	.ns-bottom-nav__inner {
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		align-items: end;
		gap: 2px;
		max-width: 520px;
		margin-inline: auto;
		padding: 8px 6px 6px;
		border-radius: 22px;
		background: var(--af-white, #fff);
		border: 1px solid var(--af-border, #e7e5e4);
		box-shadow:
			0 10px 40px rgba(26, 26, 26, 0.1),
			0 2px 8px rgba(26, 26, 26, 0.05);
		pointer-events: auto;
	}

	.ns-bottom-nav__item {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: flex-end;
		gap: 4px;
		min-width: 0;
		padding: 4px 2px 2px;
		border: 0;
		background: transparent;
		color: #94a3b8;
		text-decoration: none;
		font: inherit;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	.ns-bottom-nav__icon {
		position: relative;
		display: grid;
		place-items: center;
		width: 40px;
		height: 32px;
		border-radius: 12px;
		transition: background-color 0.2s ease, color 0.2s ease;
	}

	.ns-bottom-nav__icon svg {
		width: 22px;
		height: 22px;
	}

	.ns-bottom-nav__label {
		max-width: 100%;
		font-size: 0.62rem;
		font-weight: 700;
		line-height: 1.2;
		text-align: center;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.ns-bottom-nav__item.is-active {
		color: var(--ns-brand-dark, #d49a00);
	}

	.ns-bottom-nav__item.is-active .ns-bottom-nav__icon {
		background: var(--ns-brand-soft, rgba(245, 184, 0, 0.14));
		color: var(--ns-black, #1a1a1a);
	}

	.ns-bottom-nav__item--chat {
		position: relative;
		padding-top: 0;
	}

	.ns-bottom-nav__chat-btn {
		display: grid;
		place-items: center;
		width: 52px;
		height: 52px;
		margin-top: -22px;
		border-radius: 50%;
		background: var(--af-gradient-brand, linear-gradient(135deg, #ffc107 0%, #f5b800 48%, #fbc02d 100%));
		color: var(--ns-black, #1a1a1a);
		box-shadow:
			0 8px 24px var(--ns-brand-glow, rgba(245, 184, 0, 0.28)),
			0 2px 8px rgba(245, 184, 0, 0.2);
		transition: transform 0.2s ease, box-shadow 0.2s ease;
	}

	.ns-bottom-nav__chat-btn svg {
		width: 24px;
		height: 24px;
	}

	.ns-bottom-nav__item--chat:hover .ns-bottom-nav__chat-btn,
	.ns-bottom-nav__item--chat:focus-visible .ns-bottom-nav__chat-btn {
		transform: translateY(-2px);
		box-shadow:
			0 12px 28px rgba(245, 184, 0, 0.38),
			0 4px 12px rgba(245, 184, 0, 0.22);
	}

	.ns-bottom-nav__item--chat .ns-bottom-nav__label {
		margin-top: 2px;
	}

	.ns-bottom-nav__badge {
		position: absolute;
		top: -2px;
		inset-inline-end: 2px;
		min-width: 16px;
		height: 16px;
		padding: 0 4px;
		border-radius: 999px;
		background: var(--ns-black, #1a1a1a);
		color: var(--ns-brand, #f5b800);
		font-size: 0.58rem;
		font-weight: 800;
		line-height: 16px;
		text-align: center;
		box-shadow: 0 2px 6px rgba(26, 26, 26, 0.25);
	}

	/* Full-screen mobile search — slides up from bottom */

	.ns-mobile-search {
		position: fixed;
		inset: 0;
		z-index: 510;
		visibility: hidden;
		pointer-events: none;
	}

	.ns-mobile-search[hidden] {
		display: block;
		visibility: hidden;
	}

	.ns-mobile-search__backdrop {
		position: absolute;
		inset: 0;
		border: 0;
		background: rgba(26, 26, 26, 0.55);
		opacity: 0;
		transition: opacity 0.32s ease;
		cursor: pointer;
	}

	.ns-mobile-search.is-open {
		visibility: visible;
		pointer-events: auto;
	}

	.ns-mobile-search.is-open .ns-mobile-search__backdrop {
		opacity: 1;
	}

	.ns-mobile-search__panel {
		position: absolute;
		inset: 0;
		display: flex;
		flex-direction: column;
		background: var(--af-gradient-page, linear-gradient(180deg, #fafaf9 0%, #f5f5f4 100%));
		background-color: var(--af-bg, #f5f5f4);
		transform: translateY(100%);
		transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
		will-change: transform;
	}

	.ns-mobile-search.is-open .ns-mobile-search__panel {
		transform: translateY(0);
	}

	.ns-mobile-search__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		flex-shrink: 0;
		padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
		background: var(--af-white, #fff);
		border-bottom: 1px solid var(--af-border, #e7e5e4);
		box-shadow: 0 4px 20px rgba(26, 26, 26, 0.05);
	}

	.ns-mobile-search__title {
		font-size: 1rem;
		font-weight: 900;
		color: var(--ns-black, #1a1a1a);
	}

	.ns-mobile-search__close {
		display: grid;
		place-items: center;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 1.5px solid rgba(245, 184, 0, 0.35);
		border-radius: 12px;
		background: var(--af-white, #fff);
		color: var(--ns-black, #1a1a1a);
		cursor: pointer;
		box-shadow: 0 4px 14px rgba(26, 26, 26, 0.05);
		transition: border-color 0.2s ease, box-shadow 0.2s ease;
	}

	.ns-mobile-search__close:hover {
		border-color: rgba(245, 184, 0, 0.55);
		box-shadow: 0 8px 20px rgba(245, 184, 0, 0.14);
	}

	.ns-mobile-search__close svg {
		width: 18px;
		height: 18px;
		fill: currentColor;
	}

	.ns-mobile-search__body {
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		padding: 28px 20px 32px;
		overflow-y: auto;
	}

	.ns-mobile-search__hint {
		margin: 0 0 20px;
		font-size: 0.88rem;
		font-weight: 600;
		color: var(--af-muted, #5c5c5c);
		text-align: center;
	}

	.ns-mobile-search__form-wrap {
		display: flex;
		flex-direction: column;
		gap: 14px;
	}

	.ns-mobile-search__body .shop-header__search {
		max-width: none;
		margin: 0;
		padding: 6px 18px;
		border-width: 2px;
		border-color: rgba(245, 184, 0, 0.35);
		border-radius: 18px;
		box-shadow:
			0 8px 28px rgba(245, 184, 0, 0.1),
			0 2px 8px rgba(26, 26, 26, 0.04);
	}

	.ns-mobile-search__body .shop-header__search:focus-within {
		border-color: rgba(245, 184, 0, 0.6);
		box-shadow:
			0 0 0 4px rgba(245, 184, 0, 0.12),
			0 12px 32px rgba(245, 184, 0, 0.16);
	}

	.ns-mobile-search__body .shop-header__search-input {
		font-size: 1rem;
		padding: 14px 4px;
	}

	.ns-mobile-search__submit {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		width: 100%;
		min-height: 52px;
		padding: 14px 20px;
		border: 0;
		border-radius: 16px;
		background: var(--af-gradient-brand, linear-gradient(135deg, #ffc107 0%, #f5b800 48%, #fbc02d 100%));
		color: var(--ns-black, #1a1a1a);
		font: inherit;
		font-size: 0.95rem;
		font-weight: 800;
		cursor: pointer;
		box-shadow:
			0 8px 24px var(--ns-brand-glow, rgba(245, 184, 0, 0.28)),
			0 2px 8px rgba(245, 184, 0, 0.2);
		opacity: 0;
		transform: translateY(8px);
		transition:
			opacity 0.25s ease,
			transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
			box-shadow 0.2s ease;
	}

	.ns-mobile-search__submit:not([hidden]) {
		opacity: 1;
		transform: translateY(0);
	}

	.ns-mobile-search__submit svg {
		width: 20px;
		height: 20px;
		fill: currentColor;
		flex-shrink: 0;
	}

	.ns-mobile-search__submit:active {
		transform: translateY(1px);
		box-shadow:
			0 4px 16px rgba(245, 184, 0, 0.22),
			0 1px 4px rgba(245, 184, 0, 0.16);
	}

	body.ns-mobile-search-open {
		overflow: hidden;
	}

	body.ns-mobile-search-open .ns-bottom-nav {
		z-index: 400;
	}
}
