/* v146 — сравнение товаров: карточки, плавающая панель и страница сравнения. */
:root {
  --compare-orange: #f39e32;
  --compare-orange-deep: #e8771b;
  --compare-ink: #25282d;
  --compare-muted: #71767d;
  --compare-line: rgba(49, 54, 61, .13);
}

.product-row,
.solution-product,
.account-favorite { position: relative; }

.product-compare-toggle {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 10px;
  display: inline-grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(43,48,54,.1);
  border-radius: 12px;
  color: #8b9097;
  background: rgba(255,255,255,.95);
  box-shadow: 0 8px 18px rgba(31,35,40,.1);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: transform .2s ease, color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.product-compare-toggle:hover,
.product-compare-toggle:focus-visible {
  color: #b95e08;
  border-color: rgba(232,119,27,.38);
  outline: 0;
  box-shadow: 0 9px 20px rgba(232,119,27,.17);
  transform: translateY(-2px);
}
.product-compare-toggle.is-active,
.product-compare-toggle[aria-pressed="true"] {
  color: #fff;
  border-color: rgba(211,110,14,.36);
  background: linear-gradient(145deg,#ffb35f,var(--compare-orange) 56%,var(--compare-orange-deep));
  box-shadow: 0 10px 22px rgba(222,105,14,.28);
}
.product-compare-toggle__icon { display:block; transform: translateY(-1px); }

.account-favorite .product-compare-toggle {
  top: 12px;
  right: 12px;
  left: auto;
}
.product-compare-inline {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.product-compare-inline.is-active,
.product-compare-inline[aria-pressed="true"] {
  color: #fff !important;
  border-color: rgba(211,110,14,.35) !important;
  background: linear-gradient(145deg,#ffb35f,var(--compare-orange) 56%,var(--compare-orange-deep)) !important;
}

.product-compare-dock {
  position: fixed;
  z-index: 2500;
  left: 50%;
  bottom: 18px;
  display: flex;
  min-width: min(420px, calc(100% - 24px));
  padding: 9px 10px 9px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(232,119,27,.22);
  border-radius: 18px;
  color: var(--compare-ink);
  background: rgba(255,255,255,.97);
  box-shadow: 0 22px 55px rgba(43,34,24,.20);
  backdrop-filter: blur(10px);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.product-compare-dock.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%,0);
}
.product-compare-dock__summary { display:flex; min-width:0; align-items:center; gap:10px; }
.product-compare-dock__icon {
  display:grid; width:38px; height:38px; flex:0 0 38px; place-items:center;
  border-radius:13px; color:#fff;
  background:linear-gradient(145deg,#ffb35f,var(--compare-orange) 56%,var(--compare-orange-deep));
  font-size:22px; font-weight:900;
}
.product-compare-dock__text { min-width:0; }
.product-compare-dock__text strong { display:block; font-size:13px; }
.product-compare-dock__text span { color:var(--compare-muted); font-size:11px; }
.product-compare-dock__actions { display:flex; align-items:center; gap:7px; }
.product-compare-dock__open,
.product-compare-dock__clear {
  min-height:38px; padding:8px 13px; border-radius:12px; font:inherit; font-size:12px; font-weight:800; cursor:pointer;
}
.product-compare-dock__open {
  border:1px solid rgba(211,110,14,.30); color:#fff; text-decoration:none;
  background:linear-gradient(145deg,#ffb35f,var(--compare-orange) 56%,var(--compare-orange-deep));
}
.product-compare-dock__clear { border:1px solid var(--compare-line); color:#5f646b; background:#fff; }
.product-compare-toast {
  position:fixed; z-index:2700; left:50%; bottom:86px; max-width:min(440px,calc(100% - 24px));
  padding:12px 16px; border-radius:13px; color:#fff; background:#2d3034; box-shadow:0 15px 35px rgba(0,0,0,.22);
  font-size:12px; font-weight:750; transform:translate(-50%,14px); opacity:0; pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
}
.product-compare-toast.is-visible { opacity:1; transform:translate(-50%,0); }

/* Страница сравнения. */
body.page-compare { min-width:320px; color:var(--compare-ink); background:#fffaf5; }
.compare-main { width:min(calc(100% - 32px),1156px); margin:24px auto 54px; }
.compare-hero {
  position:relative; display:flex; align-items:center; justify-content:center; padding:26px 30px;
  border:1px solid rgba(232,119,27,.16); border-radius:24px; background:#fff; box-shadow:0 16px 38px rgba(95,55,19,.08);
}
.compare-hero > div { box-sizing:border-box; width:100%; min-width:0; padding-inline:48px; text-align:center; }
.compare-hero__icon { position:absolute; top:50%; right:30px; transform:translateY(-50%); }
.compare-hero h1 { margin:0; font-size:clamp(28px,4vw,44px); letter-spacing:-.035em; }
.compare-hero p { max-width:760px; margin:9px auto 0; color:var(--compare-muted); font-size:14px; line-height:1.55; }
.compare-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin:18px 0; }
.compare-toolbar__left,.compare-toolbar__right { display:flex; flex-wrap:wrap; align-items:center; gap:9px; }
.compare-btn {
  display:inline-flex; min-height:42px; padding:9px 15px; align-items:center; justify-content:center; gap:7px;
  border:1px solid var(--compare-line); border-radius:13px; color:#373b40; background:#fff; font:inherit; font-size:12px; font-weight:800; text-decoration:none; cursor:pointer;
}
.compare-btn--primary { color:#fff; border-color:rgba(211,110,14,.32); background:linear-gradient(145deg,#ffb35f,var(--compare-orange) 56%,var(--compare-orange-deep)); }
.compare-toggle { display:inline-flex; align-items:center; gap:8px; color:#555b62; font-size:12px; font-weight:750; }
.compare-toggle input { width:18px; height:18px; accent-color:var(--compare-orange-deep); }
.compare-notice { margin:0 0 16px; padding:13px 16px; border:1px solid #f0c88f; border-radius:14px; color:#93510f; background:#fff7e8; font-size:12px; line-height:1.5; }
.compare-empty { padding:54px 28px; border:1px dashed rgba(232,119,27,.36); border-radius:22px; background:#fff; text-align:center; }
.compare-empty h2 { margin:0 0 8px; }
.compare-empty p { margin:0 0 20px; color:var(--compare-muted); }
.compare-table-wrap { overflow:auto; border:1px solid var(--compare-line); border-radius:22px; background:#fff; box-shadow:0 16px 38px rgba(55,44,32,.08); }
.compare-table { width:100%; min-width:760px; border-collapse:separate; border-spacing:0; table-layout:fixed; }
.compare-table th,.compare-table td { padding:14px 15px; border-right:1px solid #eceef0; border-bottom:1px solid #eceef0; vertical-align:top; }
.compare-table tr:last-child th,.compare-table tr:last-child td { border-bottom:0; }
.compare-table th:last-child,.compare-table td:last-child { border-right:0; }
.compare-table__label { position:sticky; left:0; z-index:2; width:185px; color:#555b62; background:#fafbfc; font-size:12px; font-weight:850; text-align:left; }
.compare-product-head { min-width:220px; background:#fff; }
.compare-product-card { position:relative; display:flex; min-height:100%; flex-direction:column; }
.compare-product-card__media { display:grid; height:155px; padding:12px; place-items:center; overflow:hidden; border-radius:16px; background:#fff; }
.compare-product-card__media img { display:block; width:100%; height:100%; max-width:100%; max-height:100%; object-fit:contain; }
.compare-product-card h2 { display:-webkit-box; min-height:42px; margin:10px 0 6px; overflow:hidden; font-size:14px; line-height:1.45; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.compare-product-card__meta { min-height:32px; color:var(--compare-muted); font-size:11px; line-height:1.45; }
.compare-product-card__actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.compare-product-card__remove,.compare-product-card__open { min-height:35px; padding:7px 10px; border-radius:11px; font:inherit; font-size:11px; font-weight:800; cursor:pointer; }
.compare-product-card__remove { border:1px solid rgba(190,54,54,.22); color:#b12f2f; background:#fff4f4; }
.compare-product-card__open { border:1px solid var(--compare-line); color:#50555b; background:#fff; text-decoration:none; }
.compare-value { color:#30343a; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.compare-value.is-different { background:#fff8e8; box-shadow:inset 3px 0 0 #f3a23f; }
.compare-value .product-stock { margin:0; }
.compare-table tr.is-equal-row.is-hidden { display:none; }
.compare-loading { padding:48px; color:var(--compare-muted); text-align:center; }

@media (max-width:620px) {
  .product-compare-dock { min-width:calc(100% - 18px); bottom:9px; padding-left:10px; }
  .product-compare-dock__text span { display:none; }
  .product-compare-dock__clear { padding-inline:9px; }
  .compare-main { width:min(calc(100% - 18px),1156px); margin-top:12px; }
  .compare-hero { padding:22px 18px; border-radius:20px; }
  .compare-hero > div { padding-inline:0; }
  .compare-hero__icon { display:none; }
  .compare-toolbar { align-items:stretch; flex-direction:column; }
  .compare-toolbar__left,.compare-toolbar__right { width:100%; }
  .compare-btn { flex:1; }
}

@media (prefers-reduced-motion:reduce) {
  .product-compare-toggle,.product-compare-dock,.product-compare-toast { transition-duration:.01ms !important; }
}

.compare-disabled [data-compare-product]{display:none!important}.compare-product-card{position:relative}


/* v148: жёсткое ограничение размеров карточек и изображений на странице сравнения */
.compare-table th, .compare-table td { box-sizing: border-box; }
.compare-product-head { width: 290px; min-width: 290px; max-width: 290px; }
.compare-product-card { min-width: 0; overflow: hidden; }
.compare-product-card__media {
  width: min(100%, 220px);
  max-width: 220px;
  height: 155px;
  min-height: 155px;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(49,54,61,.08);
  border-radius: 16px;
  background: #fff;
}
.compare-product-card__media img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
}
.compare-product-card h2,
.compare-product-card__meta,
.compare-product-card__actions {
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}
.compare-product-card__actions { justify-content: flex-start; }
.compare-product-card .product-season-badge--compare { left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); }

@media (max-width: 900px) {
  .compare-product-head { width: 250px; min-width: 250px; max-width: 250px; }
  .compare-product-card__media,
  .compare-product-card h2,
  .compare-product-card__meta,
  .compare-product-card__actions { max-width: 190px; }
}

@media (max-width: 620px) {
  .compare-product-head { width: 220px; min-width: 220px; max-width: 220px; }
  .compare-product-card__media { width: min(100%, 170px); max-width: 170px; height: 132px; min-height: 132px; }
  .compare-product-card h2,
  .compare-product-card__meta,
  .compare-product-card__actions { max-width: 170px; }
}


/* v149: избранное и усиленное ограничение изображений на странице сравнения */
.compare-product-card {
  align-items: center;
  padding-top: 2px;
}
.compare-product-card__favorite {
  position: absolute;
  z-index: 6;
  top: 10px;
  right: 10px;
  display: inline-grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(43, 48, 54, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(31, 35, 40, 0.10);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.compare-product-card__favorite:hover,
.compare-product-card__favorite:focus-visible {
  border-color: rgba(232, 119, 27, 0.38);
  outline: none;
  box-shadow: 0 9px 20px rgba(232, 119, 27, 0.17);
  transform: translateY(-2px);
}
.compare-product-card__favorite .fav-btn__star {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #aaa;
  font-size: 23px;
  line-height: 1;
}
.compare-product-card.is-favorited .compare-product-card__favorite .fav-btn__star {
  color: var(--compare-orange);
  text-shadow: 0 3px 10px rgba(245, 130, 32, 0.25);
}
.compare-product-card__media {
  position: relative;
  width: min(100%, 200px);
  max-width: 200px;
  min-width: 0;
  height: 150px;
  min-height: 150px;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(49,54,61,.08);
  border-radius: 16px;
  background: #fff;
}
.compare-product-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  overflow: hidden;
}
.compare-product-card h2,
.compare-product-card__meta,
.compare-product-card__actions {
  width: 100%;
  max-width: 200px;
  margin-left: auto;
  margin-right: auto;
}
.compare-product-card__actions {
  justify-content: flex-start;
}
@media (max-width: 900px) {
  .compare-product-card__media,
  .compare-product-card h2,
  .compare-product-card__meta,
  .compare-product-card__actions {
    max-width: 180px;
  }
  .compare-product-card__media {
    width: min(100%, 180px);
    max-width: 180px;
    height: 142px;
    min-height: 142px;
  }
}
@media (max-width: 620px) {
  .compare-product-card__media,
  .compare-product-card h2,
  .compare-product-card__meta,
  .compare-product-card__actions {
    max-width: 160px;
  }
  .compare-product-card__media {
    width: min(100%, 160px);
    max-width: 160px;
    height: 128px;
    min-height: 128px;
  }
  .compare-product-card__favorite {
    top: 8px;
    right: 8px;
  }
}
