:root {
  --primary: #000000;
  --accent: #2563eb;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
}

/* =========================================
   BARRA DE HERRAMIENTAS (FILTROS)
   ========================================= */
.cat-toolbar-section { padding-bottom: 40px; }
.cat-grid-section{ padding-bottom: 40px; }

.cat-toolbar {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cat-header {
  display: flex;
  justify-content: center;  
  align-items: center;     
  text-align: center;      
  padding: 20px 0;          
}

.nx-container {
    max-width: 1200px;
    width: 100%;
    
    /* ESTO AGREGA EL MARGEN INTERNO A LOS LADOS */
    padding-left: 20px;
    padding-right: 20px;
    
    /* Importante para que el padding no sume al ancho total y rompa el 100% */
    box-sizing: border-box; 
    
    margin-left: auto;
    margin-right: auto;
}


.cat-filters-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* Items individuales del filtro */
.cat-filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-left: 4px;
}

/* Wrapper del Select para estilo personalizado */
.cat-select-wrapper {
  position: relative;
  width: 160px;
}

.cat-select {
  width: 100%;
  appearance: none; /* Quita estilo por defecto */
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 30px 10px 12px;
  font-size: 14px;
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-select:hover, .cat-select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  outline: none;
}

.cat-select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Buscador */
.cat-search-container {
  position: relative;
  flex-grow: 1;
  max-width: 300px;
}

.cat-search-input {
  width: 100%;
  padding: 12px 45px 12px 20px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  font-size: 14px;
  transition: all 0.2s;
}

.cat-search-input:focus {
  background: #fff;
  border-color: var(--accent);
  outline: none;
}

.cat-search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: color 0.2s;
}

.cat-search-btn:hover { color: var(--accent); }

/* =========================================
   GRID Y TARJETAS INTELIGENTES
   ========================================= */

.pro-grid-modern {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  /* Esto hace que todas las celdas de la fila tengan la misma altura */
  align-items: stretch; 
}

.card-tech {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  
  /* CRUCIAL: Flex column para que el contenido se estire */
  display: flex;
  flex-direction: column;
  height: 100%; 
}

.card-tech:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
}

.card-tech__badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(255,255,255,0.95);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #059669;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-tech__media {
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
  padding: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 240px; /* Altura fija para imagen */
}

.card-tech__media img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.3s;
}

.card-tech:hover .card-tech__media img { transform: scale(1.08); }

.card-tech__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Ocupa todo el espacio restante */
}

.card-tech__brand {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.card-tech__title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 10px;
  line-height: 1.3;
}
.card-tech__title a { text-decoration: none; color: var(--text-main); }

.card-tech__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* BOTÓN TOGGLE */
.btn-toggle-specs {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 15px;
  width: fit-content;
}

.btn-toggle-specs .icon-chevron { transition: transform 0.3s; }
.btn-toggle-specs:hover { text-decoration: underline; }

/* LISTA DE SPECS */
.card-tech__specs-wrapper {
  background: #f8fafc;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid var(--border);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tech-specs-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tech-spec-item {
  display: flex;
  align-items: flex-end;
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--text-main);
}
.tech-spec-item:last-child { margin-bottom: 0; }

.spec-key { font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.spec-dots {
  flex-grow: 1;
  border-bottom: 1px dotted #cbd5e1;
  margin: 0 5px 4px 5px;
}
.spec-value { font-weight: 700; text-align: right; }

/* ESPACIADOR FLEXIBLE */
.card-tech__spacer { flex-grow: 1; } 
/* Esto empuja el footer hacia abajo si el contenido de arriba es corto,
   pero si se abren las specs, esto se contrae y el contenedor crece */

/* FOOTER */
.card-tech__footer {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-tech__price { display: flex; flex-direction: column; }
.price-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.price-val { font-size: 16px; font-weight: 800; color: var(--text-main); }

.btn-tech-buy {
  background: var(--primary);
  color: #fff;
  padding: 8px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-tech-buy:hover { background: var(--accent); transform: scale(1.05); }

/* Responsive */
/* =========================================
   CORRECCIÓN RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 768px) {
  
  /* Contenedor principal: Columna vertical */
  .cat-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 16px;
  }

  /* --- 1. EL BUSCADOR PRIMERO --- */
  .cat-search-container {
    width: 100%;
    max-width: 100%; /* Quitamos el límite de 300px */
    order: -1; /* ¡Magia! Sube el buscador al inicio visualmente */
    margin-bottom: 5px;
  }

  /* --- 2. FILTROS EN CUADRÍCULA (GRID) --- */
  .cat-filters-group {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dos columnas del mismo tamaño */
    gap: 12px;
    width: 100%;
  }

  /* El último filtro (Memoria) ocupará todo el ancho para cerrar el bloque bonito */
  .cat-filter-item:last-child {
    grid-column: span 2;
  }

  /* Ajuste de los inputs para llenar la cuadrícula */
  .cat-filter-item, 
  .cat-select-wrapper {
    width: 100%;
  }

  /* Pequeño ajuste visual para las etiquetas en móvil */
  .cat-filter-label {
    margin-bottom: 2px;
  }
  .nx-container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Ajuste extra para que el grid no se corte */
    .pro-grid-modern {
        gap: 20px; /* Reducimos el hueco entre tarjetas en móvil */
    }
}





