/* =========================================
   ER COMPARE - BASE ESTABLE
========================================= */

/* Botón comparar en cards/perfiles */
.er-compare-btn,
[data-compare-toggle] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem .9rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  transition: all .2s ease;
}

[data-compare-toggle].is-active,
.er-compare-btn.is-active {
  background: #0B6600;
  border-color: #0B6600;
  color: #fff;
  font-weight: 600;
}

/* =========================================
   DESKTOP: barra comparar estilo favoritos
   ========================================= */
@media (min-width: 641px) {
  .er-compare-bar {
    position: fixed;
    left: 50%;
    bottom: 85px;
    width: min(92vw, 560px);
    z-index: 9999;
    transform: translateX(-50%);
  }

  .er-compare-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #0B6600;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(10px);
  }

  .er-compare-bar__count {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    min-width: 0;
    color: #111;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
  }

  .er-compare-bar__count::before {
    content: "⇄";
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #f4fbf5;
    color: #0B6600;
    font-size: 18px;
    line-height: 1;
  }

  .er-compare-bar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
  }

  .er-compare-bar__view,
  .er-compare-bar__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    white-space: nowrap;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all .2s ease;
  }

  .er-compare-bar__view {
    border: 1px solid #0B6600;
    background: #0B6600;
    color: #fff;
  }

  .er-compare-bar__view:hover {
    transform: translateY(-1px);
    opacity: .95;
  }

  .er-compare-bar__clear {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    color: #444;
    cursor: pointer;
  }

  .er-compare-bar__clear:hover {
    background: #f8f8f8;
  }
}

/* =========================================
   PÁGINA DE COMPARACIÓN
========================================= */

.er-compare-page {
  width: 100%;
}

.er-compare-empty,
.er-compare-loading {
  padding: 12px 0;
}

.er-compare-results {
  width: 100%;
}

/* =========================================
   GRID DE CARDS
========================================= */

.er-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.er-compare-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 760px;

  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
}

.er-compare-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.er-compare-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.er-compare-card__top h3,
.er-compare-card__top h3 a,
.er-compare-card__top h3 a:link,
.er-compare-card__top h3 a:visited,
.er-compare-card__top h3 a:hover,
.er-compare-card__top h3 a:active {
  text-decoration: none !important;
  box-shadow: none !important;
  border-bottom: 0 !important;
}

/* Top */
.er-compare-card__top {
  margin-bottom: 12px;
}

.er-compare-card__top h3 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.3;
  text-align: center;
  color: #0B6600;
}

.er-compare-card__top h3 a {
  color: inherit;
}

/* Imagen */
.er-compare-card__top img,
.er-compare-card__ph {
  display: block;
  width: 100%;
  height: 260px;
  border-radius: 14px;
  background: #f7f7f7;
  margin-bottom: 12px;
  object-fit: cover;
  object-position: center top;
}

.er-compare-card__ph {
  background: #f1f1f1;
}

/* Filas */
.er-compare-card__row {
  margin: 0 0 10px;
  font-size: .95rem;
  line-height: 1.45;
}

.er-compare-card__row strong {
  font-weight: 700;
}

/* Técnicas */
.er-compare-card__row--techniques {
  margin: 0 0 10px;
}

.er-compare-card__row--techniques .er-compare-card__label {
  display: block;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
}

.er-compare-card__value--block {
  display: block;
}

.er-compare-techniques,
.er-compare-techniques--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.er-compare-technique {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(11,102,0,.5);
  background: #fff;
  font-size: .82rem;
  line-height: 1;
  white-space: nowrap;
  color: #0B6600;
}

.er-compare-techniques-empty {
  display: block;
  opacity: .8;
}

/* Acciones */
.er-compare-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.er-compare-btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  background: #fff;
  transition: all .2s ease;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
  background: linear-gradient(180deg, #19c54f, #0b8833);
  color: #fff;
}

.er-compare-btn-link:hover {
  color: #f5fbf5;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1100px) {
  .er-compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .er-compare-grid {
    grid-template-columns: 1fr;
  }

  .er-compare-bar__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .er-compare-bar__actions {
    width: 100%;
    justify-content: space-between;
  }

  .er-compare-card__top img,
  .er-compare-card__ph {
    height: 320px;
  }
}

@media (max-width: 640px) {
  .er-compare-card {
    padding: 14px;
  }

  .er-compare-card__top img,
  .er-compare-card__ph {
    height: 280px;
  }

  .er-compare-bar {
    width: calc(100% - 20px);
    bottom: 10px;
  }
}


