/* ============================================================
   PALO ROSA — comparador.css  (Dark theme)
   ============================================================ */

.comparador {
  background: #0A0A0A;
  padding: var(--section-pad-y) var(--section-pad-x);
  border-top: 1px solid rgba(255,183,197,0.10);
  border-bottom: 1px solid rgba(255,183,197,0.10);
}
.comparador__inner {
  max-width: 1200px;
  margin: 0 auto;
}
.comparador__header {
  text-align: center;
  margin-bottom: 3rem;
}
.comparador__header .eyebrow { color: var(--rosa); }
.comparador__title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: #FAF7F2;
}

/* Slots de selección */
.comparador__slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}
.comparador__slot { width: 160px; }
.comparador__slot-filled {
  position: relative;
  background: transparent;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,183,197,0.12);
  padding: 1rem;
  text-align: center;
  animation: scaleIn 0.3s ease;
}
.comparador__slot-remove {
  position: absolute;
  top: -0.5rem; right: -0.5rem;
  width: 1.5rem; height: 1.5rem;
  background: var(--rosa);
  color: #0A0A0A;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  transition: background 0.2s;
}
.comparador__slot-remove:hover { background: #fff; }
.comparador__slot-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: #E5E2E1; /* Fondo claro crema/gris para resaltar frascos oscuros con multiply */
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.625rem;
}
.comparador__slot-img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 0.5rem;
  mix-blend-mode: multiply;
}
.comparador__slot-brand {
  font-size: 0.6875rem;
  color: var(--crema-dim);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comparador__slot-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #FAF7F2;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comparador__slot-empty {
  width: 160px;
  height: 200px;
  border: 2px dashed rgba(255,183,197,0.20);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--rosa);
  transition: var(--transition-base);
  font-size: 0.75rem;
}
.comparador__slot-empty:hover {
  border-color: var(--rosa);
  background: rgba(255,183,197,0.05);
}
.comparador__slot-empty svg { opacity: 0.7; }

.comparador__clear {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}
.comparador__clear-btn {
  font-size: 0.875rem;
  color: var(--crema-dim);
  transition: color 0.25s;
}
.comparador__clear-btn:hover { color: var(--rosa); }

/* Tabla de comparación */
.comparador__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  background: #0A0A0A;
  border: 1px solid rgba(255,183,197,0.15);
}
.comparador__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
.comparador__table thead tr th {
  padding: 1rem;
  text-align: center;
  min-width: 180px;
}
.comparador__table thead tr th:first-child {
  position: sticky;
  left: 0;
  background: #0A0A0A;
  min-width: 140px;
  text-align: left;
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--crema-dim);
  font-weight: 400;
}
.comparador__th-img {
  width: 3.5rem; height: 3.5rem;
  margin: 0 auto 0.5rem;
  background: #F5F0EB;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.comparador__th-img img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 4px;
  mix-blend-mode: multiply;
}
.comparador__th-brand {
  font-size: 0.6875rem;
  color: var(--crema-dim);
  display: block;
}
.comparador__th-name {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: #FAF7F2;
}
.comparador__table tbody tr { background: transparent; border-bottom: 1px solid rgba(255,183,197,0.06); }
.comparador__table tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--crema-mid);
  text-align: center;
  transition: background 0.3s ease;
}
.comparador__table tbody td:first-child {
  position: sticky;
  left: 0;
  background: #0A0A0A;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--crema-dim);
  text-align: left;
}
.comparador__table td.is-match {
  background: rgba(255,183,197,0.12);
  border: 1px solid rgba(255,183,197,0.25);
  color: var(--rosa);
  font-weight: 500;
}
.comparador__table td.is-match svg {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  color: var(--rosa);
}
.comparador__hint {
  text-align: center;
  color: var(--crema-dim);
  font-size: 0.9375rem;
  padding: 2rem 0;
}

/* Modal de búsqueda */
.comparador__search-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.comparador__search-modal.is-open {
  opacity: 1;
  pointer-events: all;
}
.comparador__search-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
}
.comparador__search-panel {
  position: relative;
  background: #141414;
  border: 1px solid rgba(255,183,197,0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.3s ease;
}
.comparador__search-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,183,197,0.08);
}
.comparador__search-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: #FAF7F2;
  margin-bottom: 1rem;
}
.comparador__search-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 2rem; height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crema-dim);
  border-radius: 50%;
  transition: var(--transition-base);
}
.comparador__search-close:hover { background: rgba(255,255,255,0.06); color: #FAF7F2; }
.comparador__search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,183,197,0.12);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: #FAF7F2;
  outline: none;
  transition: border-color 0.25s;
}
.comparador__search-input::placeholder { color: var(--crema-dim); }
.comparador__search-input:focus { border-color: var(--rosa); }
.comparador__search-list {
  overflow-y: auto;
  padding: 0.75rem;
  flex: 1;
}
.comparador__search-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  width: 100%;
  text-align: left;
  transition: background 0.2s;
}
.comparador__search-item:hover { background: rgba(255,183,197,0.06); }
.comparador__search-thumb {
  width: 3rem; height: 3rem;
  background: #E5E2E1; /* Fondo premium iluminado en Modal de Busqueda */
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.comparador__search-thumb img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 4px;
  mix-blend-mode: multiply;
}
.comparador__search-item-brand {
  font-size: 0.6875rem;
  color: var(--crema-dim);
}
.comparador__search-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #FAF7F2;
}
.comparador__search-empty {
  text-align: center;
  color: var(--crema-dim);
  padding: 2rem;
  font-size: 0.875rem;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
  .comparador__title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    margin-bottom: 0.5rem;
  }
  .comparador__slots {
    gap: 0.5rem;
  }
  .comparador__slot,
  .comparador__slot-empty {
    width: clamp(130px, 40vw, 150px);
  }
  .comparador__slot-empty {
    height: 160px;
    font-size: 0.6875rem;
  }
  .comparador__slot-empty svg {
    width: 20px;
    height: 20px;
  }

  /* Tabla adaptativa sin forzar un scroll inmenso */
  .comparador__table {
    min-width: 100%;
    table-layout: fixed;
  }
  .comparador__table thead tr th {
    min-width: unset;
    padding: 0.75rem 0.25rem;
  }
  .comparador__table thead tr th:first-child {
    min-width: 80px;
    width: 30%;
    font-size: 0.625rem;
    letter-spacing: 0.05em;
    padding-left: 0.5rem;
  }
  .comparador__table tbody td:first-child {
    font-size: 0.75rem;
    padding-left: 0.5rem;
    white-space: normal;
  }
  .comparador__table tbody td {
    padding: 0.75rem 0.25rem;
    font-size: 0.75rem;
    word-break: break-word;
    white-space: normal;
  }
  .comparador__th-img {
    width: 2.5rem;
    height: 2.5rem;
  }
  .comparador__th-name {
    font-size: 0.75rem;
  }
}

@media (max-width: 400px) {
  .comparador__slot,
  .comparador__slot-empty {
    width: 45vw;
  }
}

