/* Barra flotante de comparar — global (productos, fichas, resto del sitio).
   No es el CSS de la página /comparar (eso sigue en comparar/styles.css). */
.compare-bar{
  --ink:#141821;
  --ink-soft:#48525f;
  --brand:#00bdff;
  --btn-blue:#0077a8;
  --btn-blue-dark:#005f87;
  --bg-card:#efefef;
  --radius-sm:8px;
  --ease:cubic-bezier(.22,.61,.36,1);
  --font:'Noto Sans',sans-serif;
  position:fixed;
  left:20px;
  bottom:20px;
  transform:none;
  width:calc(100% - 40px - 168px);
  z-index:10020;
  transition:width .3s var(--ease),left .3s var(--ease),bottom .3s var(--ease);
  touch-action:manipulation;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  font-family:var(--font);
  color:var(--ink);
  font-weight:400;
  box-sizing:border-box;
}
.compare-bar *,
.compare-bar *::before,
.compare-bar *::after{
  box-sizing:border-box;
  font-family:inherit;
}
.compare-bar label{
  margin:0 !important;
  margin-bottom:0 !important;
  font-weight:inherit !important;
  display:flex !important;
}
.compare-bar-inner{
  background:#fff;
  border-radius:14px;
  box-shadow:0 12px 32px rgba(10,14,25,.18);
  padding:12px 16px;
  border:1px solid #eef0f3;
}
.compare-bar-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
}
.compare-bar-title{
  font-size:14px;
  font-weight:700;
  color:var(--ink);
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
}
.compare-count{
  background:var(--brand);
  color:#fff;
  font-size:11px;
  font-weight:700;
  width:20px;
  height:20px;
  border-radius:50%;
  flex:none;
  display:inline-grid;
  place-items:center;
  line-height:1;
  padding:0;
  margin:0;
  text-align:center;
}
.compare-toggle{
  border:none;
  background:none;
  cursor:pointer;
  color:var(--ink-soft);
  width:26px;
  height:26px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:6px;
  padding:0;
  margin:0;
  flex:none;
}
.compare-toggle:hover{background:var(--bg-card);}
.compare-bar.collapsed .compare-bar-body{display:none;}
.compare-bar.collapsed .compare-toggle svg{transform:rotate(180deg);}
.compare-bar-body{
  display:flex;
  align-items:stretch;
  gap:10px;
  margin-top:14px;
  flex-wrap:nowrap;
  min-width:0;
}
.compare-items{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
  flex:1 1 0;
  width:0;
  min-width:0;
}
.compare-chip{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  background:#f5f6f7;
  border:1px solid #eceef1;
  border-radius:10px;
  padding:9px 30px 9px 8px;
  width:auto;
  min-width:0;
  max-width:none;
  overflow:hidden;
}
.compare-chip-remove{
  position:absolute;
  top:6px;
  right:6px;
  border:none;
  background:#fff;
  color:var(--ink-soft);
  width:18px;
  height:18px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  line-height:1;
  cursor:pointer;
  padding:0;
  margin:0;
  box-shadow:0 1px 3px rgba(10,14,25,.15);
}
.compare-chip-remove:hover{background:#fbeceb;color:#d1453b;}
.compare-chip-thumb{
  width:46px;
  height:46px;
  border-radius:8px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:none;
  overflow:hidden;
  padding:4px;
}
.compare-chip-thumb img{
  width:100%;
  height:100%;
  object-fit:contain;
  max-width:none;
  border:0;
}
.compare-chip-info{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  text-align:left;
  gap:2px;
  min-width:0;
  flex:1;
  overflow:hidden;
}
.compare-chip-name{
  font-size:12px;
  font-weight:700;
  color:var(--ink);
  line-height:1.25;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  max-width:100%;
}
.compare-chip-sku{
  font-size:10px;
  color:var(--ink-soft);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}
.compare-slot-empty{
  width:auto;
  min-width:0;
  min-height:64px;
  height:100%;
  border-radius:10px;
  border:1.5px dashed #d8dce1;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#c3c9d1;
  font-size:16px;
  background:#fafbfc;
}
.compare-bar a.compare-cta,
.compare-cta{
  margin-left:0;
  background:var(--btn-blue);
  color:#fff !important;
  border:none;
  border-radius:var(--radius-sm);
  padding:9px 12px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  display:flex !important;
  align-items:center;
  gap:6px;
  white-space:nowrap;
  flex:0 0 auto;
  align-self:center;
  text-decoration:none !important;
}
.compare-cta svg{width:14px;height:14px;}
.compare-cta:hover{background:var(--btn-blue-dark);color:#fff !important;}
.compare-cta.disabled{background:#c3c9d6;cursor:not-allowed;pointer-events:none;}

body.has-compare-bar .ai-launch{
  bottom:max(20px,env(safe-area-inset-bottom,0px));
}
@media (min-width:641px){
  body.assistant-open .compare-bar{
    width:calc(100% - 20px - 400px - 16px);
    max-width:none;
  }
}
@media (min-width:901px){
  .compare-bar-body{flex-wrap:nowrap;}
  .compare-items{grid-template-columns:repeat(3, minmax(0, 1fr));}
  .compare-slot-empty{display:flex;}
}
@media (min-width:901px) and (max-width:1400px){
  .compare-bar-inner{padding:10px 14px;}
  .compare-bar-title{font-size:13px;}
  .compare-bar-body{gap:8px;margin-top:12px;}
  .compare-items{gap:6px;}
  .compare-chip{gap:8px;padding:8px 26px 8px 7px;border-radius:9px;}
  .compare-chip-thumb{width:40px;height:40px;padding:3px;border-radius:7px;}
  .compare-chip-name{font-size:11px;}
  .compare-chip-sku{font-size:9px;}
  .compare-chip-remove{top:5px;right:5px;width:16px;height:16px;font-size:12px;}
  .compare-slot-empty{min-height:56px;font-size:15px;border-radius:9px;}
  .compare-cta{padding:8px 10px;font-size:11px;gap:5px;}
}
@media (max-width:640px){
  .compare-bar{
    left:12px;
    bottom:12px;
    width:calc(100% - 84px);
    max-width:none;
  }
  .compare-bar-inner{padding:14px 16px;}
  .compare-bar-title{font-size:14px;}
  .compare-bar button,
  .compare-bar a,
  .compare-cta{font-size:16px;}
  .compare-chip-name{font-size:16px;}
  .compare-chip-sku{font-size:12px;}
  .compare-chip-remove{font-size:16px;}
  .compare-bar-body{
    flex-direction:column;
    align-items:stretch;
    gap:12px;
    margin-top:12px;
  }
  .compare-items{
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
    width:100%;
    flex:none;
  }
  .compare-chip{width:100%;min-width:0;max-width:none;}
  .compare-slot-empty{display:none;}
  .compare-cta{margin-left:0;width:100%;justify-content:center;}
  body.has-compare-bar .ai-launch{
    bottom:max(12px,env(safe-area-inset-bottom,0px));
  }
  body.assistant-open .compare-bar{display:none !important;}
}