/* =========================================
   BOTON COMPARAR
========================================= */
.er-pro-card .er-tags.is-center .er-compare-chip{
  appearance:none;
  -webkit-appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:7px 12px;
  border-radius:999px;
  border:1px dashed #69ad70;
  background:#f4fbf4;
  color:#2f6b35;
  font-family:inherit;
  font-size:13px;
  font-weight:600;
  line-height:1;
  cursor:pointer;
  text-decoration:none;
  box-shadow:none;
  transition:all .2s ease;
}

.er-pro-card .er-tags.is-center .er-compare-chip:hover{
  background:#edf7ee;
  border-color:#4f9a57;
  color:#24572a;
}

.er-pro-card .er-tags.is-center .er-compare-chip.is-active,
.er-pro-card .er-tags.is-center .er-compare-chip[aria-pressed="true"]{
  background:#2f6b35;
  border-style:solid;
  border-color:#2f6b35;
  color:#fff;
}

.er-compare-chip,
[data-compare-toggle] {
  min-width: 90px;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

/* =========================================
   MOBILE: FAB central para comparar
   ========================================= */
@media (max-width: 640px) {
  .er-compare-fab {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.5);
    z-index: 101;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
  }

  .er-compare-fab.is-visible {
    display: flex;
  }

  .er-compare-fab::before {
    font-size: 28px;
    line-height: 1;
    color: #111;
  }

  .er-compare-fab:focus-visible {
    outline: 2px solid rgba(11,102,0,.28);
    outline-offset: 2px;
  }

  /* ocultar la barra negra real solo en mobile */
  .er-compare-bar.is-mobile-hidden {
    display: none !important;
  }
}

/* =========================================
   MOBILE: compare como botón circular central
========================================= */
@media (max-width: 640px) {
  .er-compare-bar.is-mobile-fab {
    left: 50%;
    bottom: 4rem;
    width: 64px;
    position: fixed;
    transform: translateX(-50%);
    z-index: 100 !important;
  }

  .er-compare-bar.is-mobile-fab .er-compare-fab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.5);
    text-decoration: none;
  }

  .er-compare-bar.is-mobile-fab .er-compare-fab__icon {
    display: block;
    font-size: 28px;
    line-height: 1;
    color: #111;
  }

  .er-compare-bar.is-mobile-fab .er-compare-fab__count {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #0B6600;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
  }

  .er-compare-bar.is-mobile-fab .er-compare-bar__inner,
  .er-compare-bar.is-mobile-fab .er-compare-bar__count,
  .er-compare-bar.is-mobile-fab .er-compare-bar__actions,
  .er-compare-bar.is-mobile-fab .er-compare-bar__view,
  .er-compare-bar.is-mobile-fab .er-compare-bar__clear {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .er-compare-bar.is-mobile-fab {
    left: 50%;
    bottom: 4rem;
    width: 64px;
    height: 64px;
    transform: translateX(-50%);
    z-index: 100 !important;
  }

  .er-compare-fab-wrap {
    position: relative;
    width: 64px;
    height: 64px;
  }

  .er-compare-bar.is-mobile-fab .er-compare-fab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.5);
    text-decoration: none;
  }

  .er-compare-bar.is-mobile-fab .er-compare-fab__icon {
    display: block;
    font-size: 28px;
    line-height: 1;
    color: #111;
  }

  .er-compare-bar.is-mobile-fab .er-compare-fab__count {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #0B6600;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
  }

  .er-compare-fab-clear {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    padding: 0;
    z-index: 999;
  }

  .er-compare-bar.is-mobile-fab .er-compare-bar__inner,
  .er-compare-bar.is-mobile-fab .er-compare-bar__count,
  .er-compare-bar.is-mobile-fab .er-compare-bar__actions,
  .er-compare-bar.is-mobile-fab .er-compare-bar__view,
  .er-compare-bar.is-mobile-fab .er-compare-bar__clear {
    display: none !important;
  }
}

.er-compare-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: all .2s ease;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
  font-size: 16px;
  line-height: 1;
  color: #d11a2a;
  font-weight: 700;
  margin-left: auto;
}

.er-compare-remove-btn:hover {
  transform: translateY(-2px);
}

.er-compare-remove-btn:focus-visible {
  outline: 2px solid rgba(11,102,0,.28);
  outline-offset: 2px;
}

.er-card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.er-card-actions-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.er-card-actions-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.er-card-actions-side .er-compare-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 38px;
  margin: 0;
  transform: none;
  color: #d11a2a;
  font-weight: 700;
}