/* ═══════════════════════════════════════════════════════════
   COMPARE PAGE — IT-Technica
   ═══════════════════════════════════════════════════════════ */

.cmp-page {
  background: #F5F7FA;
  min-height: 80vh;
  padding-bottom: 80px;
}

/* ── Header ─────────────────────────────────────────────── */
.cmp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 28px;
  flex-wrap: wrap;
}
.cmp-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cmp-title {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: #1d1d1f;
  letter-spacing: -.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cmp-title i {
  font-size: 22px;
  color: #0284c7;
  background: #eff6ff;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.cmp-count {
  background: #0284c7;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: 'Outfit', sans-serif;
}
.cmp-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cmp-btn-clear {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: 1.5px solid #fecaca;
  background: #fff5f5;
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .2s;
}
.cmp-btn-clear:hover { background: #ef4444; color: #fff; border-color: #ef4444; }
.cmp-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .2s;
  text-decoration: none;
}
.cmp-btn-back:hover { background: #f1f5f9; color: #1d1d1f; }

/* ── Empty state ─────────────────────────────────────────── */
.cmp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  text-align: center;
}
.cmp-empty-icon {
  width: 90px; height: 90px;
  background: #eff6ff;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 36px;
  color: #0284c7;
  margin-bottom: 24px;
}
.cmp-empty h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #1d1d1f;
  margin-bottom: 10px;
}
.cmp-empty p {
  color: #64748b;
  font-size: 15px;
  max-width: 420px;
  line-height: 1.6;
  margin-bottom: 28px;
}
.cmp-btn-catalog {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: #0284c7;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 100px;
  text-decoration: none;
  transition: all .3s;
  box-shadow: 0 8px 20px rgba(2,132,199,.25);
}
.cmp-btn-catalog:hover { background: #0369a1; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(2,132,199,.35); }

/* ── Table wrapper ────────────────────────────────────────── */
.cmp-table-wrap {
  overflow-x: auto;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.06);
  background: #fff;
}
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

/* ── Label column ─────────────────────────────────────────── */
.cmp-label-col {
  width: 200px;
  min-width: 160px;
  background: #f8fafc;
  border-right: 1px solid #f1f5f9;
  padding: 16px 20px;
  vertical-align: middle;
  position: sticky;
  left: 0;
  z-index: 10;
}

/* ── Product column ────────────────────────────────────────── */
.cmp-product-col {
  min-width: 220px;
  vertical-align: top;
  padding: 20px 16px 24px;
  border-right: 1px solid #f1f5f9;
  text-align: center;
  position: relative;
}
.cmp-product-col:last-child { border-right: none; }

