/* ============================================================
   Shopino Mobile Dock — شیشه‌ای / لیکویید
   ============================================================ */
.sdock, .sdock-sheet {
	--a: var(--sdock-accent, var(--sh-primary, #d3202b));
	--a-soft: color-mix(in srgb, var(--a) 14%, transparent);
	--a-ink: var(--a);
	font-family: inherit;
	-webkit-text-size-adjust: 100%;
}
/* ---- توکن‌های رنگی ---- */
.sdock--light {
	--glass: rgba(255, 255, 255, .56); --glass-strong: rgba(255, 255, 255, .8); --glass-brd: rgba(255, 255, 255, .8);
	--ink: #17181c; --muted: rgba(23, 24, 28, .66); --tile: rgba(255, 255, 255, .6); --tile-brd: rgba(23, 24, 28, .08);
	--sheen: rgba(255, 255, 255, .65); --solid: #fff; --shadow: rgba(20, 20, 30, .38);
}
.sdock--dark {
	--glass: rgba(24, 25, 30, .56); --glass-strong: rgba(24, 25, 30, .82); --glass-brd: rgba(255, 255, 255, .15);
	--ink: #fff; --muted: rgba(255, 255, 255, .72); --tile: rgba(255, 255, 255, .07); --tile-brd: rgba(255, 255, 255, .1);
	--sheen: rgba(255, 255, 255, .18); --solid: #1b1c21; --shadow: rgba(0, 0, 0, .6);
	--a-ink: color-mix(in srgb, var(--a) 58%, #fff);
}
@media (prefers-color-scheme: dark) {
	.sdock--auto {
		--glass: rgba(24, 25, 30, .56); --glass-strong: rgba(24, 25, 30, .82); --glass-brd: rgba(255, 255, 255, .15);
		--ink: #fff; --muted: rgba(255, 255, 255, .72); --tile: rgba(255, 255, 255, .07); --tile-brd: rgba(255, 255, 255, .1);
		--sheen: rgba(255, 255, 255, .18); --solid: #1b1c21; --shadow: rgba(0, 0, 0, .6);
		--a-ink: color-mix(in srgb, var(--a) 58%, #fff);
	}
}
@media (prefers-color-scheme: light) {
	.sdock--auto {
		--glass: rgba(255, 255, 255, .56); --glass-strong: rgba(255, 255, 255, .8); --glass-brd: rgba(255, 255, 255, .8);
		--ink: #17181c; --muted: rgba(23, 24, 28, .66); --tile: rgba(255, 255, 255, .6); --tile-brd: rgba(23, 24, 28, .08);
		--sheen: rgba(255, 255, 255, .65); --solid: #fff; --shadow: rgba(20, 20, 30, .38);
	}
}

/* ---- نوار ---- */
.sdock {
	position: fixed; inset-inline: 0; bottom: 0; z-index: 9996;
	padding: 0 14px calc(12px + env(safe-area-inset-bottom, 0px));
	pointer-events: none;
	transition: transform .5s cubic-bezier(.2, .85, .25, 1), opacity .3s ease;
}
.sdock.is-hidden { transform: translateY(calc(100% + 24px)); }
.sdock__bar {
	position: relative; pointer-events: auto; display: flex; max-width: 480px; margin-inline: auto; padding: 6px;
	border-radius: 28px; isolation: isolate;
	background: var(--glass);
	-webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%);
	border: 1px solid var(--glass-brd);
	box-shadow: 0 18px 40px -14px var(--shadow), 0 2px 6px rgba(0, 0, 0, .06), inset 0 1px 0 var(--sheen), inset 0 -1px 0 rgba(0, 0, 0, .05);
}
/* بازتاب نور روی شیشه */
.sdock__bar::before {
	content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
	background: linear-gradient(180deg, var(--sheen), transparent 48%);
	opacity: .7;
}

/* ---- حباب لیکویید (نشانگر فعال) ---- */
.sdock__blob {
	position: absolute; top: 6px; bottom: 6px; left: 0; width: 0; opacity: 0; pointer-events: none; z-index: 0;
	transition: transform .6s cubic-bezier(.34, 1.5, .5, 1), width .5s cubic-bezier(.34, 1.4, .5, 1), opacity .25s ease;
}
.sdock__blob i {
	display: block; height: 100%; border-radius: 22px; transform-origin: center;
	background: linear-gradient(165deg, color-mix(in srgb, var(--a) 30%, transparent), color-mix(in srgb, var(--a) 12%, transparent));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 0 0 1px color-mix(in srgb, var(--a) 22%, transparent), 0 8px 18px -8px color-mix(in srgb, var(--a) 60%, transparent);
}
.sdock__blob i.is-squish { animation: sdock-squish .6s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes sdock-squish {
	0% { transform: scale(1, 1); }
	35% { transform: scale(1.22, .9); }
	70% { transform: scale(.97, 1.04); }
	100% { transform: scale(1, 1); }
}

/* ---- دکمه‌ها ---- */
.sdock__item {
	position: relative; z-index: 1; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
	margin: 0; padding: 8px 2px 7px; border: 0; border-radius: 22px; background: none; box-shadow: none;
	color: var(--muted); font: inherit; font-size: .68rem; font-weight: 600; line-height: 1.5; text-decoration: none; text-transform: none;
	cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color .25s ease;
}
.sdock__item:hover { color: var(--muted); background: none; }
.sdock__item.is-active { color: var(--a-ink); }
.sdock__item:focus-visible { outline: 2px solid var(--a); outline-offset: -2px; }
.sdock__icon { position: relative; display: grid; place-items: center; transition: transform .35s cubic-bezier(.34, 1.6, .5, 1); }
.sdock__item.is-active .sdock__icon { transform: translateY(-1px) scale(1.1); }
.sdock__item:active .sdock__icon { transform: scale(.86); }
.sdock__ico { display: block; width: 24px; height: 24px; }
.sdock__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sdock__badge {
	position: absolute; top: -7px; inset-inline-end: -10px; min-width: 17px; height: 17px; padding: 0 4px;
	display: grid; place-items: center; border-radius: 9px; background: var(--a); color: #fff;
	font-size: 10px; font-weight: 700; line-height: 1; font-style: normal;
	box-shadow: 0 0 0 2px var(--solid);
}
.sdock__badge.is-empty { display: none; }
.sdock__badge.is-bump { animation: sdock-bump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes sdock-bump { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }

/* هنگام تایپ در جستجو، نوار کنار می‌رود */
html.sdock-typing .sdock { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }
html.sdock-lock, html.sdock-lock body { overflow: hidden; }

/* ---- پنل‌های کشویی ---- */
.sdock-sheet { position: fixed; inset: 0; z-index: 9995; display: flex; align-items: flex-end; justify-content: center; }
.sdock-sheet[hidden] { display: none; }
.sdock-sheet__backdrop {
	position: absolute; inset: 0; opacity: 0; transition: opacity .4s ease;
	background: rgba(12, 12, 16, .4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.sdock-sheet__panel {
	position: relative; display: flex; flex-direction: column; width: 100%; max-width: 560px;
	max-height: 84vh; max-height: 84dvh;
	background: var(--glass-strong); color: var(--ink);
	-webkit-backdrop-filter: blur(34px) saturate(190%); backdrop-filter: blur(34px) saturate(190%);
	border: 1px solid var(--glass-brd); border-bottom: 0; border-radius: 30px 30px 0 0;
	box-shadow: 0 -24px 60px -24px var(--shadow), inset 0 1px 0 var(--sheen);
	transform: translateY(105%); transition: transform .55s cubic-bezier(.2, .9, .25, 1);
	will-change: transform;
}
.sdock-sheet.is-open .sdock-sheet__backdrop { opacity: 1; }
.sdock-sheet.is-open .sdock-sheet__panel { transform: none; }
html.sdock-typing .sdock-sheet__body { padding-bottom: 20px; }

.sdock-sheet__grab { display: grid; place-items: center; padding: 10px 0 6px; touch-action: none; cursor: grab; flex: none; }
.sdock-sheet__grab span { width: 40px; height: 5px; border-radius: 3px; background: var(--muted); opacity: .4; }
.sdock-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 2px 18px 10px; flex: none; }
.sdock-sheet__head strong { color: var(--ink); font-size: 1.05rem; font-weight: 800; }
.sdock-sheet__x {
	display: grid; place-items: center; flex: none; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 50%;
	background: var(--tile); color: var(--ink); box-shadow: inset 0 0 0 1px var(--tile-brd); cursor: pointer;
}
.sdock-sheet__x:hover { background: var(--tile); color: var(--ink); }
.sdock-sheet__x .sdock__ico { width: 18px; height: 18px; }
.sdock-sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 16px calc(104px + env(safe-area-inset-bottom, 0px)); }
.sdock-empty, .sdock-note { margin: 18px 0; color: var(--muted); text-align: center; font-size: .9rem; }

/* ---- دسته‌بندی‌ها ---- */
.sdock-cats { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sdock-cat { overflow: hidden; border-radius: 22px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--tile-brd); }
.sdock-cat__main { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 12px; color: var(--ink); text-decoration: none; }
.sdock-cat__main:active { background: var(--a-soft); }
.sdock-cat__img {
	display: grid; place-items: center; flex: none; width: 52px; height: 52px; overflow: hidden; border-radius: 16px;
	background: var(--a-soft); color: var(--a-ink);
}
.sdock-cat__img img { width: 100%; height: 100%; object-fit: cover; }
.sdock-cat__img b { font-size: 1.3rem; font-weight: 800; }
.sdock-cat__txt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.sdock-cat__txt strong { font-size: .98rem; font-weight: 700; }
.sdock-cat__txt small { color: var(--muted); font-size: .76rem; }
.sdock-cat__main .sdock__ico { width: 18px; height: 18px; margin-inline-start: auto; opacity: .5; }
html[dir="rtl"] .sdock-cat__main .sdock__ico { transform: scaleX(-1); }
.sdock-cat__kids, .sdock-quick div { display: flex; flex-wrap: wrap; gap: 6px; }
.sdock-cat__kids { padding: 0 12px 12px; }
.sdock-cat__kids a, .sdock-quick a {
	padding: 5px 12px; border-radius: 999px; background: var(--a-soft); color: var(--ink);
	font-size: .78rem; font-weight: 600; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.sdock-cat__kids a:active, .sdock-quick a:active { background: var(--a); color: #fff; }

/* ---- جستجو ---- */
.sdock-search {
	display: flex; align-items: center; gap: 10px; flex: none; margin: 2px 16px 12px; padding: 6px 14px 6px 6px;
	border-radius: 20px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--tile-brd); color: var(--muted);
	transition: box-shadow .2s ease;
}
.sdock-search:focus-within { box-shadow: inset 0 0 0 1.5px var(--a), 0 0 0 4px var(--a-soft); }
.sdock-search > .sdock__ico { margin-inline-start: 10px; flex: none; }
.sdock-search input.sdock-search__input,
.sdock-search input.sdock-search__input:focus,
.sdock-search input.sdock-search__input:hover {
	flex: 1 1 auto; min-width: 0; margin: 0; padding: 10px 0; border: 0; outline: 0; box-shadow: none; background: transparent;
	height: auto; border-radius: 0; color: var(--ink); font: inherit; font-size: 16px; /* ۱۶px: جلوگیری از زوم خودکار iOS */ -webkit-appearance: none; appearance: none;
}
.sdock-search__input::placeholder { color: var(--muted); }
.sdock-search__input::-webkit-search-cancel-button { display: none; }

.sdock-results { display: grid; gap: 6px; }
.sdock-res { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 18px; color: var(--ink); text-decoration: none; }
.sdock-res:active { background: var(--a-soft); }
.sdock-res__img { flex: none; width: 56px; height: 56px; overflow: hidden; border-radius: 14px; background: var(--tile); }
.sdock-res__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sdock-res__txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sdock-res__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .92rem; font-weight: 600; line-height: 1.6; }
.sdock-res__price { color: var(--a-ink); font-size: .85rem; font-weight: 700; }
.sdock-res__price del { opacity: .55; font-size: .85em; font-weight: 400; margin-inline-end: 6px; }
.sdock-res__price ins { text-decoration: none; }
.sdock-res__price .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sdock-sheet a.sdock-all,
.sdock-sheet a.sdock-all:hover,
.sdock-sheet a.sdock-all:visited {
	color: #fff;
}
.sdock-all {
	display: block; margin-top: 6px; padding: 12px; border-radius: 16px; background: var(--a); color: #fff;
	font-weight: 700; font-size: .9rem; text-align: center; text-decoration: none;
}
.sdock-quick { margin-top: 10px; }
.sdock-quick[hidden] { display: none; }
.sdock-quick > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: .8rem; font-weight: 600; }

/* ---- بدون پشتیبانی blur ---- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.sdock__bar, .sdock-sheet__panel { background: var(--solid); }
	.sdock-sheet__backdrop { background: rgba(12, 12, 16, .55); }
}
@media (prefers-reduced-motion: reduce) {
	.sdock, .sdock__blob, .sdock__icon, .sdock-sheet__panel, .sdock-sheet__backdrop { transition-duration: .01ms !important; }
	.sdock__blob i.is-squish, .sdock__badge.is-bump { animation: none; }
}

/* قفل رنگ لینک‌ها در برابر قالب */
.sdock-sheet a, .sdock-sheet a:visited { color: inherit; }
.sdock-sheet .sdock-cat__kids a:active, .sdock-sheet .sdock-quick a:active { color: #fff; }
.sdock a.sdock__item, .sdock a.sdock__item:visited { color: var(--muted); }
.sdock a.sdock__item.is-active, .sdock .sdock__item.is-active { color: var(--a-ink); }
