/*
 * Glass dock: the accessibility, cookie and compare buttons in one glass style; the chat and the buy bar keep their look and stop overlapping.
 * Only skin and position – every button stays the real one from its plugin, so what it opens is unchanged.
 * Loaded only when Настройки → Продукт → „Стъклен стил“ is on; html.ist-dock is set by dock.js.
 */
html.ist-dock body {
	--dk-s: 24px;                                         /* distance from the screen edge */
	--dk-b: calc(24px + env(safe-area-inset-bottom, 0px)); /* bottom of the row */
	--dk-i: 46px;                                         /* one icon button */
	--dk-p: 4px;                                          /* capsule padding */
	--dk-c: 62px;                                         /* chat button (measured by dock.js) */
	--dk-bar: 82px;                                       /* height of the buy bar (measured by dock.js) */
	--dk-lift: 0px;                                       /* phones: the row moves above the buy bar */
	--dk-na: 0; --dk-nc: 0;
	--dk-cap: calc(var(--dk-i) + 2 * var(--dk-p));
	--dk-row: calc(var(--dk-b) + var(--dk-lift));
	--dk-glass: rgba(255, 255, 255, .92);
	--dk-edge: rgba(255, 255, 255, .85);
	--dk-shadow: 0 10px 34px rgba(20, 20, 40, .16), 0 0 0 1px rgba(0, 0, 0, .05), inset 0 1px 0 rgba(255, 255, 255, .9);
	--dk-blur: none;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	html.ist-dock body { --dk-glass: rgba(255, 255, 255, .66); --dk-blur: blur(22px) saturate(190%); }
}
@media (prefers-reduced-transparency: reduce) {
	html.ist-dock body { --dk-glass: #fff; --dk-blur: none; }
}
html.ist-dock.ist-dk-a body { --dk-na: 1; }
html.ist-dock.ist-dk-c body { --dk-nc: 1; }
@media (max-width: 820px) {
	html.ist-dock body.has-tabbar { --dk-b: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
	html.ist-dock body { --dk-s: 10px; --dk-b: calc(10px + env(safe-area-inset-bottom, 0px)); --dk-i: 44px; --dk-p: 3px; }
	html.ist-dock.ist-buy-on body { --dk-lift: calc(var(--dk-bar) + 8px); }
}

/* The capsule behind accessibility + cookies (decoration only; the buttons on top are the real ones). */
.ist-dock-cap { display: none; }
html.ist-dock.ist-dk-a .ist-dock-cap, html.ist-dock.ist-dk-c .ist-dock-cap {
	display: block; position: fixed; z-index: 9989; pointer-events: none;
	left: var(--dk-s); bottom: calc(var(--dk-row) + (var(--dk-barc, var(--dk-cap)) - var(--dk-cap)) / 2);
	width: calc(2 * var(--dk-p) + (var(--dk-na) + var(--dk-nc)) * var(--dk-i)); height: var(--dk-cap);
	border-radius: 999px; background: var(--dk-glass); border: 1px solid var(--dk-edge); box-shadow: var(--dk-shadow);
	-webkit-backdrop-filter: var(--dk-blur); backdrop-filter: var(--dk-blur);
	transition: bottom .3s var(--ist-ease, ease), width .2s;
}
html.ist-dock.ist-dk-a.ist-dk-c .ist-dock-cap::after {
	content: ""; position: absolute; left: calc(var(--dk-p) + var(--dk-i) - 1px); top: 30%; height: 40%; width: 1px; background: rgba(0, 0, 0, .14);
}
/* On wide screens the row sits on the same line as the buy bar, centred on it. */
@media (min-width: 641px) {
	html.ist-dock body { --dk-barc: var(--dk-bar); }
}

/* Accessibility and cookie buttons: transparent, on the capsule. */
html.ist-dock .iacc__fab, html.ist-dock #wad-cc-reopen {
	position: fixed !important; right: auto !important; top: auto !important;
	bottom: calc(var(--dk-row) + (var(--dk-barc, var(--dk-cap)) - var(--dk-cap)) / 2 + var(--dk-p)) !important;
	width: var(--dk-i) !important; height: var(--dk-i) !important; min-width: 0 !important;
	border: 0 !important; border-radius: 50% !important; background: transparent !important; box-shadow: none !important;
	color: var(--ist-text, #18181a) !important; transform: none !important;
	transition: bottom .3s var(--ist-ease, ease), background .15s !important;
}
html.ist-dock .iacc__fab { left: calc(var(--dk-s) + var(--dk-p)) !important; z-index: 9991; }
html.ist-dock #wad-cc-reopen { left: calc(var(--dk-s) + var(--dk-p) + var(--dk-na) * var(--dk-i)) !important; z-index: 9991; }
html.ist-dock .iacc__fab:hover, html.ist-dock #wad-cc-reopen:hover { background: rgba(0, 0, 0, .07) !important; }
html.ist-dock .iacc__fab svg { width: 22px !important; height: 22px !important; }
html.ist-dock #wad-cc-reopen svg { width: 22px !important; height: 22px !important; fill: currentColor !important; }
html.ist-dock #wad-cc-reopen:focus-visible { outline: 2px solid var(--ist-primary, #0a66d8); outline-offset: 2px; }

/* „Сравни (N)“: its own glass capsule next to the first one. */
html.ist-dock .iste-cmpbar {
	left: calc(var(--dk-s) + 2 * var(--dk-p) + (var(--dk-na) + var(--dk-nc)) * var(--dk-i) + 8px * min(1, var(--dk-na) + var(--dk-nc))) !important;
	bottom: calc(var(--dk-row) + (var(--dk-barc, var(--dk-cap)) - var(--dk-cap)) / 2) !important;
	height: var(--dk-cap); padding: 0 18px !important; z-index: 9989;
	background: var(--dk-glass) !important; border: 1px solid var(--dk-edge); box-shadow: var(--dk-shadow) !important;
	-webkit-backdrop-filter: var(--dk-blur); backdrop-filter: var(--dk-blur);
	color: var(--ist-text, #18181a) !important; font-weight: 500; font-size: .9375rem;
	transition: bottom .3s var(--ist-ease, ease);
}
html.ist-dock .iste-cmpbar:hover { color: var(--ist-primary, #0a66d8) !important; }

/* Chat keeps its own look. dock.js only moves it beside the buy bar (the widget writes its place inline). */
html.ist-dock #fpa-root .fpa-btn { transition: inset .3s var(--ist-ease, ease), transform .2s, box-shadow .2s !important; }

/* The buy bar keeps its own dark look; it only makes room for the chat button. */
@media (min-width: 641px) {
	/* Room for the chat button on its right: the two no longer overlap. */
	html.ist-dock.ist-dk-chat .ist-sticky-buy { right: calc(var(--dk-s) + var(--dk-c) + 10px); width: min(460px, calc(100% - 2 * var(--dk-s) - var(--dk-c) - 10px)); }
}
@media (max-width: 640px) {
	/* Flush above the tab bar instead of floating over a strip of the page. */
	html.ist-dock body.has-tabbar .ist-sticky-buy { bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* Under a modal, a sheet or the open menu the dock steps back, like the buy bar already does. */
body.ist-lock .ist-dock-cap, body.ist-sheet-open .ist-dock-cap, html.ist-sc-lock .ist-dock-cap,
body.ist-lock .iste-cmpbar, body.ist-sheet-open .iste-cmpbar, html.ist-sc-lock .iste-cmpbar { z-index: 80 !important; }
body.ist-lock .iacc__fab, body.ist-sheet-open .iacc__fab, html.ist-sc-lock .iacc__fab,
body.ist-lock #wad-cc-reopen, body.ist-sheet-open #wad-cc-reopen, html.ist-sc-lock #wad-cc-reopen { z-index: 81 !important; }
@media (prefers-reduced-motion: reduce) {
	html.ist-dock .ist-dock-cap, html.ist-dock .iacc__fab, html.ist-dock #wad-cc-reopen, html.ist-dock .iste-cmpbar, html.ist-dock #fpa-root .fpa-btn { transition: none !important; }
}
@media print { .ist-dock-cap { display: none !important; } }
