/* MiBrain 26.10.2026: значок «Сравнение» в шапке и панель сравнения справа (js/mb-compare.js) */

.mb-icon--compare { position: relative; cursor: pointer; }
.mb-icon--compare svg { width: 22px; height: 22px; color: var(--mb-dark); }
.mb-icon--compare:hover svg { opacity: .75; }
.mb-compare-count { position: absolute; top: -9px; left: calc(50% + 3px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--mb-green); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-sizing: border-box; }
.mb-compare-count[hidden] { display: none; }
.mb-pulse { animation: mb-pulse .5s ease; }
@keyframes mb-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* кнопка на телефоне: шапка там своя, поэтому сравнение внизу справа, над нижним меню */
.mb-compare-fab { display: none; }
@media (max-width: 767px) {
	.mb-compare-fab { position: fixed; right: 12px; bottom: 84px; z-index: 900; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: var(--mb-dark); color: #fff; font: 600 14px/1 inherit; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
	.mb-compare-fab[hidden] { display: none; }
	.mb-compare-fab .mb-compare-count { position: static; background: var(--mb-green); }
}

/* панель */
html.mbc-open, html.mbc-open body { overflow: hidden; }
.mbc-wrap { position: fixed; inset: 0; z-index: 10050; visibility: hidden; } /* выше нижнего меню на телефоне */
.mbc button, .mb-compare-fab { text-transform: none !important; letter-spacing: 0 !important; }
.mbc-wrap.is-open { visibility: visible; }
.mbc-overlay { position: absolute; inset: 0; background: rgba(17,17,17,.45); opacity: 0; transition: opacity .25s ease; }
.mbc-wrap.is-open .mbc-overlay { opacity: 1; }
.mbc { position: absolute; top: 0; right: 0; bottom: 0; width: min(1040px, 100vw); display: flex; flex-direction: column; background: #fff; box-shadow: -12px 0 32px rgba(0,0,0,.12); transform: translateX(100%); transition: transform .3s ease; }
.mbc-wrap.is-open .mbc { transform: none; }
.mbc__loading { padding: 32px; color: var(--mb-muted); font-size: 15px; }

.mbc__head { flex: 0 0 auto; display: flex; align-items: center; gap: 20px; padding: 20px 24px 18px 28px; border-bottom: 1px solid var(--mb-line); }
.mbc__title { margin-right: auto; font-size: 22px; font-weight: 700; color: var(--mb-dark); }
.mbc__title span { display: inline-block; min-width: 26px; height: 26px; margin-left: 6px; padding: 0 8px; border-radius: 13px; background: #e8f5ee; color: var(--mb-green); font-size: 14px; line-height: 26px; text-align: center; vertical-align: 3px; box-sizing: border-box; }
.mbc__diff { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; color: #444; cursor: pointer; white-space: nowrap; }
.mbc__diff input { width: 18px; height: 18px; margin: 0; accent-color: var(--mb-green); cursor: pointer; }
.mbc__clear { padding: 0; border: 0; background: none; font: 500 15px/1 inherit; color: var(--mb-muted); cursor: pointer; }
.mbc__clear:hover { color: #c62828; }
.mbc__close { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--mb-line); border-radius: 50%; background: #fff; color: var(--mb-dark); cursor: pointer; }
.mbc__close svg { width: 18px; height: 18px; }
.mbc__close:hover { border-color: var(--mb-green); color: var(--mb-green); }

.mbc__body { flex: 1 1 auto; overflow: auto; -webkit-overflow-scrolling: touch; }
.mbc__empty { padding: 64px 28px; text-align: center; }
.mbc__empty p { margin: 0 0 8px; font-size: 20px; font-weight: 600; color: var(--mb-dark); }
.mbc__empty span { font-size: 15px; color: var(--mb-muted); }

.mbc__table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 14.5px; line-height: 1.45; }
.mbc__table th, .mbc__table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid #f0f0f0; background: #fff; }
.mbc__table tbody th { position: sticky; left: 0; z-index: 1; width: 190px; min-width: 190px; font-weight: 500; color: var(--mb-muted); }
.mbc__table td { width: 220px; min-width: 200px; color: var(--mb-text); }
.mbc__corner { position: sticky; left: 0; top: 0; z-index: 3; }
.mbc__prod { position: sticky; top: 0; z-index: 2; padding: 18px 16px 16px !important; border-bottom: 1px solid var(--mb-line) !important; }
.mbc__remove { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: #f3f3f3; color: #777; cursor: pointer; z-index: 1; }
.mbc__remove svg { width: 14px; height: 14px; }
.mbc__remove:hover { background: #fdecee; color: #c62828; }
.mbc__img { display: flex; align-items: center; justify-content: center; height: 150px; margin-bottom: 12px; }
.mbc__img img { max-width: 100%; max-height: 150px; object-fit: contain; }
.mbc__name { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--mb-dark) !important; text-decoration: none; }
.mbc__name:hover { color: var(--mb-green) !important; }
.mbc__price { margin-top: 8px; font-size: 18px; font-weight: 700; color: var(--mb-dark); }
.mbc__group td { position: sticky; left: 0; padding: 22px 16px 8px !important; font-size: 16px; font-weight: 700; color: var(--mb-dark); border-bottom: 0 !important; background: #fff; }
.mbc__none { color: #bbb; }
.mbc__row:hover th, .mbc__row:hover td { background: #fafafa; }
.mbc--diff .mbc__row--same { display: none; }

@media (max-width: 767px) {
	.mbc__head { flex-wrap: wrap; gap: 10px 16px; padding: 14px 16px; }
	.mbc__title { width: calc(100% - 56px); font-size: 19px; }
	.mbc__close { position: absolute; top: 12px; right: 12px; }
	.mbc__table tbody th { width: 120px; min-width: 120px; padding: 10px 12px; font-size: 13px; }
	.mbc__table td { min-width: 160px; width: 160px; padding: 10px 12px; font-size: 13.5px; }
	.mbc__prod { padding: 14px 12px 12px !important; }
	.mbc__img { height: 110px; }
	.mbc__img img { max-height: 110px; }
	.mbc__name { font-size: 13.5px; }
	.mbc__price { font-size: 16px; }
}