.cmp-product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.cmp-remove-btn {
  position: absolute;
  top: -8px; right: -8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .2s;
  z-index: 5;
}
.cmp-remove-btn:hover { background: #ef4444; border-color: #ef4444; color: #fff; }

.cmp-product-img-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px; height: 130px;
  background: #f8fafc;
  border-radius: 14px;
  overflow: hidden;
  transition: all .3s;
  margin-bottom: 4px;
}
.cmp-product-img-link:hover { background: #eff6ff; }
.cmp-product-img {
  max-width: 85%;
  max-height: 110px;
  object-fit: contain;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.cmp-product-img-link:hover .cmp-product-img { transform: scale(1.06); }
.cmp-product-icon {
  font-size: 56px;
  color: #cbd5e1;
}

.cmp-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #fff;
}
.cmp-badge--sale { background: #ef4444; }
.cmp-badge--new  { background: #0284c7; }

.cmp-product-brand {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.cmp-product-name {
  font-size: 13px;
  font-weight: 600;
  color: #1d1d1f;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: color .2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cmp-product-name:hover { color: #0284c7; }

.cmp-product-price { text-align: center; }
.cmp-price-old {
  font-size: 12px;
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 500;
}
.cmp-price {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #1d1d1f;
  letter-spacing: -.5px;
}
.cmp-price--sale { color: #ef4444; }

.cmp-product-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  justify-content: center;
}
.cmp-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cmp-status--ok  { color: #10b981; }
.cmp-status--ok  .cmp-dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.cmp-status--out { color: #94a3b8; }
.cmp-status--out .cmp-dot { background: #94a3b8; }

.cmp-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: #0284c7;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(2,132,199,.25);
}
.cmp-cart-btn:hover { background: #0369a1; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(2,132,199,.35); }

/* ── Add more slot ────────────────────────────────────────── */
.cmp-add-col {
  min-width: 180px;
  vertical-align: top;
  padding: 24px 16px;
  border-right: none;
}
.cmp-add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px dashed #e2e8f0;
  border-radius: 16px;
  padding: 32px 16px;
  height: 100%;
  min-height: 320px;
  color: #94a3b8;
  text-align: center;
  transition: all .3s;
}
.cmp-add-card:hover { border-color: #0284c7; background: #f0f9ff; }
.cmp-add-card i { font-size: 32px; color: #cbd5e1; transition: color .3s; }
.cmp-add-card:hover i { color: #0284c7; }
.cmp-add-card p { font-size: 14px; font-weight: 600; color: #94a3b8; }
.cmp-add-btn {
  padding: 8px 18px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: all .25s;
}
.cmp-add-btn:hover { background: #0284c7; border-color: #0284c7; color: #fff; }

/* ── Section separator row ────────────────────────────────── */
.cmp-row-section td {
  background: #f1f5f9;
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-family: 'Inter', sans-serif;
}

/* ── Spec rows ────────────────────────────────────────────── */
.cmp-row td {
  padding: 12px 16px;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
  font-size: 13px;
  transition: background .2s;
}
.cmp-row:hover td { background: #fafcff; }
.cmp-row:last-child td { border-bottom: none; }

.cmp-spec-label {
  font-weight: 600;
  color: #475569;
  background: #f8fafc !important;
  border-right: 1px solid #f1f5f9;
  position: sticky;
  left: 0;
  z-index: 5;
}
.cmp-row:hover .cmp-spec-label { background: #f1f5f9 !important; }

.cmp-spec-val {
  text-align: center;
  color: #1d1d1f;
  font-weight: 500;
  border-right: 1px solid #f8fafc;
}
.cmp-spec-val:last-child { border-right: none; }
.cmp-val--muted { color: #94a3b8; font-size: 12px; }
.cmp-val--empty { color: #cbd5e1; }
.cmp-add-empty { background: #fafafa !important; }

/* Best value badge */
.cmp-val--best { background: rgba(16,185,129,.04) !important; }
.cmp-best-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16,185,129,.12);
  color: #059669;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  margin-left: 6px;
  font-family: 'Outfit', sans-serif;
}
.cmp-best-badge i { font-size: 9px; }

.cmp-val-old {
  font-size: 11px;
  color: #94a3b8;
  text-decoration: line-through;
  margin-bottom: 2px;
}

/* Tags */
.cmp-tag--green, .cmp-tag--gray {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.cmp-tag--green { background: rgba(16,185,129,.1); color: #059669; }
.cmp-tag--gray  { background: #f1f5f9; color: #64748b; }

/* Diff toggle */
.cmp-diff-toggle { padding: 4px 0; }
.cmp-diff-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  user-select: none;
  white-space: nowrap;
}
.cmp-diff-label input { display: none; }
.cmp-diff-check {
  width: 36px; height: 20px;
  background: #e2e8f0;
  border-radius: 100px;
  position: relative;
  flex-shrink: 0;
  transition: background .25s;
}
.cmp-diff-check::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.cmp-diff-label input:checked ~ .cmp-diff-check { background: #0284c7; }
.cmp-diff-label input:checked ~ .cmp-diff-check::after { transform: translateX(16px); }

/* Hide same rows when diff mode on */
.cmp-table.diff-mode .cmp-same { display: none; }
.cmp-table.diff-mode .cmp-row-section { display: none; }

/* ── Floating Compare Bar (in catalog) ────────────────────── */
.cmp-floating-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: #1d1d1f;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 14px 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  opacity: 0;
  min-width: 320px;
  max-width: 90vw;
}
.cmp-floating-bar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.cmp-bar-products {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.cmp-bar-thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.15);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.cmp-bar-thumb img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}
.cmp-bar-thumb-empty {
  font-size: 18px;
  color: rgba(255,255,255,.2);
}
.cmp-bar-thumb .cmp-thumb-remove {
  position: absolute;
  inset: 0;
  background: rgba(239,68,68,.8);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
  border-radius: 9px;
}
.cmp-bar-thumb:hover .cmp-thumb-remove { display: flex; }

.cmp-bar-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cmp-bar-count {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}
.cmp-bar-hint {
  font-size: 11px;
  color: rgba(255,255,255,.5);
}

.cmp-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cmp-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all .3s;
  text-decoration: none;
  border: none;
}
.cmp-bar-btn--primary {
  background: #0284c7;
  color: #fff;
  box-shadow: 0 6px 16px rgba(2,132,199,.4);
}
.cmp-bar-btn--primary:hover { background: #0369a1; transform: translateY(-1px); color: #fff; }
.cmp-bar-btn--ghost {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
}
.cmp-bar-btn--ghost:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── Compare button active state on card ─────────────────── */
.cc-act-btn.compare-active {
  background: #0284c7 !important;
  color: #fff !important;
  border-color: #0284c7 !important;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cmp-label-col { width: 130px; min-width: 120px; }
  .cmp-product-col { min-width: 180px; }
  .cmp-floating-bar { bottom: 80px; min-width: auto; padding: 12px 14px; gap: 10px; }
  .cmp-bar-hint { display: none; }
}
@media (max-width: 600px) {
  .cmp-header { flex-direction: column; align-items: flex-start; }
  .cmp-title { font-size: 20px; }
  .cmp-bar-thumb { width: 36px; height: 36px; }
}
