/* ========================================
   Modal de Búsqueda Dinámica - Redesign v3
   ThinkChip Dark Technical Aesthetic
   ======================================== */

.comparador-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.comparador-modal[aria-hidden="false"] {
  display: block;
  opacity: 1;
}

/* Backdrop */
.comparador-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

/* Container */
.comparador-modal__container {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  margin: 10vh auto;
  background: #111111;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalAppear {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.comparador-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}

.comparador-modal__title {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
}

.comparador-modal__close {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.2s ease;
}

.comparador-modal__close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Search */
.comparador-modal__search {
  padding: 0 24px 16px;
}

.comparador-modal__search-wrapper {
  position: relative;
}

.comparador-modal__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.comparador-modal__search-input {
  width: 100%;
  padding: 12px 40px 12px 40px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: #1a1a1a;
  color: #ffffff;
  transition: all 0.2s ease;
}

.comparador-modal__search-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.comparador-modal__search-input:focus {
  outline: none;
  border-color: rgba(0, 224, 122, 0.5);
  background: #1e1e1e;
}

.comparador-modal__search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

/* Filters */
.comparador-modal__filters {
  display: flex;
  gap: 8px;
  padding: 0 24px 20px;
}

.comparador-modal__filter {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: #000;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.comparador-modal__filter:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.comparador-modal__filter.active {
  background: #00e07a;
  border-color: #00e07a;
  color: #000;
}

/* Validation */
.comparador-modal__validation {
  padding: 12px 24px;
  background: rgba(0, 224, 122, 0.05);
  border-top: 1px solid rgba(0, 224, 122, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.comparador-modal__validation-text {
  font-size: 12px;
  color: rgba(0, 224, 122, 0.8);
}

/* Results */
.comparador-modal__results {
  flex: 1;
  overflow-y: auto;
  background: #111111;
}

.comparador-modal__products {
  display: flex;
  flex-direction: column;
}

/* Product Item */
.comparador-modal__product {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  cursor: pointer;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.comparador-modal__product:hover,
.comparador-modal__product:focus {
  background: rgba(255, 255, 255, 0.02);
  outline: none;
}

.comparador-modal__product:hover .comparador-modal__product-name,
.comparador-modal__product:focus .comparador-modal__product-name {
  color: #00e07a;
}

.comparador-modal__product-image {
  width: 44px;
  height: 44px;
  background: #1e1e1e;
  border-radius: 4px;
  overflow: hidden;
  padding: 4px;
}

.comparador-modal__product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.comparador-modal__product-info {
  display: flex;
  flex-direction: column;
}

.comparador-modal__product-brand {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: #00e07a;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

.comparador-modal__product-name {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
  transition: color 0.2s;
}

.comparador-modal__product-price {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 2px;
}

.comparador-modal__product-arrow {
  color: rgba(255, 255, 255, 0.15);
}

/* Footer & Hints */
.comparador-modal__footer {
  padding: 16px 24px;
  background: #0a0a0a;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.comparador-modal__hints {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.hint-item {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

kbd {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  color: #fff;
  padding: 2px 5px;
  font-family: inherit;
  font-size: 11px;
}

/* Loading & Empty */
.comparador-modal__loading,
.comparador-modal__empty {
  padding: 60px 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
}

.comparador-modal__spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-top-color: #00e07a;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
.comparador-modal__results::-webkit-scrollbar { width: 4px; }
.comparador-modal__results::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.05); border-radius: 2px; }
